TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Detecting and Handling Flaky Tests in Playwright

23 点作者 lucgagan将近 2 年前

3 条评论

onion2k将近 2 年前
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 未加载
petercooper将近 2 年前
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>
willhackett将近 2 年前
I really wanted to read this, but I think we may have hugged your site to death.
评论 #36571037 未加载