[Snyk] Upgrade @playwright/test from 1.19.0-alpha-1643749494000 to 1.39.0 #877
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.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade @playwright/test from 1.19.0-alpha-1643749494000 to 1.39.0.
ℹ️ 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 fixes:
SNYK-JS-INFLIGHT-6095116
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-JPEGJS-2859218
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-SEMVER-3247795
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-JSON5-3182856
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-JSON5-3182856
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-MINIMATCH-3050818
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-MINIMIST-2429795
Why? Recently disclosed, Has a fix available, CVSS 7.5
SNYK-JS-BABELTRAVERSE-5962462
Why? Recently disclosed, Has a fix available, CVSS 7.5
(*) Note that the real score may have changed since the PR was raised.
Release notes
Package name: @playwright/test
Add custom matchers to your expect
You can extend Playwright assertions by providing custom matchers. These matchers will be available on the expect object.
export const expect = baseExpect.extend({
async toHaveAmount(locator: Locator, expected: number, options?: { timeout?: number }) {
// ... see documentation for how to write matchers.
},
});
test('pass', async ({ page }) => {
await expect(page.getByTestId('cart')).toHaveAmount(5);
});
See the documentation for a full example.
Merge test fixtures
You can now merge test fixtures from multiple files or modules:
import { test as dbTest } from 'database-test-utils';
import { test as a11yTest } from 'a11y-test-utils';
export const test = mergeTests(dbTest, a11yTest);
test('passes', async ({ database, page, a11y }) => {
// use database and a11y fixtures.
});
Merge custom expect matchers
You can now merge custom expect matchers from multiple files or modules:
import { test as dbTest, expect as dbExpect } from 'database-test-utils';
import { test as a11yTest, expect as a11yExpect } from 'a11y-test-utils';
export const test = mergeTests(dbTest, a11yTest);
export const expect = mergeExpects(dbExpect, a11yExpect);
test('passes', async ({ page, database }) => {
await expect(database).toHaveDatabaseUser('admin');
await expect(page).toPassA11yAudit();
});
Hide implementation details: box test steps
You can mark a
test.step()
as "boxed" so that errors inside it point to the step call site.> 15 | await login(page);
| ^
16 | });">
See
test.step()
documentation for a full example.New APIs
expect(locator).toHaveAttribute(name)
Browser Versions
This version was also tested against the following stable channels:
Highlights
#27071 - expect(value).toMatchSnapshot() deprecation announcement on V1.38
#27072 - [BUG] PWT trace viewer fails to load trace and throws TypeError
#27073 - [BUG] RangeError: Invalid time value
#27087 - [REGRESSION]: npx playwright test --list prints all tests twice
#27113 - [REGRESSION]: No longer able to extend PlaywrightTest.Matchers type for locators and pages
#27144 - [BUG]can not display trace
#27163 - [REGRESSION] Single Quote Wrongly Escaped by Locator When Using Unicode Flag
#27181 - [BUG] evaluate serializing fails at 1.38
Browser Versions
This version was also tested against the following stable channels:
UI Mode Updates
New APIs
browserContext.on('weberror')
locator.pressSequentially()
reporter.onEnd()
now reportsstartTime
and total runduration
.Deprecations
page.type()
,frame.type()
,locator.type()
andelementHandle.type()
.Please use
locator.fill()
instead which is much faster. Uselocator.pressSequentially()
only if there is aspecial keyboard handling on the page, and you need to press keys one-by-one.
Breaking Changes: Playwright no longer downloads browsers automatically
Note
If you are using
@ playwright/test
package, this change does not affect you.Playwright recommends to use
@ playwright/test
package and download browsers vianpx playwright install
command. If you are following this recommendation, nothing has changed for you.However, up to v1.38, installing the
playwright
package instead of@ playwright/test
did automatically download browsers. This is no longer the case, and we recommend to explicitly download browsers vianpx playwright install
command.v1.37 and earlier
playwright
package was downloading browsers duringnpm install
, while@ playwright/test
was not.v1.38 and later
playwright
and@ playwright/test
packages do not download browsers duringnpm install
.Recommended migration
Run
npx playwright install
to download browsers afternpm install
. For example, in your CI configuration:Alternative migration option - not recommended
Add
@ playwright/browser-chromium
,@ playwright/browser-firefox
and@ playwright/browser-webkit
as a dependency. These packages download respective browsers duringnpm install
. Make sure you keep the version of all playwright packages in sync:Browser Versions
This version was also tested against the following stable channels:
Highlights
#26496 - [REGRESSION] webServer stdout is always getting printed
#26492 - [REGRESSION] test.only with project dependency is not working
Browser Versions
This version was also tested against the following stable channels:
Read more
Highlights
#24316 - [REGRESSION] Character classes are not working in globs in 1.36
Browser Versions
This version was also tested against the following stable channels:
Highlights
#24184 - [REGRESSION]: Snapshot name contains some random string after test name when tests are run in container
Browser Versions
This version was also tested against the following stable channels:
Read more