Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade @playwright/test from 1.19.0-alpha-1643749494000 to 1.49.0 #1467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ARUMAIS
Copy link
Owner

@ARUMAIS ARUMAIS commented Dec 13, 2024

snyk-top-banner

Snyk has created this PR to upgrade @playwright/test from 1.19.0-alpha-1643749494000 to 1.49.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 is 1831 versions ahead of your current version.

  • The recommended version was released on 25 days ago.

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-SEMVER-3247795
506 Proof of Concept
high severity Denial of Service (DoS)
SNYK-JS-WS-7266574
506 Proof of Concept
high severity Uncontrolled resource consumption
SNYK-JS-BRACES-6838727
506 Proof of Concept
high severity Server-side Request Forgery (SSRF)
SNYK-JS-IP-6240864
506 Proof of Concept
high severity Denial of Service (DoS)
SNYK-JS-JPEGJS-2859218
506 Proof of Concept
high severity Inefficient Regular Expression Complexity
SNYK-JS-MICROMATCH-6838728
506 No Known Exploit
medium severity Prototype Pollution
SNYK-JS-JSON5-3182856
506 Proof of Concept
low severity Prototype Pollution
SNYK-JS-MINIMIST-2429795
506 Proof of Concept
critical severity Incomplete List of Disallowed Inputs
SNYK-JS-BABELTRAVERSE-5962462
506 Proof of Concept
medium severity Missing Release of Resource after Effective Lifetime
SNYK-JS-INFLIGHT-6095116
506 Proof of Concept
medium severity Server-Side Request Forgery (SSRF)
SNYK-JS-IP-7148531
506 Proof of Concept
medium severity Prototype Pollution
SNYK-JS-JSON5-3182856
506 Proof of Concept
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-MINIMATCH-3050818
506 No Known Exploit
Release notes
Package name: @playwright/test
  • 1.49.0 - 2024-11-18

    Aria snapshots

    New assertion expect(locator).toMatchAriaSnapshot() verifies page structure by comparing to an expected accessibility tree, represented as YAML.

    await page.goto('https://playwright.dev');
    await expect(page.locator('body')).toMatchAriaSnapshot(`
      - banner:
        - heading /Playwright enables reliable/ [level=1]
        - link "Get started"
        - link "Star microsoft/playwright on GitHub"
      - main:
        - img "Browsers (Chromium, Firefox, WebKit)"
        - heading "Any browser • Any platform • One API"
    `);

    You can generate this assertion with Test Generator and update the expected snapshot with --update-snapshots command line flag.

    Learn more in the aria snapshots guide.

    Test runner

    Breaking: channels chrome, msedge and similar switch to new headless

    This change affects you if you're using one of the following channels in your playwright.config.ts:

    • chrome, chrome-dev, chrome-beta, or chrome-canary
    • msedge, msedge-dev, msedge-beta, or msedge-canary

    What do I need to do?

    After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See issue #33566 for more details.

    Other breaking changes

    • There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version.
    • Package @ playwright/experimental-ct-vue2 will no longer be updated.
    • Package @ playwright/experimental-ct-solid will no longer be updated.

    Try new Chromium headless

    You can opt into the new headless mode by using 'chromium' channel. As official Chrome documentation puts it:

    New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing.

    See issue #33566 for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in.

    import { defineConfig, devices } from '@ playwright/test';

    export default defineConfig({
    projects: [
    {
    name: 'chromium',
    use: { ...devices['Desktop Chrome'], channel: 'chromium' },
    },
    ],
    });

    Miscellaneous

    • <canvas> elements inside a snapshot now draw a preview.
    • New method tracing.group() to visually group actions in the trace.
    • Playwright docker images switched from Node.js v20 to Node.js v22 LTS.

    Browser Versions

    • Chromium 131.0.6778.33
    • Mozilla Firefox 132.0
    • WebKit 18.2

    This version was also tested against the following stable channels:

    • Google Chrome 130
    • Microsoft Edge 130
  • 1.49.0-beta-1733521450000 - 2024-12-06
  • 1.49.0-beta-1733285915000 - 2024-12-04
  • 1.49.0-beta-1733246833000 - 2024-12-03
  • 1.49.0-beta-1732799609000 - 2024-11-28
  • 1.49.0-beta-1732795940000 - 2024-11-28
  • 1.49.0-beta-1732795768000 - 2024-11-28
  • 1.49.0-beta-1732795640000 - 2024-11-28
  • 1.49.0-beta-1732210972000 - 2024-11-21
  • 1.49.0-beta-1732200847000 - 2024-11-21
  • 1.49.0-beta-1732183793000 - 2024-11-21
  • 1.49.0-beta-1732179895000 - 2024-11-21
  • 1.49.0-beta-1732065049000 - 2024-11-20
  • 1.49.0-beta-1732021985000 - 2024-11-19
  • 1.49.0-beta-1732008569000 - 2024-11-19
  • 1.49.0-beta-1731954680000 - 2024-11-18
  • 1.49.0-beta-1731772650000 - 2024-11-16
  • 1.49.0-beta-1731718789000 - 2024-11-16
  • 1.49.0-beta-1731709328000 - 2024-11-15
  • 1.49.0-beta-1731703794000 - 2024-11-15
  • 1.49.0-beta-1731687401000 - 2024-11-15
  • 1.49.0-beta-1731672404000 - 2024-11-15
  • 1.49.0-beta-1731616844000 - 2024-11-14
  • 1.49.0-beta-1731595428000 - 2024-11-14
  • 1.49.0-beta-1731591637000 - 2024-11-14
  • 1.49.0-beta-1731582214000 - 2024-11-14
  • 1.49.0-beta-1731562490000 - 2024-11-14
  • 1.49.0-beta-1731497689000 - 2024-11-13
  • 1.49.0-alpha-2024-11-13 - 2024-11-13
  • 1.49.0-alpha-2024-11-12 - 2024-11-12
  • 1.49.0-alpha-2024-11-11 - 2024-11-11
  • 1.49.0-alpha-2024-11-10 - 2024-11-10
  • 1.49.0-alpha-2024-11-09 - 2024-11-09
  • 1.49.0-alpha-2024-11-08 - 2024-11-08
  • 1.49.0-alpha-2024-11-07 - 2024-11-07
  • 1.49.0-alpha-2024-11-06 - 2024-11-06
  • 1.49.0-alpha-2024-11-05 - 2024-11-05
  • 1.49.0-alpha-2024-11-04 - 2024-11-04
  • 1.49.0-alpha-2024-11-03 - 2024-11-03
  • 1.49.0-alpha-2024-11-02 - 2024-11-02
  • 1.49.0-alpha-2024-11-01 - 2024-11-01
  • 1.49.0-alpha-2024-10-31 - 2024-10-31
  • 1.49.0-alpha-2024-10-30 - 2024-10-30
  • 1.49.0-alpha-2024-10-29 - 2024-10-29
  • 1.49.0-alpha-2024-10-28 - 2024-10-28
  • 1.49.0-alpha-2024-10-27 - 2024-10-27
  • 1.49.0-alpha-2024-10-26 - 2024-10-26
  • 1.49.0-alpha-2024-10-25 - 2024-10-25
  • 1.49.0-alpha-2024-10-24 - 2024-10-24
  • 1.49.0-alpha-2024-10-23 - 2024-10-23
  • 1.49.0-alpha-2024-10-22 - 2024-10-22
  • 1.49.0-alpha-2024-10-21 - 2024-10-21
  • 1.49.0-alpha-2024-10-20 - 2024-10-20
  • 1.49.0-alpha-2024-10-19 - 2024-10-19
  • 1.49.0-alpha-2024-10-18 - 2024-10-18
  • 1.49.0-alpha-2024-10-17 - 2024-10-17
  • 1.49.0-alpha-2024-10-16 - 2024-10-16
  • 1.49.0-alpha-2024-10-15 - 2024-10-15
  • 1.49.0-alpha-2024-10-14 - 2024-10-14
  • 1.49.0-alpha-2024-10-13 - 2024-10-13
  • 1.49.0-alpha-2024-10-12 - 2024-10-12
  • 1.49.0-alpha-2024-10-11 - 2024-10-11
  • 1.49.0-alpha-2024-10-10 - 2024-10-10
  • 1.49.0-alpha-2024-10-09 - 2024-10-09
  • 1.49.0-alpha-2024-10-08 - 2024-10-08
  • 1.49.0-alpha-2024-10-07 - 2024-10-07
  • 1.49.0-alpha-2024-10-06 - 2024-10-06
  • 1.49.0-alpha-2024-10-05 - 2024-10-05
  • 1.49.0-alpha-2024-10-04 - 2024-10-04
  • 1.49.0-alpha-2024-10-03 - 2024-10-03
  • 1.49.0-alpha-2024-10-02 - 2024-10-02
  • 1.49.0-alpha-2024-10-01 - 2024-10-01
  • 1.49.0-alpha-1730721360000 - 2024-11-04
  • 1.49.0-alpha-1728937530000 - 2024-10-14
  • 1.48.2 - 2024-10-25

    Highlights

    #33141 - [Bug]: UI Mode crashed
    #33219 - [BUG] Trace Viewer PWA crashes with "Aw, Snap!"
    #33086 - [Bug]: UI Mode Memory problem
    #33000 - [Regression]: Inspector and Browser doesn't close on CTRL+C
    #33204 - [Bug]: Chrome tab and inspector not closing after terminating session in terminal

    Browser Versions

    • Chromium 130.0.6723.19
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 129
    • Microsoft Edge 129
  • 1.48.2-beta-1729887785000 - 2024-10-25
  • 1.48.1 - 2024-10-16

    Highlights

    #33023 - [Bug]: command line flag --headed has no effect in ui mode
    #33107 - [REGRESSION]: page.waitForRequest does not get resolved since 1.48.0
    #33085 - [Bug]: WebSocket route does not handle full URLs in Playwright
    #33052 - [Regression]: Inspector not showing recorded steps
    #33132 - [Bug]: Wrong Ubuntu release name in Dockerfile.noble
    #32996 - [BUG] Trace attachments have small unusable height

    Browser Versions

    • Chromium 130.0.6723.19
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 129
    • Microsoft Edge 129
  • 1.48.1-beta-1729803910000 - 2024-10-24
  • 1.48.1-beta-1729768444000 - 2024-10-24
  • 1.48.1-beta-1729761836000 - 2024-10-24
  • 1.48.1-beta-1729761824000 - 2024-10-24
  • 1.48.1-beta-1729538520000 - 2024-10-21
  • 1.48.1-beta-1729096710000 - 2024-10-16
  • 1.48.1-beta-1729071078000 - 2024-10-16
  • 1.48.0 - 2024-10-08

    WebSocket routing

    New methods page.routeWebSocket() and browserContext.routeWebSocket() allow to intercept, modify and mock WebSocket connections initiated in the page. Below is a simple example that mocks WebSocket communication by responding to a "request" with a "response".

    await page.routeWebSocket('/ws', ws => {
      ws.onMessage(message => {
        if (message === 'request')
          ws.send('response');
      });
    });

    See WebSocketRoute for more details.

    UI updates

    • New "copy" buttons for annotations and test location in the HTML report.
    • Route method calls like route.fulfill() are not shown in the report and trace viewer anymore. You can see which network requests were routed in the network tab instead.
    • New "Copy as cURL" and "Copy as fetch" buttons for requests in the network tab.

    Miscellaneous

    Browser Versions

    • Chromium 130.0.6723.19
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 129
    • Microsoft Edge 129
  • 1.48.0-beta-1729066602000 - 2024-10-16
  • 1.48.0-beta-1729034638000 - 2024-10-15
  • 1.48.0-beta-1729024528000 - 2024-10-15
  • 1.48.0-beta-1728993409000 - 2024-10-15
  • 1.48.0-beta-1728993389000 - 2024-10-15
  • 1.48.0-beta-1728983264000 - 2024-10-15
  • 1.48.0-beta-1728939942000 - 2024-10-14
  • 1.48.0-beta-1728916380000 - 2024-10-14
  • 1.48.0-beta-1728521270000 - 2024-10-10
  • 1.48.0-beta-1728408670000 - 2024-10-08
  • 1.48.0-beta-1728391058000 - 2024-10-08
  • 1.48.0-beta-1728384960000 - 2024-10-08
  • 1.48.0-beta-1728384890000 - 2024-10-08
  • 1.48.0-beta-1728371904000 - 2024-10-08
  • 1.48.0-beta-1728034490000 - 2024-10-04
  • 1.48.0-beta-1727939718000 - 2024-10-03
  • 1.48.0-beta-1727868641000 - 2024-10-02
  • 1.48.0-beta-1727802413000 - 2024-10-01
  • 1.48.0-beta-1727800739000 - 2024-10-01
  • 1.48.0-beta-1727721217000 - 2024-09-30
  • 1.48.0-beta-1727692967000 - 2024-09-30
  • 1.48.0-alpha-2024-09-30 - 2024-09-30
  • 1.48.0-alpha-2024-09-29 - 2024-09-29
  • 1.48.0-alpha-2024-09-28 - 2024-09-28
  • 1.48.0-alpha-2024-09-27 - 2024-09-27
  • 1.48.0-alpha-2024-09-26 - 2024-09-26
  • 1.48.0-alpha-2024-09-25 - 2024-09-25
  • 1.48.0-alpha-2024-09-24 - 2024-09-24
  • 1.48.0-alpha-2024-09-23 - 2024-09-23
  • 1.48.0-alpha-2024-09-22 - 2024-09-22
  • 1.48.0-alpha-2024-09-21 - 2024-09-21
  • 1.48.0-alpha-2024-09-20 - 2024-09-20
  • 1.48.0-alpha-2024-09-19 - 2024-09-19
  • 1.48.0-alpha-2024-09-18 - 2024-09-18
  • 1.48.0-alpha-2024-09-17 - 2024-09-17
  • 1.48.0-alpha-2024-09-16 - 2024-09-16
  • 1.48.0-alpha-2024-09-15 - 2024-09-15
  • 1.48.0-alpha-2024-09-14 - 2024-09-14
  • 1.48.0-alpha-2024-09-13 - 2024-09-13
  • 1.48.0-alpha-2024-09-12 - 2024-09-12
  • 1.48.0-alpha-2024-09-11 - 2024-09-11
  • 1.48.0-alpha-2024-09-10 - 2024-09-10
  • 1.48.0-alpha-2024-09-09 - 2024-09-09
  • 1.48.0-alpha-2024-09-08 - 2024-09-08
  • 1.48.0-alpha-2024-09-07 - 2024-09-07
  • 1.48.0-alpha-2024-09-06 - 2024-09-06
  • 1.48.0-alpha-1727434891000 - 2024-09-27
  • 1.47.2 - 2024-09-20

    Highlights

    #32699 [REGRESSION]: fix(codegen): use content_frame property in python/.NET
    #32706 [REGRESSION]: page.pause() does not pause test timeout after 1.47
    #32661 - fix(trace-viewer): time delta between local and remote actions

    Browser Versions

    • Chromium 129.0.6668.29
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 128
    • Microsoft Edge 128
  • 1.47.2-beta-1727139937000 - 2024-09-24
  • 1.47.2-beta-1726852863000 - 2024-09-20
  • 1.47.1 - 2024-09-13

    Highlights

    #32480 - [REGRESSION]: tsconfig.json's compilerOptions.paths no longer working in 1.47
    #32552 - [REGRESSION]: broken UI in Trace Viewer while showing network response body

    Browser Versions

    • Chromium 129.0.6668.29
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 128
    • Microsoft Edge 128
  • 1.47.1-beta-1726849306000 - 2024-09-20
  • 1.47.1-beta-1726827698000 - 2024-09-20
  • 1.47.1-beta-1726598621000 - 2024-09-17
  • 1.47.1-beta-1726247857000 - 2024-09-13
  • 1.47.0 - 2024-09-05

    Network Tab improvements

    The Network tab in the UI mode and trace viewer has several nice improvements:

    • filtering by asset type and URL
    • better display of query string parameters
    • preview of font assets

    Network tab now has filters

    Credit to @ kubajanik for these wonderful improvements!

    --tsconfig CLI option

    By default, Playwright will look up the closest tsconfig for each imported file using a heuristic. You can now specify a single tsconfig file in the command line, and Playwright will use it for all imported files, not only test files:

    # Pass a specific tsconfig
    npx playwright test --tsconfig tsconfig.test.json

    APIRequestContext now accepts URLSearchParams and string as query parameters

    You can now pass URLSearchParams and string as query parameters to APIRequestContext:

    test('query params', async ({ request }) => {
      const searchParams = new URLSearchParams();
      searchParams.set('userId', 1);
      const response = await request.get(
          'https://jsonplaceholder.typicode.com/posts',
          {
            params: searchParams // or as a string: 'userId=1'
          }
      );
      // ...
    });

    Miscellaneous

    • The mcr.microsoft.com/playwright:v1.47.0 now serves a Playwright image based on Ubuntu 24.04 Noble.
      To use the 22.04 jammy-based image, please use mcr.microsoft.com/playwright:v1.47.0-jammy instead.
    • The :latest/:focal/:jammy tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
    • New option behavior in page.removeAllListeners(), browser.removeAllListeners() and browserContext.removeAllListeners() to wait for ongoing listeners to complete.
    • TLS client certificates can now be passed from memory by passing cert and key as buffers instead of file paths.
    • Attachments with a text/html content type can now be opened in a new tab in the HTML report. This is useful for including third-party reports or other HTML content in the Playwright test report and distributing it to your team.
    • noWaitAfter in locator.selectOption() was deprecated.
    • We've seen reports of WebGL in Webkit misbehaving on GitHub Actions macos-13. We recommend upgrading GitHub Actions to macos-14.

    Browser Versions

    • Chromium 129.0.6668.29
    • Mozilla Firefox 130.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 128
    • Microsoft Edge 128
  • 1.47.0-beta-1726138322000 - 2024-09-12
  • 1.47.0-beta-1726136860000 - 2024-09-12
  • 1.47.0-beta-1726127997000 - 2024-09-12
  • 1.47.0-beta-1726085360000 - 2024-09-11
  • 1.47.0-beta-1725889926000 - 2024-09-09
  • 1.47.0-beta-1725611500000 - 2024-09-06
  • 1.47.0-beta-1725570477000 - 2024-09-05
  • 1.47.0-beta-1725568763000 - 2024-09-05
  • 1.47.0-beta-1725550839000 - 2024-09-05
  • 1.47.0-beta-1725531189000 - 2024-09-05
  • 1.47.0-alpha-2024-09-05 - 2024-09-05
  • 1.47.0-alpha-2024-09-04 - 2024-09-04
  • 1.47.0-alpha-2024-09-03 - 2024-09-03
  • 1.47.0-alpha-2024-09-02 - 2024-09-02
  • 1.47.0-alpha-2024-09-01 - 2024-09-01
  • 1.47.0-alpha-2024-08-31 - 2024-08-31
  • 1.47.0-alpha-2024-08-30 - 2024-08-30
  • 1.47.0-alpha-2024-08-29 - 2024-08-29
  • 1.47.0-alpha-2024-08-28 - 2024-08-28
  • 1.47.0-alpha-2024-08-27 - 2024-08-27
  • 1.47.0-alpha-2024-08-26 - 2024-08-26
  • 1.47.0-alpha-2024-08-25 - 2024-08-25
  • 1.47.0-alpha-2024-08-24 - 2024-08-24
  • 1.47.0-alpha-2024-08-23 - 2024-08-23
  • 1.47.0-alpha-2024-08-22 - 2024-08-22
  • 1.47.0-alpha-2024-08-21 - 2024-08-21
  • 1.47.0-alpha-2024-08-20 - 2024-08-20
  • 1.47.0-alpha-2024-08-19 - 2024-08-19
  • 1.47.0-alpha-2024-08-18 - 2024-08-18
  • 1.47.0-alpha-2024-08-17 - 2024-08-17
  • 1.47.0-alpha-2024-08-15 - 2024-08-15
  • 1.47.0-alpha-2024-08-14 - 2024-08-14
  • 1.47.0-alpha-2024-08-13 - 2024-08-13
  • 1.47.0-alpha-2024-08-12 - 2024-08-12
  • 1.47.0-alpha-2024-08-11 - 2024-08-11
  • 1.47.0-alpha-2024-08-10 - 2024-08-10
  • 1.47.0-alpha-2024-08-09 - 2024-08-09
  • 1.47.0-alpha-2024-08-08 - 2024-08-08
  • 1.47.0-alpha-2024-08-07 - 2024-08-07
  • 1.47.0-alpha-2024-08-06 - 2024-08-06
  • 1.47.0-alpha-2024-08-05 - 2024-08-05
  • 1.47.0-alpha-2024-08-04 - 2024-08-04
  • 1.47.0-alpha-2024-08-03 - 2024-08-03
  • 1.47.0-alpha-2024-08-02 - 2024-08-02
  • 1.47.0-alpha-2024-08-01 - 2024-08-01
  • 1.47.0-alpha-2024-07-31 - 2024-07-31
  • 1.47.0-alpha-2024-07-30 - 2024-07-30
  • 1.47.0-alpha-2024-07-29 - 2024-07-29
  • 1.47.0-alpha-2024-07-28 - 2024-07-28
  • 1.47.0-alpha-2024-07-27 - 2024-07-27
  • 1.47.0-alpha-1722580468000 - 2024-08-02
  • 1.47.0-alpha-1722448717000 - 2024-07-31
  • 1.47.0-alpha-1722335054000 - 2024-07-30
  • 1.46.1 - 2024-08-16

    Highlights

    #32004 - [REGRESSION]: Client Certificates don't work with Microsoft IIS
    #32004 - [REGRESSION]: Websites stall on TLS handshake errors when using Client Certificates
    #32146 - [BUG]: Credential scanners warn about internal socks-proxy TLS certificates
    #32056 - [REGRESSION]: 1.46.0 (TypeScript) - custom fixtures extend no longer chainable
    #32070 - [Bug]: --only-changed flag and project dependencies
    #32188 - [Bug]: --only-changed with shallow clone throws "unknown revision" error

    Browser Versions

    • Chromium 128.0.6613.18
    • Mozilla Firefox 128.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 127
    • Microsoft Edge 127
  • 1.46.1-beta-1724923267000 - 2024-08-29
  • 1.46.1-beta-1723837512000 - 2024-08-16
  • 1.46.1-beta-1723832682000 - 2024-08-16
  • 1.46.0 - 2024-08-05

    TLS Client Certificates

    Playwright now allows to supply client-side certificates, so that server can verify them, as specified by TLS Client Authentication.

    When client certificates are specified, all browser traffic is routed through a proxy that establishes the secure TLS connection, provides client certificates to the server and validates server certificates.

    The following snippet sets up a client certificate for https://example.com:

    import { defineConfig } from '@ playwright/test';

    export default defineConfig({
    // ...
    use: {
    clientCertificates: [{
    origin: 'https://example.com',
    certPath: './cert.pem',
    keyPath: './key.pem',
    passphrase: 'mysecretpassword',
    }],
    },
    // ...
    });

    You can also provide client certificates to a particular test project or as a parameter of browser.newContext() and apiRequest.newContext().

    --only-changed cli option

    New CLI option --only-changed allows to only run test files that have been changed since the last git commit or from a specific git "ref".

    # Only run test files with uncommitted changes
    npx playwright test --only-changed

    # Only run test files changed relative to the "main" branch
    npx playwright test --only-changed=main

    Component Testing: New router fixture

    This release introduces an experimental router fixture to intercept and handle network requests in component testing.
    There are two ways to use the router fixture:

    • Call router.route(url, handler) that behaves similarly to page.route().
    • Call router.use(handlers) and pass MSW library request handlers to it.

    Here is an example of reusing your existing MSW handlers in the test.

    import { handlers } from '@ src/mocks/handlers';

    test.beforeEach(async ({ router }) => {
    // install common handlers before each test
    await router.use(...handlers);
    });

    test('example test', async ({ mount }) => {
    // test as usual, your handlers are active
    // ...
    });

    This fixture is only available in component tests.

    UI Mode / Trace Viewer Updates

    • Test annotations are now shown in UI mode.
    • Content of text attachments is now rendered inline in the attachments pane.
    • New setting to show/hide routing actions like route.continue().
    • Request method and status are shown in the network details tab.
    • New button to copy source file location to clipboard.
    • Metadata pane now displays the baseURL.

    Miscellaneous

    Possibly breaking change

    Fixture values that are array of objects, when specified in the test.use() block, may require being wrapped into a fixture tuple. This is best seen on the example:

    import { test as base } from '@ playwright/test';

    // Define an option fixture that has an "array of objects" value
    type User = { name: string, password: string };
    const test = base.extend<{ users: User[] }>({
    users: [ [], { option: true } ],
    });

    // Specify option value in the test.use block.
    test.use({
    // WRONG: this syntax may not work for you
    users: [
    { name: 'John Doe', password: 'secret' },
    { name: 'John Smith', password: 's3cr3t' },
    ],
    // CORRECT: this syntax will work. Note extra [] around the value, and the "scope" property.
    users: [[
    { name: 'John Doe', password: 'secret' },
    { name: 'John Smith', password: 's3cr3t' },
    ], { scope: 'test' }],
    });

    test('example test', async () => {
    // ...
    });

    Browser Versions

    • Chromium 128.0.6613.18
    • Mozilla Firefox 128.0
    • WebKit 18.0

    This version was also tested against the following stable channels:

    • Google Chrome 127
    • Microsoft Edge 127
  • 1.46.0-beta-1723832534000 - 2024-08-16
  • 1.46.0-beta-1723801589000 - 2024-08-16
  • 1.46.0-beta-1723720592000 - 2024-08-15
  • 1.46.0-beta-1723720241000 - 2024-08-15
  • 1.46.0-beta-1723710364000 - 2024-08-15
  • 1.46.0-beta-1723660382000 - 2024-08-14
  • 1.46.0-beta-1723133504000 - 2024-08-08
  • 1.46.0-beta-1722921654000 - 2024-08-06
  • 1.46.0-beta-1722864935000 - 2024-08-05
  • 1.46.0-beta-1722862542000 - 2024-08-05
  • 1.46.0-beta-1722861852000 - 2024-08-05
  • 1.46.0-beta-1722861393000 - 2024-08-05
  • 1.46.0-beta-1722619968000 - 2024-08-02
  • 1.46.0-beta-1722548857000 - 2024-08-01
  • 1.46.0-beta-1722543854000 - 2024-08-01
  • 1.46.0-beta-1722539025000 - 2024-08-01
  • 1.46.0-beta-1722538384000 - 2024-08-01
  • 1.46.0-beta-1722536587000 - 2024-08-01
  • 1.46.0-beta-1722529720000 - 2024-08-01
  • 1.46.0-beta-1722515615000 - 2024-08-01
  • 1.46.0-beta-1722491095000 - 2024-08-01
  • 1.46.0-beta-1722473979000 - 2024-08-01
  • 1.46.0-beta-1722473905000 - 2024-08-01
  • 1.46.0-beta-1722473882000 - 2024-08-01
  • 1.46.0-beta-1722449265000 - 2024-07-31
  • ...

Snyk has created this PR to upgrade @playwright/test from 1.19.0-alpha-1643749494000 to 1.49.0.

See this package in npm:
@playwright/test

See this project in Snyk:
https://app.snyk.io/org/l00163425/project/81e8fe7d-ceaa-41cb-97a0-1afdb66407ba?utm_source=github&utm_medium=referral&page=upgrade-pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants