v1.62.0
Breaking Changes📦 playwrightView on GitHub →
⚠ 1 breaking✨ 13 features🔧 19 symbols
Summary
This release introduces a new component testing model with stories and galleries, and allows operations to be cancelled using AbortSignal. It also adds support for WebP screenshots and custom test filtering.
⚠️ Breaking Changes
- Debian 11 is no longer supported. Users on Debian 11 will need to upgrade their operating system or use a supported distribution.
Migration Steps
- When using `page.screenshot()` or `locator.screenshot()`, consider specifying the `type` as 'webp' for WebP format screenshots, with `quality` for lossy compression if desired.
✨ New Features
- Component testing now uses a stories and galleries model, with a new `fixtures.mount()` fixture for mounting stories and returning a Locator scoped to the story's root element.
- Operations and web-first assertions now accept a `signal` option that takes an `AbortSignal` for cancelling long-running actions.
- Screenshots can now be saved in WebP format by naming the snapshot file with a `.webp` extension.
- Added a new `reporter.preprocess()` hook to allow custom test filtering before tests begin.
- Introduced `testConfig.retryStrategy` with an `'isolated'` option to run retries at the end of the test suite in a single worker.
- New `credentials` option for `browserContext.storageState` to persist and re-seed virtual WebAuthn credentials.
- Added a `scroll` option (`"auto"` | `"none"`) to actions to opt out of automatic scroll-into-view.
- New `apiResponse.timing()` method to retrieve resource timing information for API responses.
- New `locator.waitForFunction()` method to wait until a function returns a truthy value when called with the matching element.
- `page.evaluate()` and related methods now accept functions as evaluate arguments.
- `page.addInitScript()` and `browserContext.addInitScript()` now accept functions as init-script arguments.
- Playwright now bundles the Playwright MCP server and `playwright-cli`, accessible via `npx playwright mcp` and `npx playwright cli`.
- The HTML report's 'Merge files' grouping can now be enabled from the config using the `mergeFiles` reporter option.
Affected Symbols
fixtures.mount()AbortSignalexpect(page).toHaveScreenshot()expect(locator).toHaveScreenshot()page.screenshot()locator.screenshot()reporter.preprocess()TestRuntestConfig.retryStrategybrowserContext.storageStateCredentialsactionsapiResponse.timing()locator.waitForFunction()page.evaluate()page.addInitScript()browserContext.addInitScript()playwright-clireporter: [['html', { mergeFiles: true }]]