[Snyk] Upgrade @playwright/test from 1.42.1 to 1.53.1 #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade @playwright/test from 1.42.1 to 1.53.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 746 versions ahead of your current version.
The recommended version was released 25 days ago.
Issues fixed by the recommended upgrade:
SNYK-JS-CROSSSPAWN-8303230
SNYK-JS-VITE-9653016
SNYK-JS-INTLIFYSHARED-8442251
SNYK-JS-VUEI18N-8442254
SNYK-JS-VUEI18N-9376708
SNYK-JS-VITE-9576207
SNYK-JS-BABELHELPERS-9397697
SNYK-JS-BABELRUNTIME-10044504
SNYK-JS-VITE-9685035
SNYK-JS-VITE-9919777
SNYK-JS-INTLIFYCOREBASE-8442262
SNYK-JS-NANOID-8492085
SNYK-JS-VUEI18N-8442260
SNYK-JS-ROLLUP-8073097
SNYK-JS-VITE-8648411
SNYK-JS-VITE-9512410
Release notes
Package name: @playwright/test
Highlights
#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
Browser Versions
This version was also tested against the following stable channels:
Trace Viewer and HTML Reporter Updates
New Steps in Trace Viewer and HTML reporter:

New option in
'html'
reporter to set the title of a specific test run:export default defineConfig({
reporter: [['html', { title: 'Custom test run fix websocket cross domain problem filebrowser/filebrowser#1028' }]]
});
Miscellaneous
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.
npx playwright install --list
will now list all installed browsers, versions and locations.Browser Versions
This version was also tested against the following stable channels:
Highlights
New method expect(locator).toContainClass() to ergonomically assert individual class names on the element.
Aria Snapshots got two new properties:
/children
for strict matching and/url
for links.Test Runner
--fail-on-flaky-tests
. This is useful for CI/CD environments where you want to ensure that all tests are stable before deploying.Miscellaneous
maxRedirects
in apiRequest.newContext() to control the maximum number of redirects.ref
in locator.ariaSnapshot() to generate reference for each element in the snapshot which can later be used to locate the element.!@ my-tag
or!my-file.spec.ts
or!p:my-project
.Breaking Changes
?
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 aCookie
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().Browser Versions
This version was also tested against the following stable channels:
Highlights
#35093 - [Regression]: TimeoutOverflowWarning: 2149630296.634 does not fit into a 32-bit signed integer
#35138 - [Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo')
Browser Versions
This version was also tested against the following stable channels:
StorageState for indexedDB
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:
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 });
});
Copy prompt
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 elements
New option
visible
for locator.filter() allows matching only visible elements.Git information in HTML report
Set option testConfig.captureGitInfo to capture git information into testConfig.metadata.
import { defineConfig } from '@ playwright/test';
export default defineConfig({
captureGitInfo: { commit: true, diff: true }
});
HTML report will show this information when available:
Test Step improvements
A new TestStepInfo object is now available in test steps. You can add step attachments or skip the step under some conditions.
// Note the new "step" argument:
await test.step('here is my step', async step => {
step.skip(isMobile, 'not relevant on mobile layouts');
});
});
Miscellaneous
contrast
for methods page.emulateMedia() and browser.newContext() allows to emulate theprefers-contrast
media feature.failOnStatusCode
makes all fetch requests made through the APIRequestContext throw on response codes other than 2xx and 3xx.Browser Versions
This version was also tested against the following stable channels:
Highlights
#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
Browser Versions
This version was also tested against the following stable channels:
Test runner
New option
timeout
allows specifying a maximum run time for an individual test step. A timed-out step will fail the execution of the test.New method test.step.skip() to disable execution of a test step.
await test.step('before running step', async () => {
// Normal step
});
await test.step.skip('not yet ready', async () => {
// This step is skipped
});
await test.step('after running step', async () => {
// This step still runs even though the previous one was skipped
});
});
Expanded expect(locator).toMatchAriaSnapshot() to allow storing of aria snapshots in separate YAML files.
Added method expect(locator).toHaveAccessibleErrorMessage() to assert the Locator points to an element with a given aria errormessage.
Option testConfig.updateSnapshots added the configuration enum
changed
.changed
updates only the snapshots that have changed, whereasall
now updates all snapshots, regardless of whether there are any differences.New option testConfig.updateSourceMethod defines the way source code is updated when testConfig.updateSnapshots is configured. Added
overwrite
and3-way
modes that write the changes into source code, on top of existingpatch
mode that creates a patch file.npx playwright test --update-snapshots=changed --update-source-method=3way
Option testConfig.webServer added a
gracefulShutdown
field for specifying a process kill signal other than the defaultSIGKILL
.Exposed testStep.attachments from the reporter API to allow retrieval of all attachments created by that step.
New option
pathTemplate
fortoHaveScreenshot
andtoMatchAriaSnapshot
assertions in the testConfig.expect configuration.UI updates
canvas
content in traces is error-prone. Display is now disabled by default, and can be enabled via theDisplay canvas content
UI setting.Call
andNetwork
panels now display additional time information.Breaking
<input>
,<select>
, or a number of other editable elements.all
, rather than only the failed/changed snapshots. Use the new enumchanged
to keep the old functionality of only updating the changed snapshots.Browser Versions
This version was also tested against the following stable channels:
Summary by Sourcery
Upgrade the Playwright test framework to version 1.53.1 to incorporate important security and stability fixes
Bug Fixes:
Build: