From fd7c27ab00f35a30f2dd9f816198029041ba333b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 Dec 2022 00:27:42 +0000 Subject: [PATCH] Update dependency @playwright/test to v1.28.1 (#860) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@playwright/test](https://playwright.dev) ([source](https://togithub.com/Microsoft/playwright)) | [`1.15.2` -> `1.28.1`](https://renovatebot.com/diffs/npm/@playwright%2ftest/1.15.2/1.28.1) | [![age](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/compatibility-slim/1.15.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@playwright%2ftest/1.28.1/confidence-slim/1.15.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
Microsoft/playwright ### [`v1.28.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.28.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.28.0...v1.28.1) #### Highlights This patch release includes the following bug fixes: [https://github.com/microsoft/playwright/issues/18928](https://togithub.com/microsoft/playwright/issues/18928) - \[BUG] Electron firstWindow times out after upgrading to 1.28.0[https://github.com/microsoft/playwright/issues/18920](https://togithub.com/microsoft/playwright/issues/18920)0 - \[BUG] \[expanded=false] in role selector returns elements without aria-expanded attribu[https://github.com/microsoft/playwright/issues/18865](https://togithub.com/microsoft/playwright/issues/18865)865 - \[BUG] regression in killing web server process in 1.28.0 #### Browser Versions - Chromium 108.0.5359.29 - Mozilla Firefox 106.0 - WebKit 16.4 This version was also tested against the following stable channels: - Google Chrome 107 - Microsoft Edge 107 ### [`v1.28.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.28.0): v1.28 [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.27.1...v1.28.0) #### Playwright Tools - **Record at Cursor in VSCode.** You can run the test, position the cursor at the end of the test and continue generating the test. New VSCode Extension - **Live Locators in VSCode.** You can hover and edit locators in VSCode to get them highlighted in the opened browser. - **Live Locators in CodeGen.** Generate a locator for any element on the page using "Explore" tool. Locator Explorer - **Codegen and Trace Viewer Dark Theme.** Automatically picked up from operating system settings. Dark Theme ##### Test Runner - Configure retries and test timeout for a file or a test with [`test.describe.configure([options])`](https://playwright.dev/docs/api/class-test#test-describe-configure). ```js // Each test in the file will be retried twice and have a timeout of 20 seconds. test.describe.configure({ retries: 2, timeout: 20_000 }); test('runs first', async ({ page }) => {}); test('runs second', async ({ page }) => {}); ``` - Use [`testProject.snapshotPathTemplate`](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template) and [`testConfig.snapshotPathTemplate`](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template) to configure a template controlling location of snapshots generated by [`expect(page).toHaveScreenshot(name[, options])`](https://playwright.dev/docs/test-assertions#page-assertions-to-have-screenshot-1) and [`expect(screenshot).toMatchSnapshot(name[, options])`](https://playwright.dev/docs/test-assertions#screenshot-assertions-to-match-snapshot-1). ```js // playwright.config.ts import type { PlaywrightTestConfig } from '@​playwright/test'; const config: PlaywrightTestConfig = { testDir: './tests', snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}', }; export default config; ``` ##### New APIs - [`locator.blur([options])`](https://playwright.dev/docs/api/class-locator#locator-blur) - [`locator.clear([options])`](https://playwright.dev/docs/api/class-locator#locator-clear) - [`android.launchServer([options])`](https://playwright.dev/docs/api/class-android#android-launch-server) and [`android.connect(wsEndpoint[, options])`](https://playwright.dev/docs/api/class-android#android-connect) - [`androidDevice.on('close')`](https://playwright.dev/docs/api/class-androiddevice#android-device-event-close) ##### Browser Versions - Chromium 108.0.5359.29 - Mozilla Firefox 106.0 - WebKit 16.4 This version was also tested against the following stable channels: - Google Chrome 107 - Microsoft Edge 107 ### [`v1.27.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.27.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.27.0...v1.27.1) #### Highlights This patch release includes the following bug fixes: [https://github.com/microsoft/playwright/pull/18010](https://togithub.com/microsoft/playwright/pull/18010) - fix(generator): generate nice locators for arbitrary selectors [https://github.com/microsoft/playwright/pull/17999](https://togithub.com/microsoft/playwright/pull/17999) - chore: don't fail on undefined video/trace [https://github.com/microsoft/playwright/issues/17955](https://togithub.com/microsoft/playwright/issues/17955) - \[Question] Github Actions test compatibility check failed mitigation?[https://github.com/microsoft/playwright/issues/17960](https://togithub.com/microsoft/playwright/issues/17960)0 - \[BUG] Codegen 1.27 creates NUnit code that does not compil[https://github.com/microsoft/playwright/pull/17952](https://togithub.com/microsoft/playwright/pull/17952)52 - fix: fix typo in treeitem role typing #### Browser Versions - Chromium 107.0.5304.18 - Mozilla Firefox 105.0.1 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 106 - Microsoft Edge 106 ### [`v1.27.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.27.0) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.26.1...v1.27.0) ##### Locators With these new APIs, inspired by [Testing Library](https://testing-library.com/), writing locators is a joy: - [`page.getByText(text, options)`](https://playwright.dev/docs/api/class-page#page-get-by-text) to locate by text content. - [`page.getByRole(role, options)`](https://playwright.dev/docs/api/class-page#page-get-by-role) to locate by [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). - [`page.getByLabel(label, options)`](https://playwright.dev/docs/api/class-page#page-get-by-label) to locate a form control by associated label's text. - [`page.getByPlaceholder(placeholder, options)`](https://playwright.dev/docs/api/class-page#page-get-by-placeholder) to locate an input by placeholder. - [`page.getByAltText(altText, options)`](https://playwright.dev/docs/api/class-page#page-get-by-alt-text) to locate an element, usually image, by its text alternative. - [`page.getByTitle(title, options)`](https://playwright.dev/docs/api/class-page#page-get-by-title) to locate an element by its title. ```js await page.getByLabel('User Name').fill('John'); await page.getByLabel('Password').fill('secret-password'); await page.getByRole('button', { name: 'Sign in' }).click(); await expect(page.getByText('Welcome, John!')).toBeVisible(); ``` All the same methods are also available on [Locator](https://playwright.dev/docs/api/class-locator), [FrameLocator](https://playwright.dev/docs/api/class-framelocator) and [Frame](https://playwright.dev/docs/api/class-frame) classes. ##### Other highlights - `workers` option in the `playwright.config.ts` now accepts a percentage string to use some of the available CPUs. You can also pass it in the command line: ```bash npx playwright test --workers=20% ``` - New options `host` and `port` for the html reporter. ```js reporters: [['html', { host: 'localhost', port: '9223' }]] ``` - New field `FullConfig.configFile` is available to test reporters, specifying the path to the config file if any. - As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release. ##### Behavior Changes - [`expect(locator).toHaveAttribute(name, value, options)`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-attribute) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when `button` **does not** have a `disabled` attribute. ```js await expect(page.getByRole('button')).toHaveAttribute('disabled', ''); ``` - Command line options `--grep` and `--grep-invert` previously incorrectly ignored `grep` and `grepInvert` options specified in the config. Now all of them are applied together. - JSON reporter path resolution is performed relative to the config directory instead of the current working directory: ```js ["json", { outputFile: "./test-results/results.json" }]] ``` ##### Browser Versions - Chromium 107.0.5304.18 - Mozilla Firefox 105.0.1 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 106 - Microsoft Edge 106 ### [`v1.26.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.26.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.26.0...v1.26.1) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/17500](https://togithub.com/microsoft/playwright/issues/17500) - \[BUG] No tests found using the test explorer - pw/test@1.26.0 #### Browser Versions - Chromium 106.0.5249.30 - Mozilla Firefox 104.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 105 - Microsoft Edge 105 ### [`v1.26.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.26.0) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.2...v1.26.0) #### Assertions - New option enabled for [`expect(locator).toBeEnabled([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-enabled). - [`expect(locator).toHaveText(expected[, options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-text) now pierces open shadow roots. - New option editable for [`expect(locator).toBeEditable([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-editable). - New option visible for [`expect(locator).toBeVisible([options])`](https://playwright.dev/docs/test-assertions#locator-assertions-to-be-visible). #### Other Highlights - New option `maxRedirects` for [`apiRequestContext.get(url[, options])`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) and others to limit redirect count. - New command-line flag `--pass-with-no-tests` that allows the test suite to pass when no files are found. - New command-line flag `--ignore-snapshots` to skip snapshot expectations, such as `expect(value).toMatchSnapshot()` and `expect(page).toHaveScreenshot()`. #### Behavior Change A bunch of Playwright APIs already support the waitUntil: 'domcontentloaded' option. For example: ```ts await page.goto('https://playwright.dev', { waitUntil: 'domcontentloaded', }); ``` Prior to 1.26, this would wait for all iframes to fire the `DOMContentLoaded` event. To align with web specification, the `'domcontentloaded'` value only waits for the target frame to fire the `'DOMContentLoaded'` event. Use `waitUntil: 'load'` to wait for all iframes. #### Browser Versions - Chromium 106.0.5249.30 - Mozilla Firefox 104.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 105 - Microsoft Edge 105 ### [`v1.25.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.2) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.1...v1.25.2) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/16937](https://togithub.com/microsoft/playwright/issues/16937) - \[REGRESSION]: session storage failing >= 1.25.0 in firefox[https://github.com/microsoft/playwright/issues/16955](https://togithub.com/microsoft/playwright/issues/16955)5 - Not using channel on config file when Show and Reuse browser is checked #### Browser Versions - Chromium 105.0.5195.19 - Mozilla Firefox 103.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 104 - Microsoft Edge 104 ### [`v1.25.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.25.0...v1.25.1) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/16319](https://togithub.com/microsoft/playwright/issues/16319) - \[BUG] webServer.command esbuild fails with ESM and Yarn[https://github.com/microsoft/playwright/issues/16460](https://togithub.com/microsoft/playwright/issues/16460)0 - \[BUG] Component test fails on 2nd run when SSL is use[https://github.com/microsoft/playwright/issues/16665](https://togithub.com/microsoft/playwright/issues/16665)65 - \[BUG] custom selector engines don't work when running in debug mode #### Browser Versions - Chromium 105.0.5195.19 - Mozilla Firefox 103.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 104 - Microsoft Edge 104 ### [`v1.25.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.25.0) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.2...v1.25.0) #### VSCode Extension - **New Playwright actions view** Playwright actions - **Pick selector** You can pick selector right from a live page, before or after running a test Pick selector - **Record new test** Start recording where you left off with the new 'Record new test' feature. - **Show & reuse browser** Watch your tests running live & keep devtools open. Develop while continuously running tests. extension screenshot #### Test Runner - [`test.step(title, body)`](https://playwright.dev/docs/api/class-test#test-step) now returns the value of the step function: ```ts test('should work', async ({ page }) => { const pageTitle = await test.step('get title', async () => { await page.goto('https://playwright.dev'); return await page.title(); }); console.log(pageTitle); }); ``` - Added [`test.describe.fixme(title, callback)`](https://playwright.dev/docs/api/class-test#test-describe-fixme). - New `'interrupted'` test status. - Enable tracing via CLI flag: `npx playwright test --trace=on`. - New property [`testCase.id`](https://playwright.dev/docs/api/class-testcase#test-case-id) that can be use in reporters as a history ID. #### Announcements - 🎁 We now ship Ubuntu 22.04 Jammy Jellyfish docker image: `mcr.microsoft.com/playwright:v1.25.0-jammy`. - ðŸŠĶ This is the last release with macOS 10.15 support (deprecated as of 1.21). - ðŸŠĶ This is the last release with Node.js 12 support, we recommend upgrading to Node.js LTS (16). - ⚠ïļ Ubuntu 18 is now deprecated and will not be supported as of Dec 2022. #### Browser Versions - Chromium 105.0.5195.19 - Mozilla Firefox 103.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 104 - Microsoft Edge 104 ### [`v1.24.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.2) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.1...v1.24.2) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/15977](https://togithub.com/microsoft/playwright/issues/15977) - \[BUG] test.use of storage state regression in 1.24 #### Browser Versions - Chromium 104.0.5112.48 - Mozilla Firefox 102.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.24.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.24.0...v1.24.1) ##### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/15898](https://togithub.com/microsoft/playwright/issues/15898) - \[BUG] Typescript error: The type for webServer config property (TestConfigWebServer) is not typed correctly[https://github.com/microsoft/playwright/issues/15913](https://togithub.com/microsoft/playwright/issues/15913)3 - \[BUG] hooksConfig is required for mount fixtur[https://github.com/microsoft/playwright/issues/15932](https://togithub.com/microsoft/playwright/issues/15932)32 - \[BUG] - Install MS Edge on CI Fails ##### Browser Versions - Chromium 104.0.5112.48 - Mozilla Firefox 102.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.24.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.24.0) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.4...v1.24.0) #### 🌍 Multiple Web Servers in `playwright.config.ts` Launch multiple web servers, databases, or other processes by passing an array of configurations: ```ts // playwright.config.ts import type { PlaywrightTestConfig } from '@​playwright/test'; const config: PlaywrightTestConfig = { webServer: [ { command: 'npm run start', port: 3000, timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, { command: 'npm run backend', port: 3333, timeout: 120 * 1000, reuseExistingServer: !process.env.CI, } ], use: { baseURL: 'http://localhost:3000/', }, }; export default config; ``` #### 🐂 Debian 11 Bullseye Support Playwright now supports Debian 11 Bullseye on x86\_64 for Chromium, Firefox and WebKit. Let us know if you encounter any issues! Linux support looks like this: | | Ubuntu 18.04 | Ubuntu 20.04 | Ubuntu 22.04 | Debian 11 | :--- | :---: | :---: | :---: | :---: | | Chromium | ✅ | ✅ | ✅ | ✅ | | WebKit | ✅ | ✅ | ✅ | ✅ | | Firefox | ✅ | ✅ | ✅ | ✅ | #### ðŸ•ĩïļ Anonymous Describe It is now possible to call [`test.describe(callback)`](https://playwright.dev/docs/api/class-test#test-describe-2) to create suites without a title. This is useful for giving a group of tests a common option with [`test.use(options)`](https://playwright.dev/docs/api/class-test#test-use). ```ts test.describe(() => { test.use({ colorScheme: 'dark' }); test('one', async ({ page }) => { // ... }); test('two', async ({ page }) => { // ... }); }); ``` #### ðŸ§Đ Component Tests Update Playwright 1.24 Component Tests introduce `beforeMount` and `afterMount` hooks. Use these to configure your app for tests. ##### Vue + Vue Router For example, this could be used to setup App router in Vue.js: ```js // src/component.spec.ts import { test } from '@​playwright/experimental-ct-vue'; import { Component } from './mycomponent'; test('should work', async ({ mount }) => { const component = await mount(Component, { hooksConfig: { /* anything to configure your app */ } }); }); ``` ```js // playwright/index.ts import { router } from '../router'; import { beforeMount } from '@​playwright/experimental-ct-vue/hooks'; beforeMount(async ({ app, hooksConfig }) => { app.use(router); }); ``` ##### React + Next.js A similar configuration in Next.js would look like this: ```js // src/component.spec.jsx import { test } from '@​playwright/experimental-ct-react'; import { Component } from './mycomponent'; test('should work', async ({ mount }) => { const component = await mount(, { // Pass mock value from test into `beforeMount`. hooksConfig: { router: { query: { page: 1, per_page: 10 }, asPath: '/posts' } } }); }); ``` ```js // playwright/index.js import router from 'next/router'; import { beforeMount } from '@​playwright/experimental-ct-react/hooks'; beforeMount(async ({ hooksConfig }) => { // Before mount, redefine useRouter to return mock value from test. router.useRouter = () => hooksConfig.router; }); ``` #### Browser Versions - Chromium 104.0.5112.48 - Mozilla Firefox 102.0 - WebKit 16.0 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.23.4`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.4) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.3...v1.23.4) #### Highlights This patch includes the following bug fix: [https://github.com/microsoft/playwright/issues/15717](https://togithub.com/microsoft/playwright/issues/15717) - \[REGRESSION]: Suddenly stopped working despite nothing having changed (`experimentalLoader.js:load` did not call the next hook in its chain and did not explicitly signal a short circuit) #### Browser Versions - Chromium 104.0.5112.20 - Mozilla Firefox 100.0.2 - WebKit 15.4 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.23.3`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.3) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.2...v1.23.3) ##### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/15557](https://togithub.com/microsoft/playwright/issues/15557) - \[REGRESSION]: Event Listeners not being removed if same handler is used for different events ##### Browser Versions - Chromium 104.0.5112.20 - Mozilla Firefox 100.0.2 - WebKit 15.4 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.23.2`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.2) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.1...v1.23.2) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/15273](https://togithub.com/microsoft/playwright/issues/15273) - \[BUG] LaunchOptions config has no effect after update to v1.23.0[https://github.com/microsoft/playwright/issues/15351](https://togithub.com/microsoft/playwright/issues/15351)1 - \[REGRESSION]: Component testing project does not compile anymor[https://github.com/microsoft/playwright/issues/15431](https://togithub.com/microsoft/playwright/issues/15431)31 - \[BUG] Regression: page.on('console') is ignored in 1.23 #### Browser Versions - Chromium 104.0.5112.20 - Mozilla Firefox 100.0.2 - WebKit 15.4 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.23.1`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.1) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.23.0...v1.23.1) #### Highlights This patch includes the following bug fixes: [https://github.com/microsoft/playwright/issues/15219](https://togithub.com/microsoft/playwright/issues/15219) - \[REGRESSION]: playwright-core 1.23.0 issue with 'TypeError \[ERR_INVALID_ARG_TYPE]: The "listener" argument' #### Browser Versions - Chromium 104.0.5112.20 - Mozilla Firefox 100.0.2 - WebKit 15.4 This version was also tested against the following stable channels: - Google Chrome 103 - Microsoft Edge 103 ### [`v1.23.0`](https://togithub.com/microsoft/playwright/releases/tag/v1.23.0) [Compare Source](https://togithub.com/Microsoft/playwright/compare/v1.22.2...v1.23.0) Playwright v1.23 updates #### 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: ```bash npx playwright open --save-har=github.har.zip https://github.com/microsoft ``` Alternatively, you can record HAR programmatically: ```ts const context = await browser.newContext({ recordHar: { path: 'github.har.zip' } }); // ... do stuff ... await context.close(); ``` Use the new methods [`page.routeFromHAR()`](https://playwright.dev/docs/api/class-page#page-route-from-har) or [`browserContext.routeFromHAR()`](https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har) to serve matching responses from the [HAR](http://www.softwareishard.com/blog/har-12-spec/) file: ```ts await context.routeFromHAR('github.har.zip'); ``` Read more in [our documentation](https://playwright.dev/docs/network#record-and-replay-requests). ##### Advanced Routing You can now use [`route.fallback()`](https://playwright.dev/docs/api/class-route#route-fallback) to defer routing to other handlers. Consider the following example: ```ts // 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') route.abort(); else route.fallback(); }); }); ``` Note that the new methods [`page.routeFromHAR()`](https://playwright.dev/docs/api/class-page#page-route-from-har) and [`browserContext.routeFromHAR()`](https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har) also participate in routing and could be deferred to. ##### Web-First Assertions Update - New method [`expect(locator).toHaveValues()`](https://playwright.dev/docs/test-assertions#locator-assertions-to-have-values) that asserts all selected values of `