From 1781bf35b3867855e8aeb922e8083e85aa0c11f3 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 21 Nov 2024 13:45:00 +0000 Subject: [PATCH] cherry-pick(#33706): docs: release notes for languages v1.49 --- docs/src/api/class-locatorassertions.md | 4 +- docs/src/api/class-tracing.md | 8 +-- docs/src/aria-snapshots.md | 8 +-- docs/src/release-notes-csharp.md | 85 +++++++++++++++++++++++++ docs/src/release-notes-java.md | 73 +++++++++++++++++++++ docs/src/release-notes-python.md | 74 +++++++++++++++++++++ 6 files changed, 242 insertions(+), 10 deletions(-) diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index c9297f68ca..5b4fc45fe0 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -2139,7 +2139,7 @@ await expect(page.locator('body')).toMatchAriaSnapshot(` ``` ```python async -await page.goto('https://demo.playwright.dev/todomvc/') +await page.goto("https://demo.playwright.dev/todomvc/") await expect(page.locator('body')).to_match_aria_snapshot(''' - heading "todos" - textbox "What needs to be done?" @@ -2147,7 +2147,7 @@ await expect(page.locator('body')).to_match_aria_snapshot(''' ``` ```python sync -page.goto('https://demo.playwright.dev/todomvc/') +page.goto("https://demo.playwright.dev/todomvc/") expect(page.locator('body')).to_match_aria_snapshot(''' - heading "todos" - textbox "What needs to be done?" diff --git a/docs/src/api/class-tracing.md b/docs/src/api/class-tracing.md index 5a89dbdac1..3b0011c7b1 100644 --- a/docs/src/api/class-tracing.md +++ b/docs/src/api/class-tracing.md @@ -302,10 +302,10 @@ await test.step('Log in', async () => { ```java // All actions between group and groupEnd // will be shown in the trace viewer as a group. -page.context().tracing.group("Open Playwright.dev > API"); +page.context().tracing().group("Open Playwright.dev > API"); page.navigate("https://playwright.dev/"); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("API")).click(); -page.context().tracing.groupEnd(); +page.context().tracing().groupEnd(); ``` ```python sync @@ -329,10 +329,10 @@ await page.context.tracing.group_end() ```csharp // All actions between GroupAsync and GroupEndAsync // will be shown in the trace viewer as a group. -await Page.Context().Tracing.GroupAsync("Open Playwright.dev > API"); +await Page.Context.Tracing.GroupAsync("Open Playwright.dev > API"); await Page.GotoAsync("https://playwright.dev/"); await Page.GetByRole(AriaRole.Link, new() { Name = "API" }).ClickAsync(); -await Page.Context().Tracing.GroupEndAsync(); +await Page.Context.Tracing.GroupEndAsync(); ``` ### param: Tracing.group.name diff --git a/docs/src/aria-snapshots.md b/docs/src/aria-snapshots.md index 0b4673abef..c26178bbe8 100644 --- a/docs/src/aria-snapshots.md +++ b/docs/src/aria-snapshots.md @@ -67,19 +67,19 @@ await expect(page.locator('body')).toMatchAriaSnapshot(` ``` ```python sync -page.locator("body").to_match_aria_snapshot(""" +expect(page.locator("body")).to_match_aria_snapshot(""" - heading "title" """) ``` ```python async -await page.locator("body").to_match_aria_snapshot(""" +await expect(page.locator("body")).to_match_aria_snapshot(""" - heading "title" """) ``` ```java -page.locator("body").expect().toMatchAriaSnapshot(""" +assertThat(page.locator("body")).matchesAriaSnapshot(""" - heading "title" """); ``` @@ -185,7 +185,7 @@ interactive interface: - **"Assert snapshot" Action**: In the code generator, you can use the "Assert snapshot" action to automatically create a snapshot assertion for the selected elements. This is a quick way to capture the aria snapshot as part of your recorded test flow. - + - **"Aria snapshot" Tab**: The "Aria snapshot" tab within the code generator interface visually represents the aria snapshot for a selected locator, letting you explore, inspect, and verify element roles, attributes, and accessible names to aid snapshot creation and review. diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md index 130b9d4a71..286d2c3d90 100644 --- a/docs/src/release-notes-csharp.md +++ b/docs/src/release-notes-csharp.md @@ -5,6 +5,91 @@ toc_max_heading_level: 2 --- +## Version 1.49 + +### Aria snapshots + +New assertion [`method: LocatorAssertions.toMatchAriaSnapshot`] verifies page structure by comparing to an expected accessibility tree, represented as YAML. + +```csharp +await page.GotoAsync("https://playwright.dev"); +await Expect(page.Locator("body")).ToMatchAriaSnapshotAsync(@" + - banner: + - heading /Playwright enables reliable/ [level=1] + - link ""Get started"" + - link ""Star microsoft/playwright on GitHub"" + - main: + - img ""Browsers (Chromium, Firefox, WebKit)"" + - heading ""Any browser • Any platform • One API"" +"); +``` + +You can generate this assertion with [Test Generator](./codegen) or by calling [`method: Locator.ariaSnapshot`]. + +Learn more in the [aria snapshots guide](./aria-snapshots). + +### Tracing groups + +New method [`method: Tracing.group`] allows you to visually group actions in the trace viewer. + +```csharp +// All actions between GroupAsync and GroupEndAsync +// will be shown in the trace viewer as a group. +await Page.Context.Tracing.GroupAsync("Open Playwright.dev > API"); +await Page.GotoAsync("https://playwright.dev/"); +await Page.GetByRole(AriaRole.Link, new() { Name = "API" }).ClickAsync(); +await Page.Context.Tracing.GroupEndAsync(); +``` + +### Breaking: `chrome` and `msedge` channels switch to new headless mode + +This change affects you if you're using one of the following channels in your `playwright.config.ts`: +- `chrome`, `chrome-dev`, `chrome-beta`, or `chrome-canary` +- `msedge`, `msedge-dev`, `msedge-beta`, or `msedge-canary` + +After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for more details. + +### Try new Chromium headless + +You can opt into the new headless mode by using `'chromium'` channel. As [official Chrome documentation puts it](https://developer.chrome.com/blog/chrome-headless-shell): + +> New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing. + +See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in. + +```xml csharp title="runsettings.xml" + + + + chromium + + chromium + + + +``` + +```bash csharp +dotnet test -- Playwright.BrowserName=chromium Playwright.LaunchOptions.Channel=chromium +``` + +### Miscellaneous + +- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version. +- `` elements inside a snapshot now draw a preview. + +### Browser Versions + +- Chromium 131.0.6778.33 +- Mozilla Firefox 132.0 +- WebKit 18.2 + +This version was also tested against the following stable channels: + +- Google Chrome 130 +- Microsoft Edge 130 + + ## Version 1.48 ### WebSocket routing diff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.md index a5d01668de..8130c77f07 100644 --- a/docs/src/release-notes-java.md +++ b/docs/src/release-notes-java.md @@ -4,6 +4,79 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.49 + +### Aria snapshots + +New assertion [`method: LocatorAssertions.toMatchAriaSnapshot`] verifies page structure by comparing to an expected accessibility tree, represented as YAML. + +```java +page.navigate("https://playwright.dev"); +assertThat(page.locator("body")).matchesAriaSnapshot(""" + - banner: + - heading /Playwright enables reliable/ [level=1] + - link "Get started" + - link "Star microsoft/playwright on GitHub" + - main: + - img "Browsers (Chromium, Firefox, WebKit)" + - heading "Any browser • Any platform • One API" +"""); +``` + +You can generate this assertion with [Test Generator](./codegen) or by calling [`method: Locator.ariaSnapshot`]. + +Learn more in the [aria snapshots guide](./aria-snapshots). + +### Tracing groups + +New method [`method: Tracing.group`] allows you to visually group actions in the trace viewer. + +```java +// All actions between group and groupEnd +// will be shown in the trace viewer as a group. +page.context().tracing().group("Open Playwright.dev > API"); +page.navigate("https://playwright.dev/"); +page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("API")).click(); +page.context().tracing().groupEnd(); +``` + +### Breaking: `chrome` and `msedge` channels switch to new headless mode + +This change affects you if you're using one of the following channels in your `playwright.config.ts`: +- `chrome`, `chrome-dev`, `chrome-beta`, or `chrome-canary` +- `msedge`, `msedge-dev`, `msedge-beta`, or `msedge-canary` + +After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for more details. + +### Try new Chromium headless + +You can opt into the new headless mode by using `'chromium'` channel. As [official Chrome documentation puts it](https://developer.chrome.com/blog/chrome-headless-shell): + +> New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing. + +See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in. + +```java +Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setChannel("chromium")); +``` + +### Miscellaneous + +- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version. +- `` elements inside a snapshot now draw a preview. + +### Browser Versions + +- Chromium 131.0.6778.33 +- Mozilla Firefox 132.0 +- WebKit 18.2 + +This version was also tested against the following stable channels: + +- Google Chrome 130 +- Microsoft Edge 130 + + ## Version 1.48 ### WebSocket routing diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.md index 211e0ad5c2..fc7dd1ccd1 100644 --- a/docs/src/release-notes-python.md +++ b/docs/src/release-notes-python.md @@ -4,6 +4,80 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.49 + +### Aria snapshots + +New assertion [`method: LocatorAssertions.toMatchAriaSnapshot`] verifies page structure by comparing to an expected accessibility tree, represented as YAML. + +```python +page.goto("https://playwright.dev") +expect(page.locator('body')).to_match_aria_snapshot(''' + - banner: + - heading /Playwright enables reliable/ [level=1] + - link "Get started" + - link "Star microsoft/playwright on GitHub" + - main: + - img "Browsers (Chromium, Firefox, WebKit)" + - heading "Any browser • Any platform • One API" +''') +``` + +You can generate this assertion with [Test Generator](./codegen) or by calling [`method: Locator.ariaSnapshot`]. + +Learn more in the [aria snapshots guide](./aria-snapshots). + +### Tracing groups + +New method [`method: Tracing.group`] allows you to visually group actions in the trace viewer. + +```python +# All actions between group and group_end +# will be shown in the trace viewer as a group. +page.context.tracing.group("Open Playwright.dev > API") +page.goto("https://playwright.dev/") +page.get_by_role("link", name="API").click() +page.context.tracing.group_end() +``` + +### Breaking: `chrome` and `msedge` channels switch to new headless mode + +This change affects you if you're using one of the following channels in your `playwright.config.ts`: +- `chrome`, `chrome-dev`, `chrome-beta`, or `chrome-canary` +- `msedge`, `msedge-dev`, `msedge-beta`, or `msedge-canary` + +After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for more details. + +### Try new Chromium headless + +You can opt into the new headless mode by using `'chromium'` channel. As [official Chrome documentation puts it](https://developer.chrome.com/blog/chrome-headless-shell): + +> New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing. + +See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in. + +```bash python +pytest test_login.py --browser-channel chromium +``` + +### Miscellaneous + +- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version. +- `` elements inside a snapshot now draw a preview. +- Python 3.8 is not supported anymore. + +### Browser Versions + +- Chromium 131.0.6778.33 +- Mozilla Firefox 132.0 +- WebKit 18.2 + +This version was also tested against the following stable channels: + +- Google Chrome 130 +- Microsoft Edge 130 + + ## Version 1.48 ### WebSocket routing