Playwright - v1.23.0

Network Replay

Now you can record network traffic into a HAR file and re-use the data in your tests.

To record network into HAR file:

npx playwright open

Alternatively, you can record HAR programmatically:

const context = await browser.newContext({
  recordHar: { path: '' }
// ... do stuff ...
await context.close();

Use the new methods page.routeFromHAR() or browserContext.routeFromHAR() to serve matching responses from the HAR file:

await context.routeFromHAR('');

Read more in our documentation.

Advanced Routing

You can now use route.fallback() to defer routing to other handlers.

Consider the following example:

// Remove a header from all requests.
test.beforeEach(async ({ page }) => {
  await page.route('**/*', route => {
    const headers = route.request().headers();
    delete headers['if-none-match'];
    route.fallback({ headers });

test('should work', async ({ page }) => {
  await page.route('**/*', route => {
    if (route.request().resourceType() === 'image')

Note that the new methods page.routeFromHAR() and browserContext.routeFromHAR() also participate in routing and could be deferred to.

Web-First Assertions Update

Component Tests Update

Read more about component testing with Playwright.


  • If there's a service worker that's in your way, you can now easily disable it with a new context option serviceWorkers:
    ts // playwright.config.ts export default { use: { serviceWorkers: 'block', } }
  • Using .zip path for recordHar context option automatically zips the resulting HAR:
    ts const context = await browser.newContext({ recordHar: { path: '', } });
  • If you intend to edit HAR by hand, consider using the "minimal" HAR recording mode
    that only records information that is essential for replaying:
    ts const context = await browser.newContext({ recordHar: { path: '', mode: 'minimal', } });
  • Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64. We also publish new docker image

⚠️ Breaking Changes ⚠️

WebServer is now considered "ready" if request to the specified port has any of the following HTTP status codes:

  • 200-299
  • 300-399 (new)
  • 400, 401, 402, 403 (new)


June 27, 2022, 8:42 p.m.
Register or login to:
  • 🔍View and search all Playwright releases.
  • 🛠️Create and share lists to track your tools.
  • 🚨Setup notifications for major, security, feature or patch updates.
  • 🚀Much more coming soon!
Continue with GitHub
Continue with Google