Skip to content

Commit 757f308

Browse files
authored
docs: release notes 1.43 for js (#30128)
1 parent 021c5c1 commit 757f308

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

docs/src/release-notes-js.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,81 @@ toc_max_heading_level: 2
66

77
import LiteYouTube from '@site/src/components/LiteYouTube';
88

9+
## Version 1.43
10+
11+
### New APIs
12+
13+
- Method [`method: BrowserContext.clearCookies`] now supports filters to remove only some cookies.
14+
15+
```js
16+
// Clear all cookies.
17+
await context.clearCookies();
18+
// New: clear cookies with a particular name.
19+
await context.clearCookies({ name: 'session-id' });
20+
// New: clear cookies for a particular domain.
21+
await context.clearCookies({ domain: 'my-origin.com' });
22+
```
23+
24+
- New mode `retain-on-first-failure` for [`property: TestOptions.trace`]. In this mode, trace is recorded for the first run of each test, but not for retires. When test run fails, the trace file is retained, otherwise it is removed.
25+
26+
```js title=playwright.config.ts
27+
import { defineConfig } from '@playwright/test';
28+
29+
export default defineConfig({
30+
use: {
31+
trace: 'retain-on-first-failure',
32+
},
33+
});
34+
```
35+
36+
- New property [`property: TestInfo.tags`] exposes test tags during test execution.
37+
38+
```js
39+
test('example', async ({ page }) => {
40+
console.log(test.info().tags);
41+
});
42+
```
43+
44+
- New method [`method: Locator.contentFrame`] converts a [Locator] object to a [FrameLocator]. This can be useful when you have a [Locator] object obtained somewhere, and later on would like to interact with the content inside the frame.
45+
46+
```js
47+
const locator = page.locator('iframe[name="embedded"]');
48+
// ...
49+
const frameLocator = locator.contentFrame();
50+
await frameLocator.getByRole('button').click();
51+
```
52+
53+
- New method [`method: FrameLocator.owner`] converts a [FrameLocator] object to a [Locator]. This can be useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element.
54+
55+
```js
56+
const frameLocator = page.frameLocator('iframe[name="embedded"]');
57+
// ...
58+
const locator = frameLocator.owner();
59+
await expect(locator).toBeVisible();
60+
```
61+
62+
### UI Mode Updates
63+
64+
![Playwright UI Mode](https://github.com/microsoft/playwright/assets/9881434/61ca7cfc-eb7a-4305-8b62-b6c9f098f300)
65+
66+
* See tags in the test list.
67+
* Filter by tags by typing `@fast` or clicking on the tag itself.
68+
* New shortcuts:
69+
- "F5" to run tests.
70+
- "Shift F5" to stop running tests.
71+
- "Ctrl `" to toggle test output.
72+
73+
### Browser Versions
74+
75+
* Chromium 124.0.6367.8
76+
* Mozilla Firefox 124.0
77+
* WebKit 17.4
78+
79+
This version was also tested against the following stable channels:
80+
81+
* Google Chrome 123
82+
* Microsoft Edge 123
83+
984
## Version 1.42
1085

1186
<LiteYouTube

0 commit comments

Comments
 (0)