本文档解释了为什么 Gutenberg 项目选择 Playwright 作为端到端测试框架,并概述了其关键优势。Playwright 提供了多浏览器支持、内置测试运行器等功能,以提升测试效率和可靠性。
There exists a rich ecosystem of tooling available for web-based end-to-end automated testing. Gutenberg uses Playwright as its end-to-end testing framework. The project previously used Puppeteer but has since fully migrated to Playwright. Here are the reasons Playwright was chosen:
@playwright/test provides a powerful test runner with parallel execution, fixtures, and auto-waiting, reducing flakiness and improving developer experience.waitFor* calls while still surfacing legitimate performance issues that affect users.page, browser, and other parameters into tests, making it easier to work with multiple pages or tabs and to run tests in parallel.For more details on writing end-to-end tests, see the End-to-End Testing guide.