From a04080537e9faba39444e4b655308bc36ee081f0 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Mon, 24 Jun 2024 11:29:07 -0700 Subject: [PATCH] docs: release notes for 1.45 --- docs/src/release-notes-csharp.md | 65 +++++++++++++++++++++++++++++++- docs/src/release-notes-java.md | 63 ++++++++++++++++++++++++++++++- docs/src/release-notes-python.md | 62 +++++++++++++++++++++++++++++- 3 files changed, 187 insertions(+), 3 deletions(-) diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md index 9a3301a764949b..97b0c9cd5045fb 100644 --- a/docs/src/release-notes-csharp.md +++ b/docs/src/release-notes-csharp.md @@ -4,6 +4,69 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.45 + +### Clock + +Utilizing the new [Clock] API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including: +* testing with predefined time; +* keeping consistent time and timers; +* monitoring inactivity; +* ticking through time manually. + +```csharp +// Initialize clock with some time before the test time and let the page load naturally. +// `Date.now` will progress as the timers fire. +await Page.Clock.InstallAsync(new +{ + Time = new DateTime(2024, 2, 2, 8, 0, 0) +}); +await Page.GotoAsync("http://localhost:3333"); + +// Pretend that the user closed the laptop lid and opened it again at 10am. +// Pause the time once reached that point. +await Page.Clock.PauseAtAsync(new DateTime(2024, 2, 2, 10, 0, 0)); + +// Assert the page state. +await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:00:00 AM"); + +// Close the laptop lid again and open it at 10:30am. +await Page.Clock.FastForwardAsync("30:00"); +await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:30:00 AM"); +``` + +See [the clock guide](./clock.md) for more details. + +### Miscellaneous + +- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `` elements. + ```csharp + await page.GetByLabel("Upload directory").SetInputFilesAsync("mydir"); + ``` + +- Multiple methods like [`method: Locator.click`] or [`method: Locator.press`] now support a `ControlOrMeta` modifier key. This key maps to `Meta` on macOS and maps to `Control` on Windows and Linux. + ```csharp + // Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation. + await page.Keyboard.PressAsync("ControlOrMeta+S"); + ``` + +- New property `httpCredentials.send` in [`method: APIRequest.newContext`] that allows to either always send the `Authorization` header or only send it in response to `401 Unauthorized`. + +- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04. + +- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit. + +### Browser Versions + +* Chromium 127.0.6533.5 +* Mozilla Firefox 127.0 +* WebKit 17.4 + +This version was also tested against the following stable channels: + +* Google Chrome 126 +* Microsoft Edge 126 + ## Version 1.44 ### New APIs @@ -129,7 +192,7 @@ This version was also tested against the following stable channels: ### New Locator Handler New method [`method: Page.addLocatorHandler`] registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears. - + ```csharp // Setup the handler. await Page.AddLocatorHandlerAsync( diff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.md index 4a46556f68933f..6dce675b8f2251 100644 --- a/docs/src/release-notes-java.md +++ b/docs/src/release-notes-java.md @@ -4,6 +4,67 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.45 + +### Clock + +Utilizing the new [Clock] API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including: +* testing with predefined time; +* keeping consistent time and timers; +* monitoring inactivity; +* ticking through time manually. + +```java +// Initialize clock with some time before the test time and let the page load +// naturally. `Date.now` will progress as the timers fire. +page.clock().install(new Clock.InstallOptions().setTime("2024-02-02T08:00:00")); +page.navigate("http://localhost:3333"); +Locator locator = page.getByTestId("current-time"); + +// Pretend that the user closed the laptop lid and opened it again at 10am. +// Pause the time once reached that point. +page.clock().pauseAt("2024-02-02T10:00:00"); + +// Assert the page state. +assertThat(locator).hasText("2/2/2024, 10:00:00 AM"); + +// Close the laptop lid again and open it at 10:30am. +page.clock().fastForward("30:00"); +assertThat(locator).hasText("2/2/2024, 10:30:00 AM"); +``` + +See [the clock guide](./clock.md) for more details. + +### Miscellaneous + +- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `` elements. + ```java + page.getByLabel("Upload directory").setInputFiles(Paths.get("mydir")); + ``` + +- Multiple methods like [`method: Locator.click`] or [`method: Locator.press`] now support a `ControlOrMeta` modifier key. This key maps to `Meta` on macOS and maps to `Control` on Windows and Linux. + ```java + // Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation. + page.keyboard.press("ControlOrMeta+S"); + ``` + +- New property `httpCredentials.send` in [`method: APIRequest.newContext`] that allows to either always send the `Authorization` header or only send it in response to `401 Unauthorized`. + +- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04. + +- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit. + +### Browser Versions + +* Chromium 127.0.6533.5 +* Mozilla Firefox 127.0 +* WebKit 17.4 + +This version was also tested against the following stable channels: + +* Google Chrome 126 +* Microsoft Edge 126 + ## Version 1.44 ### New APIs @@ -201,7 +262,7 @@ Learn more about the fixtures in our [JUnit guide](./junit.md). ### New Locator Handler New method [`method: Page.addLocatorHandler`] registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears. - + ```java // Setup the handler. page.addLocatorHandler( diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.md index 590a4edb88f264..0c948efde4c1b5 100644 --- a/docs/src/release-notes-python.md +++ b/docs/src/release-notes-python.md @@ -4,6 +4,66 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.45 + +### Clock + +Utilizing the new [Clock] API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including: +* testing with predefined time; +* keeping consistent time and timers; +* monitoring inactivity; +* ticking through time manually. + +```python +# Initialize clock with some time before the test time and let the page load +# naturally. `Date.now` will progress as the timers fire. +page.clock.install(time=datetime.datetime(2024, 2, 2, 8, 0, 0)) +page.goto("http://localhost:3333") + +# Pretend that the user closed the laptop lid and opened it again at 10am. +# Pause the time once reached that point. +page.clock.pause_at(datetime.datetime(2024, 2, 2, 10, 0, 0)) + +# Assert the page state. +expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM") + +# Close the laptop lid again and open it at 10:30am. +page.clock.fast_forward("30:00") +expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM") +``` + +See [the clock guide](./clock.md) for more details. + +### Miscellaneous + +- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `` elements. + ```python + page.get_by_label("Upload directory").set_input_files('mydir') + ``` + +- Multiple methods like [`method: Locator.click`] or [`method: Locator.press`] now support a `ControlOrMeta` modifier key. This key maps to `Meta` on macOS and maps to `Control` on Windows and Linux. + ```python + // Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation. + page.keyboard.press("ControlOrMeta+S") + ``` + +- New property `httpCredentials.send` in [`method: APIRequest.newContext`] that allows to either always send the `Authorization` header or only send it in response to `401 Unauthorized`. + +- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04. + +- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit. + +### Browser Versions + +* Chromium 127.0.6533.5 +* Mozilla Firefox 127.0 +* WebKit 17.4 + +This version was also tested against the following stable channels: + +* Google Chrome 126 +* Microsoft Edge 126 + ## Version 1.44 ### New APIs @@ -109,7 +169,7 @@ This version was also tested against the following stable channels: ### New Locator Handler New method [`method: Page.addLocatorHandler`] registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears. - + ```python # Setup the handler. page.add_locator_handler(