Releases · microsoft/playwright
v1.54.2 Highlights#36714 - [Regression]: Codegen is not able to launch in Administrator Terminal on Windows (ProtocolError: Protocol error)
#36828 - [Regression]: Playwright Codegen keeps spamming with selected option
#36810 - [Regression]: Starting Codegen with target language doesn't work anymore
This version was also tested against the following stable channels:
#36650 - [Regression]: 1.54.0 breaks downloading browsers when an HTTP(S) proxy is used
Browser VersionsThis version was also tested against the following stable channels:
New cookie property partitionKey
in browserContext.cookies() and browserContext.addCookies(). This property allows to save and restore partitioned cookies. See CHIPS MDN article for more information. Note that browsers have different support and defaults for cookie partitioning.
New option noSnippets
to disable code snippets in the html report.
import { defineConfig } from '@playwright/test'; export default defineConfig({ reporter: [['html', { noSnippets: true }]] });
New property location
in test annotations, for example in testResult.annotations and testInfo.annotations. It shows where the annotation like test.skip
or test.fixme
was added.
New option --user-data-dir
in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
npx playwright codegen --user-data-dir=./user-data
Option -gv
has been removed from the npx playwright test
command. Use --grep-invert
instead.
npx playwright open
does not open the test recorder anymore. Use npx playwright codegen
instead.
This version was also tested against the following stable channels:
#36317 - [Regression]: Merging pre-1.53 blob reports loses attachments
#36357 - [Regression (Chromium)]: CDP missing trailing slash
#36292 - [Bug (MSEdge)]: Edge fails to launch when using msRelaunchNoCompatLayer
This version was also tested against the following stable channels:
#36339 - [Regression]: Click can fail when scrolling required
#36307 - [Regression (Chromium)]: Under some scenarios filling a textarea
doesn't fill
#36294 - [Regression (Firefox)]: setViewportSize
times out
#36350 - [Fix]: Display HTTP method for fetch trace entries
This version was also tested against the following stable channels:
New option in 'html'
reporter to set the title of a specific test run:
import { defineConfig } from '@playwright/test'; export default defineConfig({ reporter: [['html', { title: 'Custom test run #1028' }]] });
New option kind
in testInfo.snapshotPath() controls which snapshot path template is used.
New method locator.describe() to describe a locator. Used for trace viewer and reports.
const button = page.getByTestId('btn-sub').describe('Subscribe button'); await button.click();
npx playwright install --list
will now list all installed browsers, versions and locations.
This version was also tested against the following stable channels:
New method expect(locator).toContainClass() to ergonomically assert individual class names on the element.
await expect(page.getByRole('listitem', { name: 'Ship v1.52' })).toContainClass('done');
Aria Snapshots got two new properties: /children
for strict matching and /url
for links.
await expect(locator).toMatchAriaSnapshot(` - list - /children: equal - listitem: Feature A - listitem: - link "Feature B": - /url: "https://playwright.dev" `);
--fail-on-flaky-tests
. This is useful for CI/CD environments where you want to ensure that all tests are stable before deploying.maxRedirects
in apiRequest.newContext() to control the maximum number of redirects.!@my-tag
or !my-file.spec.ts
or !p:my-project
.?
wildcard is not supported any more, it will always match question mark ?
character.[]
are not supported anymore. We recommend using regular expressions instead.Cookie
header anymore. If a Cookie
header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use browserContext.addCookies().This version was also tested against the following stable channels:
#35093 - [Regression]: TimeoutOverflowWarning: 2149630296.634 does not fit into a 32-bit signed integer
#35138 - [Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo')
This version was also tested against the following stable channels:
New option indexedDB
for browserContext.storageState() allows to save and restore IndexedDB contents. Useful when your application uses IndexedDB API to store authentication tokens, like Firebase Authentication.
Here is an example following the authentication guide:
// tests/auth.setup.ts import { test as setup, expect } from '@playwright/test'; import path from 'path'; const authFile = path.join(__dirname, '../playwright/.auth/user.json'); setup('authenticate', async ({ page }) => { await page.goto('/'); // ... perform authentication steps ... // make sure to save indexedDB await page.context().storageState({ path: authFile, indexedDB: true }); });
New "Copy prompt" button on errors in the HTML report, trace viewer and UI mode. Click to copy a pre-filled LLM prompt that contains the error message and useful context for fixing the error.
Filter visible elementsNew option visible
for locator.filter() allows matching only visible elements.
// example.spec.ts test('some test', async ({ page }) => { // Ignore invisible todo items. const todoItems = page.getByTestId('todo-item').filter({ visible: true }); // Check there are exactly 3 visible ones. await expect(todoItems).toHaveCount(3); });Git information in HTML report
Set option testConfig.captureGitInfo to capture git information into testConfig.metadata.
// playwright.config.ts import { defineConfig } from '@playwright/test'; export default defineConfig({ captureGitInfo: { commit: true, diff: true } });
HTML report will show this information when available:
Test Step improvementsA new TestStepInfo object is now available in test steps. You can add step attachments or skip the step under some conditions.
test('some test', async ({ page, isMobile }) => { // Note the new "step" argument: await test.step('here is my step', async step => { step.skip(isMobile, 'not relevant on mobile layouts'); // ... await step.attach('my attachment', { body: 'some text' }); // ... }); });Miscellaneous
contrast
for methods page.emulateMedia() and browser.newContext() allows to emulate the prefers-contrast
media feature.failOnStatusCode
makes all fetch requests made through the APIRequestContext throw on response codes other than 2xx and 3xx.This version was also tested against the following stable channels:
#34483 - [Feature]: single aria snapshot for different engines/browsers
#34497 - [Bug]: Firefox not handling keepalive: true fetch requests
#34504 - [Bug]: update snapshots not creating good diffs
#34507 - [Bug]: snapshotPathTemplate doesnt work when multiple projects
#34462 - [Bug]: updateSnapshots "changed" throws an error
This version was also tested against the following stable channels:
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4