Releases: microsoft/playwright
v1.26.1
Highlights
This patch includes the following bug fixes:
#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
Assertions
- New option enabled for
expect(locator).toBeEnabled([options])
. expect(locator).toHaveText(expected[, options])
now pierces open shadow roots.- New option editable for
expect(locator).toBeEditable([options])
. - New option visible for
expect(locator).toBeVisible([options])
.
Other Highlights
- New option
maxRedirects
forapiRequestContext.get(url[, options])
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 asexpect(value).toMatchSnapshot()
andexpect(page).toHaveScreenshot()
.
Behavior Change
A bunch of Playwright APIs already support the waitUntil: 'domcontentloaded' option. For example:
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
Highlights
This patch includes the following bug fixes:
#16937 - [REGRESSION]: session storage failing >= 1.25.0 in firefox
#16955 - 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
Highlights
This patch includes the following bug fixes:
#16319 - [BUG] webServer.command esbuild fails with ESM and Yarn
#16460 - [BUG] Component test fails on 2nd run when SSL is used
#16665 - [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
VSCode Extension
-
New Playwright actions view
-
Pick selector
You can pick selector right from a live page, before or after running a test -
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.
Test Runner
-
test.step(title, body)
now returns the value of the step function: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); });
-
New
'interrupted'
test status. -
Enable tracing via CLI flag:
npx playwright test --trace=on
. -
New property
testCase.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
Highlights
This patch includes the following bug fixes:
#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
Highlights
This patch includes the following bug fixes:
#15898 - [BUG] Typescript error: The type for webServer config property (TestConfigWebServer) is not typed correctly
#15913 - [BUG] hooksConfig is required for mount fixture
#15932 - [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
🌍 Multiple Web Servers in playwright.config.ts
Launch multiple web servers, databases, or other processes by passing an array of configurations:
// 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)
to create suites without a title. This is useful for giving a group of tests a common option with test.use(options)
.
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:
// 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 */
}
});
});
// 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:
// src/component.spec.jsx
import { test } from '@playwright/experimental-ct-react';
import { Component } from './mycomponent';
test('should work', async ({ mount }) => {
const component = await mount(<Component></Component>, {
// Pass mock value from test into `beforeMount`.
hooksConfig: {
router: {
query: { page: 1, per_page: 10 },
asPath: '/posts'
}
}
});
});
// 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
Highlights
This patch includes the following bug fix:
#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
Highlights
This patch includes the following bug fixes:
#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