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

Update dependency @playwright/test to ^1.50.1 #510

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 1, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@playwright/test (source) ^1.40.0 -> ^1.50.1 age adoption passing confidence

Release Notes

microsoft/playwright (@​playwright/test)

v1.50.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/34483 - [Feature]: single aria snapshot for different engines/browsershttps://github.com/microsoft/playwright/issues/344977 - [Bug]: Firefox not handling keepalive: true fetch requesthttps://github.com/microsoft/playwright/issues/3450404 - [Bug]: update snapshots not creating good difhttps://github.com/microsoft/playwright/issues/34507507 - [Bug]: snapshotPathTemplate doesnt work when multiple projehttps://github.com/microsoft/playwright/issues/344624462 - [Bug]: updateSnapshots "changed" throws an error

Browser Versions

  • Chromium 133.0.6943.16
  • Mozilla Firefox 134.0
  • WebKit 18.2

This version was also tested against the following stable channels:

  • Google Chrome 132
  • Microsoft Edge 132

v1.50.0

Compare Source

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.

    test('some test', async ({ page }) => {
      await test.step('a step', async () => {
        // This step can time out separately from the test
      }, { timeout: 1000 });
    });
  • New method test.step.skip() to disable execution of a test step.

    test('some test', async ({ page }) => {
      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, whereas all 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 and 3-way modes that write the changes into source code, on top of existing patch 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 default SIGKILL.

  • Exposed testStep.attachments from the reporter API to allow retrieval of all attachments created by that step.

  • New option pathTemplate for toHaveScreenshot and toMatchAriaSnapshot assertions in the testConfig.expect configuration.

UI updates

  • Updated default HTML reporter to improve display of attachments.
  • New button for picking elements to produce aria snapshots.
  • Additional details (such as keys pressed) are now displayed alongside action API calls in traces.
  • Display of canvas content in traces is error-prone. Display is now disabled by default, and can be enabled via the Display canvas content UI setting.
  • Call and Network panels now display additional time information.

Breaking

Browser Versions

  • Chromium 133.0.6943.16
  • Mozilla Firefox 134.0
  • WebKit 18.2

This version was also tested against the following stable channels:

  • Google Chrome 132
  • Microsoft Edge 132

v1.49.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/33802 - [Bug]: Codegen's Clear button doesn't work if not recordinghttps://github.com/microsoft/playwright/issues/338066 - [Bug]: playwright hangs while waiting for pending navigationhttps://github.com/microsoft/playwright/issues/3378787 - [Bug]: VSC extension isn't capturing all entered tehttps://github.com/microsoft/playwright/issues/33788788 - [Regression]: Double clicking the steps in trace viewer doesn't filter actihttps://github.com/microsoft/playwright/issues/337723772 - [Bug]: aria_snapshot generates invalid yaml when combined with an aria-label attrhttps://github.com/microsoft/playwright/issues/3379133791 - [Bug]: text input with number value raises "container is not iterable" with to_match_aria_snahttps://github.com/microsoft/playwright/issues/33644/33644 - [Bug]: getByRole can't find element with the accessible name from label element when aria-labelledby is nothttps://github.com/microsoft/playwright/issues/33660s/33660 - [Regression]: Unable to open Playwright UI in Dark Mode

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

v1.49.0

Compare Source

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

v1.48.2

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/33141 - [Bug]: UI Mode crashedhttps://github.com/microsoft/playwright/issues/332199 - [BUG] Trace Viewer PWA crashes with "Aw, Snaphttps://github.com/microsoft/playwright/issues/3308686 - [Bug]: UI Mode Memory problhttps://github.com/microsoft/playwright/issues/33000000 - [Regression]: Inspector and Browser doesn't close on CTRhttps://github.com/microsoft/playwright/issues/332043204 - [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

v1.48.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/33023 - [Bug]: command line flag --headed has no effect in ui modehttps://github.com/microsoft/playwright/issues/331077 - [REGRESSION]: page.waitForRequest does not get resolved since 1.48.https://github.com/microsoft/playwright/issues/3308585 - [Bug]: WebSocket route does not handle full URLs in Playwrighttps://github.com/microsoft/playwright/issues/33052052 - [Regression]: Inspector not showing recorded sthttps://github.com/microsoft/playwright/issues/331323132 - [Bug]: Wrong Ubuntu release name in Dockerfile.nhttps://github.com/microsoft/playwright/pull/3299632996 - [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

v1.48.0

Compare Source

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

v1.47.2

Compare Source

Highlights

https://github.com/microsoft/playwright/pull/32699- [REGRESSION]: fix(codegen): use content_frame property in python/.NEThttps://github.com/microsoft/playwright/issues/327066- [REGRESSION]: page.pause() does not pause test timeout after 1.4https://github.com/microsoft/playwright/pull/3266161 - 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

v1.47.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/32480 - [REGRESSION]: tsconfig.json's compilerOptions.paths no longer working in 1.47https://github.com/microsoft/playwright/issues/325522 - [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

v1.47.0

Compare Source

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

v1.46.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/32004 - [REGRESSION]: Client Certificates don't work with Microsoft IIShttps://github.com/microsoft/playwright/issues/320044 - [REGRESSION]: Websites stall on TLS handshake errors when using Client Certificatehttps://github.com/microsoft/playwright/issues/3214646 - [BUG]: Credential scanners warn about internal socks-proxy TLS certificathttps://github.com/microsoft/playwright/issues/32056056 - [REGRESSION]: 1.46.0 (TypeScript) - custom fixtures extend no longer chainahttps://github.com/microsoft/playwright/issues/320702070 - [Bug]: --only-changed flag and project dependenhttps://github.com/microsoft/playwright/issues/3218832188 - [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

v1.46.0

Compare Source

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 '@&#8203;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 '@&#8203;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 '@&#8203;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

v1.45.3

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/31764 - [Bug]: some actions do not appear in the trace filehttps://github.com/microsoft/playwright-java/issues/16177 - [Bug]: Traceviewer not reporting all actions

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.45.2

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/31613 - [REGRESSION]: Trace is not showing any screenshots nor test namehttps://github.com/microsoft/playwright/issues/316011 - [REGRESSION]: missing trace for 2nd browsehttps://github.com/microsoft/playwright/issues/3154141 - [REGRESSION]: Failing tests have a trace with no images and with steps missing

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.45.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/31473 - [REGRESSION]: Playwright raises an error ENOENT: no such file or directory, open 'test-results/.playwright-artifacts-0/hash.zip' with Electronhttps://github.com/microsoft/playwright/issues/314422 - [REGRESSION]: Locators of elements changing from/to hidden have operations hanging when using --disable-web-security
https://github.com/microsoft/playwright/issues/31431 - [REGRESSION]: NewTab doesn't work properly with Chrome with --disable-web-security
https://github.com/microsoft/playwright/issues/31425 - [REGRESSION]: beforeEach hooks are not skipped when describe condition depends on fixtureshttps://github.com/microsoft/playwright/issues/314911 - [REGRESSION]: @playwright/experimental-ct-react doesn't work with VSCode extension and PNPM

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.45.0

Compare Source

Clock

Utilizing the new Clock API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including:

  • testing with predefined time;
  • keeping consistent time and timers;
  • monitoring inactivity;
  • ticking through time manually.
// Initialize clock and let the page load naturally.
await page.clock.install({ time: new Date('2024-02-02T08:00:00') });
await page.goto('http://localhost:3333');

// Pretend that the user closed the laptop lid and opened it again at 10am,
// Pause the time once reached that point.
await page.clock.pauseAt(new Date('2024-02-02T10:00:00'));

// Assert the page state.
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:00 AM');

// Close the laptop lid again and open it at 10:30am.
await page.clock.fastForward('30:00');
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:30:00 AM');

See the clock guide for more details.

Test runner

  • New CLI option --fail-on-flaky-tests that sets exit code to 1 upon any flaky tests. Note that by default, the test runner exits with code 0 when all failed tests recovered upon a retry. With this option, the test run will fail in such case.

  • New enviroment variable PLAYWRIGHT_FORCE_TTY controls whether built-in list, line and dot reporters assume a live terminal. For example, this could be useful to disable tty behavior when your CI environment does not handle ANSI control sequences well. Alternatively, you can enable tty behavior even when to live terminal is present, if you plan to post-process the output and handle control sequences.

Avoid TTY features that output ANSI control sequences

PLAYWRIGHT_FORCE_TTY=0 npx playwright test

Enable TTY features, assuming a terminal width 80

PLAYWRIGHT_FORCE_TTY=80 npx playwright test


- New options [testConfig.respectGitIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-respect-git-ignore) and [testProject.respectGitIgnore](https://playwright.dev/docs/api/class-testproject#test-project-respect-git-ignore) control whether files matching `.gitignore` patterns are excluded when searching for tests.
- New property `timeout` is now available for custom expect matchers. This property takes into account `playwright.config.ts` and `expect.configure()`.

```ts
import { expect as baseExpect } from '@&#8203;playwright/test';

export const expect = baseExpect.extend({
  async toHaveAmount(locator: Locator, expected: number, options?: { timeout?: number }) {
    // When no timeout option is specified, use the config timeout.
    const timeout = options?.timeout ?? this.timeout;
    // ... implement the assertion ...
  },
});

Miscellaneous

  • Method locator.setInputFiles() now supports uploading a directory for <input type=file webkitdirectory> elements.

    await page.getByLabel('Upload directory').setInputFiles(path.join(__dirname, 'mydir'));
  • Multiple methods like locator.click() or locator.press() now support a ControlOrMeta modifier key. This key maps to Meta on macOS and maps to Control on Windows and Linux.

    // Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
    await page.keyboard.press('ControlOrMeta+S');
  • New property httpCredentials.send in apiRequest.newContext() that allows to either always send the Authorization header or only send it in response to 401 Unauthorized.

  • New option reason in apiRequestContext.dispose() that will be included in the error message of ongoing operations interrupted by the context disposal.

  • New option host in browserType.launchServer() allows to accept websocket connections on a specific address instead of unspecified 0.0.0.0.

  • Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.

  • v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.44.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/30779 - [REGRESSION]: When using video: 'on' with VSCode extension the browser got closed
https://github.com/microsoft/playwright/issues/30755 - [REGRESSION]: Electron launch with spaces inside executablePath didn't workhttps://github.com/microsoft/playwright/issues/307700 - [REGRESSION]: Mask elements outside of viewport when creating fullscreen screenshots didn't worhttps://github.com/microsoft/playwright/issues/3085858 - [REGRESSION]: ipv6 got shown instead of localhost in show-trace/show-report

Browser Versions

  • Chromium 125.0.6422.14
  • Mozilla Firefox 125.0.1
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 124
  • Microsoft Edge 124

v1.44.0

Compare Source

New APIs

Accessibility assertions

  • expect(locator).toHaveAccessibleName() checks if the element has the specified accessible name:

    const locator = page.getByRole('button');
    await expect(locator).toHaveAccessibleName('Submit');
  • expect(locator).toHaveAccessibleDescription() checks if the element has the specified accessible description:

    const locator = page.getByRole('button');
    await expect(locator).toHaveAccessibleDescription('Upload a photo');
  • expect(locator).toHaveRole() checks if the element has the specified ARIA role:

    const locator = page.getByTestId('save-button');
    await expect(locator).toHaveRole('button');

Locator handler

  • After executing the handler added with page.addLocatorHandler(), Playwright will now wait until the overlay that triggered the handler is not visible anymore. You can opt-out of this behavior with the new noWaitAfter option.
  • You can use new times option in page.addLocatorHandler() to specify maximum number of times the handler should be run.
  • The handler in page.addLocatorHandler() now accepts the locator as argument.
  • New page.removeLocatorHandler() method for removing previously added locator handlers.
const locator = page.getByText('This interstitial covers the button');
await page.addLocatorHandler(locator, async overlay => {
  await overlay.locator('#close').click();
}, { times: 3, noWaitAfter: true });
// Run your tests that can be interrupted by the overlay.
// ...
await page.removeLocatorHandler(locator);

Miscellaneous options

  • multipart option in apiRequestContext.fetch() now accepts FormData and supports repeating fields with the same name.

    const formData = new FormData();
    formData.append('file', new File(['let x = 2024;'], 'f1.js', { type: 'text/javascript' }));
    formData.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));
    context.request.post('https://example.com/uploadFiles', {
      multipart: formData
    });
  • expect(callback).toPass({ intervals }) can now be configured by expect.toPass.inervals option globally in testConfig.expect or per project in testProject.expect.

  • expect(page).toHaveURL(url) now supports ignoreCase option.

  • testProject.ignoreSnapshots allows to configure per project whether to skip screenshot expectations.

Reporter API

  • New method suite.entries() returns child test suites and test cases in their declaration order. suite.type and testCase.type can be used to tell apart test cases and suites in the list.
  • Blob reporter now allows overriding report file path with a single option outputFile. The same option can also be specified as PLAYWRIGHT_BLOB_OUTPUT_FILE environment variable that might be more convenient on CI/CD.
  • JUnit reporter now supports includeProjectInTestName option.

Command line

  • --last-failed CLI option for running only tests that failed in the previous run.

    First run all tests:

    $ npx playwright test
    
    Running 103 tests using 5 workers
    ...
    2 failed
      [chromium] › my-test.spec.ts:8:5 › two ─────────────────────────────────────────────────────────
      [chromium] › my-test.spec.ts:13:5 › three ──────────────────────────────────────────────────────
    101 passed (30.0s)

    Now fix the failing tests and run Playwright again with --last-failed option:

    $ npx playwright test --last-failed
    
    Running 2 tests using 2 workers
      2 passed (1.2s)

Browser Versions

  • Chromium 125.0.6422.14
  • Mozilla Firefox 125.0.1
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 124
  • Microsoft Edge 124

v1.43.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/30300 - [REGRESSION]: UI mode restarts if keep storage statehttps://github.com/microsoft/playwright/issues/303399 - [REGRESSION]: Brand new install of playwright, unable to run chromium with show browser using vscode

Browser Versions
  • Chromium 124.0.6367.29
  • Mozilla Firefox 124.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 123
  • Microsoft Edge 123

v1.43.0

Compare Source

New APIs

  • Method browserContext.clearCookies() now supports filters to remove only some cookies.

    // Clear all cookies.
    await context.clearCookies();
    // New: clear cookies with a particular name.
    await context.clearCookies({ name: 'session-id' });
    // New: clear cookies for a particular domain.
    await context.clearCookies({ domain: 'my-origin.com' });
  • New mode retain-on-first-failure for testOptions.trace. In this mode, trace is recorded for the first run of each test, but not for retires. When test run fails, the trace file is retained, otherwise it is removed.

    import { defineConfig } from '@&#8203;playwright/test';
    
    export default defineConfig({
      use: {
        trace: 'retain-on-first-failure',
      },
    });
  • New property testInfo.tags exposes test tags during test execution.

    test('example', async ({ page }) => {
      console.log(test.info().tags);
    });
  • New method locator.contentFrame() converts a Locator object to a FrameLocator. This can be useful when you have a Locator object obtained somewhere, and later on would like to interact with the content inside the frame.

    const locator = page.locator('iframe[name="embedded"]');
    // ...
    const frameLocator = locator.contentFrame();
    await frameLocator.getByRole('button').click();
  • New method frameLocator.owner() converts a FrameLocator object to a Locator. This can be useful when you have a FrameLocator object obtained somewhere, and later on would like to interact with the iframe element.

    const frameLocator = page.frameLocator('iframe[name="embedded"]');
    // ...
    const locator = frameLocator.owner();
    await expect(locator).toBeVisible();

UI Mode Updates

Playwright UI Mode

  • See tags in the test list.
  • Filter by tags by typing @fast or clicking on the tag itself.
  • New shortcuts:
    • F5 to run tests.
    • Shift F5 to stop running tests.
    • Ctrl ` to toggle test output.

Browser Versions

  • Chromium 124.0.6367.29
  • Mozilla Firefox 124.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 123
  • Microsoft Edge 123

v1.42.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/29732 - [Regression]: HEAD requests to webServer.url since v1.42.0https://github.com/microsoft/playwright/issues/297466 - [Regression]: Playwright CT CLI scripts fail due to broken initializePlugin imporhttps://github.com/microsoft/playwright/issues/2973939 - [Bug]: Component tests fails when imported a module with a dot in a nahttps://github.com/microsoft/playwright/issues/29731731 - [Regression]: 1.42.0 breaks some import statemehttps://github.com/microsoft/playwright/issues/297609760 - [Bug]: Possible regression with chained locators in v1.42

Browser Versions
  • Chromium 123.0.6312.4
  • Mozilla Firefox 123.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 122
  • Microsoft Edge 123

v1.42.0

Compare Source

New APIs

  • Test tags

    New tag syntax for adding tags to the tests (@​-tokens in the test title are still supported).

    test('test customer login', { tag: ['@&#8203;fast', '@&#8203;login'] }, async ({ page }) => {
      // ...
    });

    Use --grep command line option to run only tests with certain tags.

    npx playwright test --grep @&#8203;fast
  • Annotating skipped tests

    New annotation syntax for test annotations allows annotating the tests that do not run.

    test('test full report', {
      annotation: [
        { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23180' },
        { type: 'docs', description: 'https://playwright.dev/docs/test-annotations#tag-tests' },
      ],
    }, async ({ page }) => {
      // ...
    });
  • page.addLocatorHandler()

[!WARNING]
This feature is experimental, we are actively looking for the feedback based on your scenarios.

New method page.addLocatorHandler() registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears.

// Setup the handler.
await page.addLocatorHandler(
    page.getByRole('heading', { name: 'Hej! You are in control of your cookies.' }),
    async () => {
      await page.getByRole('button', { name: 'Accept all' }).click();
    });
// Write the test as usual.
await page.goto('https://www.ikea.com/');
await page.getByRole('link', { name: 'Collection of blue and white' }).click();
await expect(page.getByRole('heading', { name: 'Light and easy' })).toBeVisible();
  • Project wildcard filter
    Playwright command line flag now supports '*' wildcard when filtering by project.

    npx playwright test --project='*mobile*'
  • Other APIs

    • expect(callback).toPass({ timeout })
      The timeout can now be configured by expect.toPass.timeout option globally or in project config

    • electronApplication.on('console')
      electronApplication.on('console') event is emitted when Electron main process calls console API methods.

      electronApp.on('console', async msg => {
        const values = [];
        for (const arg of msg.args())
          values.push(await arg.jsonValue());
        console.log(...values);
      });
      await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
    • page.pdf() accepts two new options tagged and outline.

Breaking changes

Mixing the test instances in the same suite is no longer supported. Allowing it was an oversight as it makes reasoning about the semantics unnecessarily hard.

const test = baseTest.extend({ item: async ({}, use) => {} });
baseTest.describe('Admin user', () => {
  test('1', async ({ page, item }) => {});
  test('2', async ({ page, item }) => {});
});

Announcements

  • ⚠️ Ubuntu 18 is not supported anymore.

Browser Versions

  • Chromium 123.0.6312.4
  • Mozilla Firefox 123.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 122
  • Microsoft Edge 123

v1.41.2

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/29123 - [REGRESSION] route.continue: Protocol error (Fetch.continueRequest): Invalid InterceptionId.

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.41.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/29067 - [REGRESSION] Codegen/Recorder: not all clicks are being actioned nor recordedhttps://github.com/microsoft/playwright/issues/290288 - [REGRESSION] React component tests throw type error when passing null/undefined to componenhttps://github.com/microsoft/playwright/issues/2902727 - [REGRESSION] React component tests not passing Date prop valuhttps://github.com/microsoft/playwright/issues/29023023 - [REGRESSION] React component tests not rendering children phttps://github.com/microsoft/playwright/issues/290199019 - [REGRESSION] trace.playwright.dev does not currently support the loading from URL

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.41.0

Compare Source

New APIs

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.40.1

Compare Source

Highlights

https://github.com/microsoft/playwright/issues/28319 - [REGRESSION]: Version 1.40.0 Produces corrupted traceshttps://github.com/microsoft/playwright/issues/283711 - [BUG] The color of the 'ok' text did not change to green in the vs code test results sectiohttps://github.com/microsoft/playwright/issues/2832121 - [BUG] Ambiguous test outcome and status for serial mohttps://github.com/microsoft/playwright/issues/28362362 - [BUG] Merging blobs ends up in Error: Cannot create a string longer than 0x1fffffe8 charact[https://github.com/microsoft/playwright/pull/28239](https://redirect.github.com/microsoft/


Configuration

📅 Schedule: Branch creation - "every weekend" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update dependency @playwright/test to ^1.40.1 Update dependency @playwright/test to ^1.41.0 Jan 16, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 79bedc3 to 61ad811 Compare January 16, 2024 18:48
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.41.0 Update dependency @playwright/test to ^1.41.1 Jan 19, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 61ad811 to cebd5ce Compare January 19, 2024 23:25
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from cebd5ce to 9ced655 Compare February 1, 2024 21:58
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.41.1 Update dependency @playwright/test to ^1.41.2 Feb 1, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 9ced655 to 87973f9 Compare February 27, 2024 23:06
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.41.2 Update dependency @playwright/test to ^1.42.0 Feb 27, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 87973f9 to 9e0d248 Compare March 2, 2024 00:59
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.42.0 Update dependency @playwright/test to ^1.42.1 Mar 2, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 9e0d248 to e5d49ea Compare April 4, 2024 22:32
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.42.1 Update dependency @playwright/test to ^1.43.0 Apr 4, 2024
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.43.0 Update dependency @playwright/test to ^1.43.1 Apr 12, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from e5d49ea to 760dd68 Compare April 12, 2024 20:28
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 760dd68 to 4bf0335 Compare May 7, 2024 00:21
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.43.1 Update dependency @playwright/test to ^1.44.0 May 7, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 4bf0335 to ee72153 Compare May 23, 2024 09:41
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.44.0 Update dependency @playwright/test to ^1.44.1 May 23, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from ee72153 to ce7c74e Compare June 24, 2024 22:55
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.44.1 Update dependency @playwright/test to ^1.45.0 Jun 24, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from ce7c74e to b6dcd5e Compare July 2, 2024 18:42
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.45.0 Update dependency @playwright/test to ^1.45.1 Jul 2, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from b6dcd5e to 0e95de0 Compare July 16, 2024 11:18
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.45.1 Update dependency @playwright/test to ^1.45.2 Jul 16, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 0e95de0 to d16f15b Compare July 22, 2024 21:08
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.45.2 Update dependency @playwright/test to ^1.45.3 Jul 22, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from d16f15b to 0c8918f Compare August 5, 2024 22:16
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.45.3 Update dependency @playwright/test to ^1.46.0 Aug 5, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 0c8918f to c6372ed Compare August 16, 2024 20:38
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.46.0 Update dependency @playwright/test to ^1.46.1 Aug 16, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from c6372ed to c834ffb Compare September 5, 2024 22:44
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.46.1 Update dependency @playwright/test to ^1.47.0 Sep 5, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from c834ffb to ca88ec0 Compare September 13, 2024 18:29
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.47.0 Update dependency @playwright/test to ^1.47.1 Sep 13, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from ca88ec0 to 685af91 Compare September 20, 2024 19:25
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.47.1 Update dependency @playwright/test to ^1.47.2 Sep 20, 2024
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.47.2 Update dependency @playwright/test to ^1.48.0 Oct 8, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 685af91 to 1d81a33 Compare October 8, 2024 16:31
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 1d81a33 to ef90562 Compare October 16, 2024 09:48
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.48.0 Update dependency @playwright/test to ^1.48.1 Oct 16, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from ef90562 to 1c653cf Compare October 25, 2024 21:11
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.48.1 Update dependency @playwright/test to ^1.48.2 Oct 25, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 1c653cf to 9a289c0 Compare November 18, 2024 21:45
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.48.2 Update dependency @playwright/test to ^1.49.0 Nov 18, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 9a289c0 to e0ed14b Compare December 10, 2024 03:49
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.49.0 Update dependency @playwright/test to ^1.49.1 Dec 10, 2024
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from e0ed14b to 382edd1 Compare January 23, 2025 18:19
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.49.1 Update dependency @playwright/test to ^1.50.0 Jan 23, 2025
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from 382edd1 to fcf8ef8 Compare January 31, 2025 17:52
@renovate renovate bot changed the title Update dependency @playwright/test to ^1.50.0 Update dependency @playwright/test to ^1.50.1 Jan 31, 2025
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch 2 times, most recently from ee6effd to e47821d Compare March 3, 2025 14:16
@renovate renovate bot force-pushed the renovate/playwright-monorepo branch from e47821d to fd315dc Compare March 3, 2025 14:46
@sugardon sugardon merged commit 386d28d into main Mar 3, 2025
7 checks passed
@sugardon sugardon deleted the renovate/playwright-monorepo branch March 3, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant