TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Detecting and Handling Flaky Tests in Playwright

23 pointsby lucgaganalmost 2 years ago

3 comments

onion2kalmost 2 years ago
Something that makes your end-to-end tests a heck of a lot more resilient is mocking your API so you&#x27;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&#x27;s a Playwright integration (<a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;playwright-msw" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;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&#x27;d expect with a different set of tests. :)
评论 #36571364 未加载
petercooperalmost 2 years ago
It&#x27;s still not loading for me (redirect loop) but archive.org has it already so I could still read it at <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20230703090352&#x2F;https:&#x2F;&#x2F;ray.run&#x2F;blog&#x2F;detecting-and-handling-flaky-tests-in-playwright" rel="nofollow noreferrer">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20230703090352&#x2F;https:&#x2F;&#x2F;ray.run&#x2F;b...</a>
willhackettalmost 2 years ago
I really wanted to read this, but I think we may have hugged your site to death.
评论 #36571037 未加载