From 422df4cbbe97725d2c27b6dd281783827f76d971 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 8 Mar 2022 13:15:55 -0700 Subject: [PATCH] docs: add js release notes for 1.20 (#12575) --- docs/src/release-notes-js.md | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index a8a6ae1fcf..ba81ff6308 100644 --- a/docs/src/release-notes-js.md +++ b/docs/src/release-notes-js.md @@ -5,6 +5,90 @@ title: "Release notes" +## Version 1.20 + +### Visual Regression Testing + +- New options for methods [`method: Page.screenshot`], [`method: Locator.screenshot`] and [`method: ElementHandle.screenshot`]: + * Option `animations: "disabled"` rewinds all CSS animations and transitions to a consistent state + * Option `mask: Locator[]` masks given elements, overlaying them with pink `#FF00FF` boxes. +- New web-first assertions for screenshots: [`method: PageAssertions.toHaveScreenshot`] and [`method: LocatorAssertions.toHaveScreenshot`]. These methods will re-take screenshot until it matches the saved expectation. When generating a new expectation, the method will re-take screenshots until 2 consecutive screenshots match. + + New methods support both named and anonymous (auto-named) expectations: + + ```js + // Take a full-page screenshot with a named expectation `fullpage.png`. + await expect(page).toHaveScreenshot('fullpage.png', { fullPage: true }); + // Take a screenshot of an element with anonymous expectation. + await expect(page.locator('text=Booking')).toHaveScreenshot(); + ``` + + Methods support all screenshot options from [`method: Page.screenshot`] and [`method: Locator.screenshot`]. + + These methods also support new `maxDiffPixels` and `maxDiffPixelRatio` options for fine-grained screenshot comparison: + + ```js + await expect(page).toHaveScreenshot({ + fullPage: true, // take a full page screenshot + maxDiffPixels: 27, // allow no more than 27 different pixels. + }); + ``` + + It is most convenient to specify `maxDiffPixels` or `maxDiffPixelRatio` once in [`property: TestConfig.expect`]. + +### Other Updates + +- Playwright Test now adds [`property: TestConfig.fullyParallel`] mode. By default, Playwright Test parallelizes between files. In fully parallel mode, tests inside a single file are also run in parallel. You can also use `--fully-parallel` command line flag. + + ```ts + // playwright.config.ts + export default { + fullyParallel: true, + }; + ``` + +- [`property: TestProject.grep`] and [`property: TestProject.grepInvert`] are now configurable per project. For example, you can now + configure smoke tests project using `grep`: + ```ts + // playwright.config.ts + export default { + projects: [ + { + name: 'smoke tests', + grep: '@smoke', + }, + ], + }; + ``` + +- [Trace Viewer](./trace-viewer) now shows [API testing requests](./src/test-api-testing). +- `expect().toMatchSnapshot()` now supports anonymous snapshots: when snapshot name is missing, Playwright Test will generate one + automatically: + + ```js + expect('Web is Awesome <3').toMatchSnapshot(); + ``` + +- [`method: Locator.highlight`] visually reveals element(s) for easier debugging. + +### Announcements + +- We now ship a designated Python docker image `mcr.microsoft.com/playwright/python`. Please switch over to it if you use + Python. This is the last release that includes Python inside our javascript `mcr.microsoft.com/playwright` docker image. +- v1.20 is the last release that ships WebKit for macOS 10.15 Catalina. All future versions will support WebKit for macOS 11 BigSur + and up. + +### Browser Versions + +- Chromium 101.0.4921.0 +- Mozilla Firefox 97.0.1 +- WebKit 15.4 + +This version was also tested against the following stable channels: + +- Google Chrome 99 +- Microsoft Edge 99 + ## Version 1.19 ### Playwright Test Update