release notes
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
release notes
Published 2 weeks ago
MinorContains breaking changesrelease notes
Published 2 weeks ago
MinorContains breaking changestracing.startHar() / tracing.stopHar() expose HAR recording as a first-class tracing API, with the same content, mode and urlFilter options as recordHar. The returned Disposable makes it easy to scope a recording with await using:
await using har = await context.tracing.startHar('trace.har');
const page = await context.newPage();
await page.goto('https://playwright.dev');
// HAR is finalized when `har` goes out of scope.
New locator.drop() simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches dragenter, dragover, and drop with a synthetic [DataTransfer] in the page context — works cross-browser and is great for testing upload zones:
await page.locator('#dropzone').drop({
files: { name: 'note.txt', mimeType: 'text/plain', buffer: Buffer.from('hello') },
});
await page.locator('#dropzone').drop({
data: {
'text/plain': 'hello world',
'text/uri-list': 'https://example.com',
},
});
page.locator('body').boxes option on locator.ariaSnapshot() / page.ariaSnapshot() appends each element's bounding box as [box=x,y,width,height], useful for AI consumption.New test.abort() aborts the currently running test from a fixture, hook, or route handler with an optional message. Use it when you have detected an unrecoverable misuse and want to fail the test right away:
test('does not publish to the shared page', async ({ page }) => {
await page.route('**/publish', route => {
test.abort('Tests must not publish to the shared page. Use the `clone` option.');
return route.abort();
});
// ...
});
description in page.getByRole() / locator.getByRole() / frame.getByRole() / frameLocator.getByRole() for matching the accessible description.pseudo in expect(locator).toHaveCSS() reads computed styles from ::before or ::after.style in locator.highlight() applies extra inline CSS to the highlight overlay, plus new page.hideHighlight() to clear all highlights.noDefaults in browserType.connectOverCDP() disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.line / column properties (lineNumber / columnNumber are deprecated).expect(...) matcher failure.workerInfo argument with details about the worker for fixture teardown errors.{testFileBaseName} token in testProject.snapshotPathTemplate — file name without extension.workers: 0 or negative values.npx playwright show-report accepts .zip files directly — no need to unzip first.repeatEachIndex is shown in the test header when non-zero.Locator.ariaRef() — use the standard locator.ariaSnapshot() pipeline.handle option on BrowserContext.exposeBinding and Page.exposeBinding.logger option on BrowserType.connect and BrowserType.connectOverCDP — use tracing instead.videosPath / videoSize — use recordVideo instead.This version was also tested against the following stable channels:
tracing.startHar() / tracing.stopHar() expose HAR recording as a first-class tracing API, with the same content, mode and urlFilter options as recordHar. The returned Disposable makes it easy to scope a recording with await using:
await using har = await context.tracing.startHar('trace.har');
const page = await context.newPage();
await page.goto('https://playwright.dev');
// HAR is finalized when `har` goes out of scope.
New locator.drop() simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches dragenter, dragover, and drop with a synthetic [DataTransfer] in the page context — works cross-browser and is great for testing upload zones:
await page.locator('#dropzone').drop({
files: { name: 'note.txt', mimeType: 'text/plain', buffer: Buffer.from('hello') },
});
await page.locator('#dropzone').drop({
data: {
'text/plain': 'hello world',
'text/uri-list': 'https://example.com',
},
});
page.locator('body').boxes option on locator.ariaSnapshot() / page.ariaSnapshot() appends each element's bounding box as [box=x,y,width,height], useful for AI consumption.New test.abort() aborts the currently running test from a fixture, hook, or route handler with an optional message. Use it when you have detected an unrecoverable misuse and want to fail the test right away:
test('does not publish to the shared page', async ({ page }) => {
await page.route('**/publish', route => {
test.abort('Tests must not publish to the shared page. Use the `clone` option.');
return route.abort();
});
// ...
});
description in page.getByRole() / locator.getByRole() / frame.getByRole() / frameLocator.getByRole() for matching the accessible description.pseudo in expect(locator).toHaveCSS() reads computed styles from ::before or ::after.style in locator.highlight() applies extra inline CSS to the highlight overlay, plus new page.hideHighlight() to clear all highlights.noDefaults in browserType.connectOverCDP() disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.line / column properties (lineNumber / columnNumber are deprecated).expect(...) matcher failure.workerInfo argument with details about the worker for fixture teardown errors.{testFileBaseName} token in testProject.snapshotPathTemplate — file name without extension.workers: 0 or negative values.npx playwright show-report accepts .zip files directly — no need to unzip first.repeatEachIndex is shown in the test header when non-zero.Locator.ariaRef() — use the standard locator.ariaSnapshot() pipeline.handle option on BrowserContext.exposeBinding and Page.exposeBinding.logger option on BrowserType.connect and BrowserType.connectOverCDP — use tracing instead.videosPath / videoSize — use recordVideo instead.This version was also tested against the following stable channels: