v1.26.0
microsoft/playwrightv1.26.0Sep 20, 2022by aslushnikov
AI Summary
This release introduces new assertion options for visibility and editability, adds command-line flags for skipping snapshots, and limits API request redirects. It also changes the iframe behavior for the 'domcontentloaded' wait strategy.
Key Highlights
- New assertion options: `toBeEditable`, `toBeVisible` (with options), and `toBeEnabled` (with options).
- New CLI flags: `--pass-with-no-tests` and `--ignore-snapshots`.
- New API option: `maxRedirects` for `apiRequestContext` methods.
- Behavior change: `waitUntil: 'domcontentloaded'` now only waits for the target frame instead of all iframes.
Breaking Changes
- The `waitUntil: 'domcontentloaded'` option now only waits for the target frame to fire the DOMContentLoaded event, whereas previously it waited for all iframes.
New Features
- New `toBeEditable` assertion option.
- New `toBeVisible` assertion option (visible flag).
- New `toBeEnabled` assertion option.
- New `maxRedirects` option for API requests.
- CLI flags for skipping snapshots and passing with no tests.
Full Release Notes
## 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