playwright
Test authoring guidelines
For more details on Playwright best practices see https://playwright.dev/docs/best-practices
Test user-visible behavior
Automated tests should verify that the application code works for the end users, and avoid relying on implementation details such as things which users will not typically use, see, or even know about such as the name of a function, whether something is an array, or the CSS class of some element. The end user will see or interact with what is rendered on the page, so your test should typically only see/interact with the same rendered output.
Make tests as isolated as possible
Each test should be completely isolated from another test and should run independently with its own local storage, session storage, data, cookies etc.
Avoid testing third-party dependencies
Only test what you control. Don't try to test links to external sites or third party servers that you do not control, unless it is specifically for testing purposes.
Use locators
Locators come with auto waiting and retry-ability. To make tests resilient, we recommend prioritizing user-facing attributes and explicit contracts.