Something that makes your end-to-end tests a heck of a lot more resilient is mocking your API so you're not hitting the network, and so your API responses are deterministic. Doing that also makes the tests run a lot faster. MSW is my preferred library for doing that, and there's a Playwright integration (<a href="https://www.npmjs.com/package/playwright-msw" rel="nofollow noreferrer">https://www.npmjs.com/package/playwright-msw</a>).<p>Mocking the API makes it really easy to response with failures too - having a test that checks the app handles a 500 error or a 401 Unauthorized is really useful, and a total pain to do without mocks.<p>You can test the API is working and returning what you'd expect with a different set of tests. :)
It's still not loading for me (redirect loop) but archive.org has it already so I could still read it at <a href="https://web.archive.org/web/20230703090352/https://ray.run/blog/detecting-and-handling-flaky-tests-in-playwright" rel="nofollow noreferrer">https://web.archive.org/web/20230703090352/https://ray.run/b...</a>