mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
docs: release notes for v1.27 (#17858)
This commit is contained in:
parent
6750a02506
commit
cdeb9e3066
@ -4,18 +4,70 @@ title: "Release notes"
|
||||
toc_max_heading_level: 2
|
||||
---
|
||||
|
||||
## Version 1.27
|
||||
|
||||
### Locators
|
||||
|
||||
With these new APIs writing locators is a joy:
|
||||
- [`method: Page.getByText`] to locate by text content.
|
||||
- [`method: Page.getByRole`] 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).
|
||||
- [`method: Page.getByLabel`] to locate a form control by associated label's text.
|
||||
- [`method: Page.getByPlaceholder`] to locate an input by placeholder.
|
||||
- [`method: Page.getByAltText`] to locate an element, usually image, by its text alternative.
|
||||
- [`method: Page.getByTitle`] 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], [FrameLocator] and [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
|
||||
|
||||
- [`method: LocatorAssertions.toHaveAttribute`] 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.
|
||||
|
||||
### 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
|
||||
|
||||
|
||||
## Version 1.26
|
||||
|
||||
### (Experimental) Docker integration
|
||||
|
||||
Playwright Test now ships an **experimental** Docker integration. The Docker container provides a consistent environment, eliminating browser rendering differences across platforms.
|
||||
|
||||
With this integration, only **browser binaries** are running inside a Docker container, while all the code is still running on the host operating system.
|
||||
|
||||
<img width="450px" src="https://user-images.githubusercontent.com/746130/189774482-fd65d4ce-7b45-46c8-8761-36b76dba4671.png" />
|
||||
|
||||
Read more in [our documentation](./docker#experimental-playwright-test-docker-integration).
|
||||
|
||||
### Assertions
|
||||
|
||||
- New option `enabled` for [`method: LocatorAssertions.toBeEnabled`].
|
||||
@ -41,7 +93,7 @@ await page.goto('https://playwright.dev', {
|
||||
```
|
||||
|
||||
Prior to 1.26, this would wait for all iframes to fire the `DOMContentLoaded`
|
||||
event.
|
||||
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.
|
||||
@ -151,7 +203,7 @@ if you encounter any issues!
|
||||
Linux support looks like this:
|
||||
|
||||
| | Ubuntu 18.04 | Ubuntu 20.04 | Ubuntu 22.04 | Debian 11
|
||||
| :--- | :---: | :---: | :---: | :---: |
|
||||
| :--- | :---: | :---: | :---: | :---: |
|
||||
| Chromium | ✅ | ✅ | ✅ | ✅ |
|
||||
| WebKit | ✅ | ✅ | ✅ | ✅ |
|
||||
| Firefox | ✅ | ✅ | ✅ | ✅ |
|
||||
@ -174,7 +226,7 @@ test.describe(() => {
|
||||
});
|
||||
```
|
||||
|
||||
### 🧩 Component Tests Update
|
||||
### 🧩 Component Tests Update
|
||||
|
||||
Playwright 1.24 Component Tests introduce `beforeMount` and `afterMount` hooks.
|
||||
Use these to configure your app for tests.
|
||||
|
Loading…
Reference in New Issue
Block a user