yarn @playwright/test 1.57.0
v1.57.0

12 hours ago

Speedboard

In HTML reporter, there's a new tab we call "Speedboard":

speedboard

It shows you all your executed tests sorted by slowness,
and can help you understand where your test suite is taking longer than expected.
Take a look at yours - maybe you'll find some tests that are spending a longer time waiting than they should!

Chrome for Testing

Starting with this release, Playwright switches from Chromium, to using Chrome for Testing builds. Both headed and headless browsers are subject to this. Your tests should still be passing after upgrading to Playwright 1.57.

We're expecting no functional changes to come from this switch. The biggest change is the new icon and title in your toolbar.

new and old logo

If you still see an unexpected behaviour change, please file an issue.

On Arm64 Linux, Playwright continues to use Chromium.

Waiting for webserver output

testConfig.webServer added a wait field. Pass a regular expression, and Playwright will wait until the webserver logs match it.

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

export default defineConfig({
  webServer: {
    command: 'npm run start',
    wait: {
      stdout: '/Listening on port (?<my_server_port>\\d+)/'
    },
  },
});

If you include a named capture group into the expression, then Playwright will provide the capture group contents via environment variables:

import { test, expect } from '@playwright/test';

test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });

test('homepage', async ({ page }) => {
  await page.goto('/');
});

This is not just useful for capturing varying ports of dev servers. You can also use it to wait for readiness of a service that doesn't expose an HTTP readiness check, but instead prints a readiness message to stdout or stderr.

Breaking Change

After 3 years of being deprecated, we removed Page#accessibility from our API. Please use other libraries such as Axe if you need to test page accessibility. See our Node.js guide for integration with Axe.

New APIs

  • New property testConfig.tag adds a tag to all tests in this run. This is useful when using merge-reports.
  • worker.on('console') event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. worker.waitForEvent() can be used to wait for it.
  • locator.description() returns locator description previously set with locator.describe(), and Locator.toString() now uses the description when available.
  • New option steps in locator.click() and locator.dragTo() that configures the number of mousemove events emitted while moving the mouse pointer to the target element.
  • Network requests issued by Service Workers are now reported and can be routed through the BrowserContext, only in Chromium. You can opt out using the PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK environment variable.
  • Console messages from Service Workers are dispatched through worker.on('console'). You can opt out of this using the PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE environment variable.

Browser Versions

  • Chromium 143.0.7499.4
  • Mozilla Firefox 142.0.1
  • WebKit 26.0

Don't miss a new test release

NewReleases is sending notifications on new releases.