Skip to content

Commit 4f3f6ee

Browse files
committed
cherry-pick(#31421): docs: release notes for 1.45
1 parent d557b7b commit 4f3f6ee

File tree

3 files changed

+187
-3
lines changed

3 files changed

+187
-3
lines changed

docs/src/release-notes-csharp.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,69 @@ title: "Release notes"
44
toc_max_heading_level: 2
55
---
66

7+
## Version 1.45
8+
9+
### Clock
10+
11+
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:
12+
* testing with predefined time;
13+
* keeping consistent time and timers;
14+
* monitoring inactivity;
15+
* ticking through time manually.
16+
17+
```csharp
18+
// Initialize clock with some time before the test time and let the page load naturally.
19+
// `Date.now` will progress as the timers fire.
20+
await Page.Clock.InstallAsync(new
21+
{
22+
Time = new DateTime(2024, 2, 2, 8, 0, 0)
23+
});
24+
await Page.GotoAsync("http://localhost:3333");
25+
26+
// Pretend that the user closed the laptop lid and opened it again at 10am.
27+
// Pause the time once reached that point.
28+
await Page.Clock.PauseAtAsync(new DateTime(2024, 2, 2, 10, 0, 0));
29+
30+
// Assert the page state.
31+
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:00:00 AM");
32+
33+
// Close the laptop lid again and open it at 10:30am.
34+
await Page.Clock.FastForwardAsync("30:00");
35+
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:30:00 AM");
36+
```
37+
38+
See [the clock guide](./clock.md) for more details.
39+
40+
### Miscellaneous
41+
42+
- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `<input type=file webkitdirectory>` elements.
43+
```csharp
44+
await page.GetByLabel("Upload directory").SetInputFilesAsync("mydir");
45+
```
46+
47+
- 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.
48+
```csharp
49+
// Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
50+
await page.Keyboard.PressAsync("ControlOrMeta+S");
51+
```
52+
53+
- 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`.
54+
55+
- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
56+
57+
- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.
58+
59+
### Browser Versions
60+
61+
* Chromium 127.0.6533.5
62+
* Mozilla Firefox 127.0
63+
* WebKit 17.4
64+
65+
This version was also tested against the following stable channels:
66+
67+
* Google Chrome 126
68+
* Microsoft Edge 126
69+
770
## Version 1.44
871

972
### New APIs
@@ -129,7 +192,7 @@ This version was also tested against the following stable channels:
129192
### New Locator Handler
130193

131194
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.
132-
195+
133196
```csharp
134197
// Setup the handler.
135198
await Page.AddLocatorHandlerAsync(

docs/src/release-notes-java.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,67 @@ title: "Release notes"
44
toc_max_heading_level: 2
55
---
66

7+
## Version 1.45
8+
9+
### Clock
10+
11+
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:
12+
* testing with predefined time;
13+
* keeping consistent time and timers;
14+
* monitoring inactivity;
15+
* ticking through time manually.
16+
17+
```java
18+
// Initialize clock with some time before the test time and let the page load
19+
// naturally. `Date.now` will progress as the timers fire.
20+
page.clock().install(new Clock.InstallOptions().setTime("2024-02-02T08:00:00"));
21+
page.navigate("http://localhost:3333");
22+
Locator locator = page.getByTestId("current-time");
23+
24+
// Pretend that the user closed the laptop lid and opened it again at 10am.
25+
// Pause the time once reached that point.
26+
page.clock().pauseAt("2024-02-02T10:00:00");
27+
28+
// Assert the page state.
29+
assertThat(locator).hasText("2/2/2024, 10:00:00 AM");
30+
31+
// Close the laptop lid again and open it at 10:30am.
32+
page.clock().fastForward("30:00");
33+
assertThat(locator).hasText("2/2/2024, 10:30:00 AM");
34+
```
35+
36+
See [the clock guide](./clock.md) for more details.
37+
38+
### Miscellaneous
39+
40+
- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `<input type=file webkitdirectory>` elements.
41+
```java
42+
page.getByLabel("Upload directory").setInputFiles(Paths.get("mydir"));
43+
```
44+
45+
- 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.
46+
```java
47+
// Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
48+
page.keyboard.press("ControlOrMeta+S");
49+
```
50+
51+
- 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`.
52+
53+
- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
54+
55+
- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.
56+
57+
### Browser Versions
58+
59+
* Chromium 127.0.6533.5
60+
* Mozilla Firefox 127.0
61+
* WebKit 17.4
62+
63+
This version was also tested against the following stable channels:
64+
65+
* Google Chrome 126
66+
* Microsoft Edge 126
67+
768
## Version 1.44
869

970
### New APIs
@@ -201,7 +262,7 @@ Learn more about the fixtures in our [JUnit guide](./junit.md).
201262
### New Locator Handler
202263

203264
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.
204-
265+
205266
```java
206267
// Setup the handler.
207268
page.addLocatorHandler(

docs/src/release-notes-python.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,66 @@ title: "Release notes"
44
toc_max_heading_level: 2
55
---
66

7+
## Version 1.45
8+
9+
### Clock
10+
11+
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:
12+
* testing with predefined time;
13+
* keeping consistent time and timers;
14+
* monitoring inactivity;
15+
* ticking through time manually.
16+
17+
```python
18+
# Initialize clock with some time before the test time and let the page load
19+
# naturally. `Date.now` will progress as the timers fire.
20+
page.clock.install(time=datetime.datetime(2024, 2, 2, 8, 0, 0))
21+
page.goto("http://localhost:3333")
22+
23+
# Pretend that the user closed the laptop lid and opened it again at 10am.
24+
# Pause the time once reached that point.
25+
page.clock.pause_at(datetime.datetime(2024, 2, 2, 10, 0, 0))
26+
27+
# Assert the page state.
28+
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")
29+
30+
# Close the laptop lid again and open it at 10:30am.
31+
page.clock.fast_forward("30:00")
32+
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")
33+
```
34+
35+
See [the clock guide](./clock.md) for more details.
36+
37+
### Miscellaneous
38+
39+
- Method [`method: Locator.setInputFiles`] now supports uploading a directory for `<input type=file webkitdirectory>` elements.
40+
```python
41+
page.get_by_label("Upload directory").set_input_files('mydir')
42+
```
43+
44+
- 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.
45+
```python
46+
# Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
47+
page.keyboard.press("ControlOrMeta+S")
48+
```
49+
50+
- 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`.
51+
52+
- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
53+
54+
- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.
55+
56+
### Browser Versions
57+
58+
* Chromium 127.0.6533.5
59+
* Mozilla Firefox 127.0
60+
* WebKit 17.4
61+
62+
This version was also tested against the following stable channels:
63+
64+
* Google Chrome 126
65+
* Microsoft Edge 126
66+
767
## Version 1.44
868

969
### New APIs
@@ -109,7 +169,7 @@ This version was also tested against the following stable channels:
109169
### New Locator Handler
110170

111171
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.
112-
172+
113173
```python
114174
# Setup the handler.
115175
page.add_locator_handler(

0 commit comments

Comments
 (0)