|
18 | 18 | - [Adding a Download Package Manager](#adding-a-download-package-manager) |
19 | 19 | - [Unit Tests and Storybooks](#unit-tests-and-storybooks) |
20 | 20 | - [General Guidelines for Unit Tests](#general-guidelines-for-unit-tests) |
| 21 | + - [General Guidelines for Playwright E2E Tests](#general-guidelines-for-playwright-e2e-tests) |
21 | 22 | - [General Guidelines for Storybooks](#general-guidelines-for-storybooks) |
22 | 23 | - [Remarks on Technologies used](#remarks-on-technologies-used) |
23 | 24 | - [Seeking additional clarification](#seeking-additional-clarification) |
@@ -437,6 +438,23 @@ Unit Tests are fundamental to ensure that code changes do not disrupt the functi |
437 | 438 | - Common Providers and Contexts from the lifecycle of our App, such as [`next-intl`][] should not be mocked but given an empty or fake context whenever possible. |
438 | 439 | - We recommend reading previous unit tests from the codebase for inspiration and code guidelines. |
439 | 440 |
|
| 441 | +### General Guidelines for Playwright E2E Tests |
| 442 | + |
| 443 | +End-to-end (E2E) tests are essential for ensuring that the entire application works correctly from a user's perspective: |
| 444 | + |
| 445 | +- E2E tests are located in the `apps/site/tests/e2e` directory. |
| 446 | +- We use [Playwright](https://playwright.dev/) as our E2E testing framework. |
| 447 | +- E2E tests should focus on user flows and critical paths through the application. |
| 448 | +- Tests should be written to be resilient to minor UI changes and should prioritize testing functionality over exact visual appearance. |
| 449 | +- When writing E2E tests: |
| 450 | + - Use meaningful test descriptions that clearly indicate what is being tested. |
| 451 | + - Group related tests using Playwright's test grouping features. |
| 452 | + - Use page objects or similar patterns to keep tests maintainable. |
| 453 | + - Minimize test interdependencies to prevent cascading failures. |
| 454 | +- Tests should run against the built application to accurately reflect the production environment. |
| 455 | +- We recommend reviewing existing E2E tests in the codebase for patterns and best practices. |
| 456 | +- If your feature involves complex user interactions or spans multiple pages, consider adding E2E tests to verify the complete flow. |
| 457 | + |
440 | 458 | ### General Guidelines for Storybooks |
441 | 459 |
|
442 | 460 | Storybooks are an essential part of our development process. They help us to document our components and to ensure that the components are working as expected. |
|
0 commit comments