@playwright/experimental-ct-vue2
1.48.2 · 25 Oct 2024Apache-2.013.2k / weekRepositoryHomepagenpmAtom feed
66 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
1.28.0
16 Nov 2022Reading the note…
1.27.1
12 Oct 2022Reading the note…
1.27.0
7 Oct 2022page.getByText(text, options)to locate by text content.page.getByRole(role, options)to locate by ARIA role, ARIA attributes and accessible name.page.getByLabel(label, options)to locate a form control by associated label's text.
Locators
With these new APIs, inspired by Testing Library, writing locators is a joy:
page.getByText(text, options)to locate by text content.page.getByRole(role, options)to locate by ARIA role, ARIA attributes and accessible name.page.getByLabel(label, options)to locate a form control by associated label's text.page.getByPlaceholder(placeholder, options)to locate an input by placeholder.page.getByAltText(altText, options)to locate an element, usually image, by its text alternative.page.getByTitle(title, options)to locate an element by its title.
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, FrameLocator and Frame classes.
Other highlights
workersoption in theplaywright.config.tsnow accepts a percentage string to use some of the available CPUs. You can also pass it in the command line:npx playwright test --workers=20%
New options
hostandportfor the html reporter.reporters: [['html', { host: 'localhost', port: '9223' }]]New field
FullConfig.configFileis 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)with an empty value does not match missing attribute anymore. For example, the following snippet will succeed whenbuttondoes not have adisabledattribute.await expect(page.getByRole('button')).toHaveAttribute('disabled', '');Command line options
--grepand--grep-invertpreviously incorrectly ignoredgrepandgrepInvertoptions 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:
["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
1.26.1
27 Sep 2022Chromium 106.0.5249.30
Mozilla Firefox 104.0
WebKit 16.0
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
1.26.0
20 Sep 2022Reading the note…
1.25.2
7 Sep 2022Reading the note…
1.25.1
23 Aug 2022Reading the note…
1.25.0
11 Aug 2022- Breaking
⚠️ Ubuntu 18 is now deprecated and will not be supported as of Dec 2022.
New Playwright actions view
Pick selector
You can pick selector right from a live page, before or after running a test
VSCode Extension
New Playwright actions view
Pick selector
You can pick selector right from a live page, before or after running a testRecord 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.idthat 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).
- Breaking
⚠️ 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
1.24.2
29 Jul 2022Reading the note…
1.24.1
26 Jul 2022Chromium 104.0.5112.48
Mozilla Firefox 102.0
WebKit 16.0
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 FailsBrowser 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
1.24.0
21 Jul 2022Chromium 104.0.5112.48
Mozilla Firefox 102.0
WebKit 16.0
Multiple Web Servers in
playwright.config.tsLaunch 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 withtest.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
beforeMountandafterMounthooks.
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
1.23.4
16 Jul 2022Chromium 104.0.5112.20
Mozilla Firefox 100.0.2
WebKit 15.4
Highlights
This patch includes the following bug fix:
#15717 - [REGRESSION]: Suddenly stopped working despite nothing having changed (
experimentalLoader.js:loaddid 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
1.23.3
13 Jul 2022Reading the note…
1.23.2
7 Jul 2022Chromium 104.0.5112.20
Mozilla Firefox 100.0.2
WebKit 15.4
Highlights
This patch includes the following bug fixes:
#15273 - [BUG] LaunchOptions config has no effect after update to v1.23.0
#15351 - [REGRESSION]: Component testing project does not compile anymore
#15431 - [BUG] Regression: page.on('console') is ignored in 1.23Browser 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
1.23.1
30 Jun 2022Chromium 104.0.5112.20
Mozilla Firefox 100.0.2
WebKit 15.4
Highlights
This patch includes the following bug fixes:
#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
1.23.0
27 Jun 2022Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.