From 5268dd7196ddcd429b5f0f165b69778b23e84af9 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 12 May 2022 12:07:55 -0600 Subject: [PATCH] docs: add release notes for 1.22 (#14100) --- docs/src/release-notes-csharp.md | 22 ++++++++++ docs/src/release-notes-java.md | 26 ++++++++++++ docs/src/release-notes-js.md | 70 ++++++++++++++++++++++++++++++++ docs/src/release-notes-python.md | 28 +++++++++++++ 4 files changed, 146 insertions(+) diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md index 40bfd075067c1..1b582d2c0fbed 100644 --- a/docs/src/release-notes-csharp.md +++ b/docs/src/release-notes-csharp.md @@ -5,6 +5,28 @@ title: "Release notes" +## Version 1.22 + +### Highlights + +- Role selectors that allow selecting elements by their [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). + + ```csharp + // Click a button with accessible name "log in" + await page.ClickAsync("role=button[name='log in']") + ``` + + Read more in [our documentation](./selectors#role-selector). + +- New [`method: Locator.filter`] API to filter an existing locator + + ```csharp + var buttons = page.Locator("role=button"); + // ... + var submitLocator = buttons.Filter(new LocatorFilterOptions { HasText = "Sign up" }); + await submitLocator.ClickAsync(); + ``` + ## Version 1.21 ### Highlights diff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.md index a77252035c4a7..db54b38b6e8b2 100644 --- a/docs/src/release-notes-java.md +++ b/docs/src/release-notes-java.md @@ -5,6 +5,32 @@ title: "Release notes" +## Version 1.22 + +### Highlights + +- Role selectors that allow selecting elements by their [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). + + ```java + // Click a button with accessible name "log in" + page.click("role=button[name='log in']") + ``` + + Read more in [our documentation](./selectors#role-selector). + +- New [`method: Locator.filter`] API to filter an existing locator + + ```java + Locator buttonsLocator = page.locator("role=button"); + // ... + Locator submitButton = buttonsLocator.filter(new Locator.FilterOptions().setHasText("Submit")); + submitButton.click(); + ``` + +- Playwright for Java now supports **Ubuntu 20.04 ARM64** and **Apple M1**. + You can now run Playwright for Java tests on Apple M1, inside Docker on Apple M1, and on Raspberry Pi. + + ## Version 1.21 ### Highlights diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index cd9ca5788599b..0c3c2ce61c4cb 100644 --- a/docs/src/release-notes-js.md +++ b/docs/src/release-notes-js.md @@ -5,6 +5,76 @@ title: "Release notes" +## Version 1.22 + +### Highlights + +- Components Testing (preview) + + Playwright Test can now test your [React](https://reactjs.org/), + [Vue.js](https://vuejs.org/) or [Svelte](https://svelte.dev/) components. + You can use all the features + of Playwright Test (such as parallelization, emulation & debugging) while running components + in real browsers. + + Here is what a typical component test looks like: + + ```ts + // App.spec.tsx + import { test, expect } from '@playwright/experimental-ct-react'; + import App from './App'; + + // Let's test component in a dark scheme! + test.use({ colorScheme: 'dark' }); + + test('should render', async ({ mount }) => { + const component = await mount(); + + // As with any Playwright test, assert locator text. + await expect(component).toContainText('React'); + // Or do a screenshot 🚀 + await expect(component).toHaveScreenshot(); + // Or use any Playwright method + await component.click(); + }); + ``` + + Read more in [our documentation](./test-components). + +- Role selectors that allow selecting elements by their [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). + + ```js + // Click a button with accessible name "log in" + await page.click('role=button[name="log in"]') + ``` + + Read more in [our documentation](./selectors#role-selector). + +- New [`method: Locator.filter`] API to filter an existing locator + + ```js + const buttons = page.locator('role=button'); + // ... + const submitButton = buttons.filter({ hasText: 'Submit' }); + await submitButton.click(); + ``` + +- New web-first assertions [`method: PageAssertions.toHaveScreenshot`] and [`method: LocatorAssertions.toHaveScreenshot`] that + wait for screenshot stabilization and enhances test reliability. + + The new assertions has screenshot-specific defaults, such as: + * disables animations + * uses CSS scale option + + ```js + await page.goto('https://playwright.dev'); + await expect(page).toHaveScreenshot(); + ``` + + The new [`method: PageAssertions.toHaveScreenshot`] saves screenshots at the same + location as [`method: ScreenshotAssertions.toMatchSnapshot#1`]. + + ## Version 1.21 ### Highlights diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.md index 650368ffc1f59..fe4072d1a537e 100644 --- a/docs/src/release-notes-python.md +++ b/docs/src/release-notes-python.md @@ -5,6 +5,34 @@ title: "Release notes" +## Version 1.22 + +### Highlights + +- Role selectors that allow selecting elements by their [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). + + ```py + # Click a button with accessible name "log in" + page.click("role=button[name='log in']") + ``` + + Read more in [our documentation](./selectors#role-selector). + +- New [`method: Locator.filter`] API to filter an existing locator + + ```py + buttons = page.locator("role=button") + # ... + submit_button = buttons.filter(has_text="Submit") + submit_button.click() + ``` + +- Codegen now supports generating Pytest Tests + + ![Graphics](https://user-images.githubusercontent.com/746130/168098384-40784024-6c26-4426-8255-e714862af6fc.png) + + + ## Version 1.21 ### Highlights