cherry-pick(#29825): docs: add release-notes for language bindings (#29830)

This PR cherry-picks the following commits:

- 502d21e96a
- b3edb2a130

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Playwright Service 2024-03-06 01:51:20 -08:00 committed by GitHub
parent f822d650b2
commit 1a80286a4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 180 additions and 66 deletions

View file

@ -256,7 +256,7 @@ existing authentication state instead.
Playwright provides a way to reuse the signed-in state in the tests. That way you can log Playwright provides a way to reuse the signed-in state in the tests. That way you can log
in only once and then skip the log in step for all of the tests. in only once and then skip the log in step for all of the tests.
Web apps use cookie-based or token-based authentication, where authenticated state is stored as [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) or in [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage). Playwright provides [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state) method that can be used to retrieve storage state from authenticated contexts and then create new contexts with pre-populated state. Web apps use cookie-based or token-based authentication, where authenticated state is stored as [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) or in [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage). Playwright provides [`method: BrowserContext.storageState`] method that can be used to retrieve storage state from authenticated contexts and then create new contexts with pre-populated state.
Cookies and local storage state can be used across different browsers. They depend on your application's authentication model: some apps might require both cookies and local storage. Cookies and local storage state can be used across different browsers. They depend on your application's authentication model: some apps might require both cookies and local storage.

View file

@ -4,6 +4,45 @@ title: "Release notes"
toc_max_heading_level: 2 toc_max_heading_level: 2
--- ---
## Version 1.42
### 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(
Page.GetByRole(AriaRole.Heading, new() { Name = "Hej! You are in control of your cookies." }),
async () =>
{
await Page.GetByRole(AriaRole.Button, new() { Name = "Accept all" }).ClickAsync();
});
// Write the test as usual.
await Page.GotoAsync("https://www.ikea.com/");
await Page.GetByRole(AriaRole.Link, new() { Name = "Collection of blue and white" }).ClickAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Light and easy" })).ToBeVisibleAsync();
```
### New APIs
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
### Announcements
* ⚠️ Ubuntu 18 is not supported anymore.
### Browser Versions
* Chromium 121.0.6167.57
* Mozilla Firefox 121.0
* WebKit 17.4
This version was also tested against the following stable channels:
* Google Chrome 120
* Microsoft Edge 120
## Version 1.41 ## Version 1.41
### New APIs ### New APIs
@ -511,7 +550,7 @@ This version was also tested against the following stable channels:
### New .runsettings file support ### New .runsettings file support
`Microsoft.Playwright.NUnit` and `Microsoft.Playwright.MSTest` will now consider the `.runsettings` file and passed settings via the CLI when running end-to-end tests. See in the [documentation](https://playwright.dev/dotnet/docs/test-runners) for a full list of supported settings. `Microsoft.Playwright.NUnit` and `Microsoft.Playwright.MSTest` will now consider the `.runsettings` file and passed settings via the CLI when running end-to-end tests. See in the [documentation](./test-runners) for a full list of supported settings.
The following does now work: The following does now work:
@ -574,7 +613,7 @@ Linux support looks like this:
### New introduction docs ### New introduction docs
We rewrote our Getting Started docs to be more end-to-end testing focused. Check them out on [playwright.dev](https://playwright.dev/dotnet/docs/intro). We rewrote our Getting Started docs to be more end-to-end testing focused. Check them out on [playwright.dev](./intro).
## Version 1.23 ## Version 1.23
@ -952,31 +991,31 @@ This version of Playwright was also tested against the following stable channels
### 🖱️ Mouse Wheel ### 🖱️ Mouse Wheel
By using [`Page.Mouse.WheelAsync`](https://playwright.dev/dotnet/docs/next/api/class-mouse#mouse-wheel) you are now able to scroll vertically or horizontally. By using [`method: Mouse.wheel`] you are now able to scroll vertically or horizontally.
### 📜 New Headers API ### 📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available: Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- [Request.AllHeadersAsync()](https://playwright.dev/dotnet/docs/next/api/class-request#request-all-headers) - [`method: Request.allHeaders`]
- [Request.HeadersArrayAsync()](https://playwright.dev/dotnet/docs/next/api/class-request#request-headers-array) - [`method: Request.headersArray`]
- [Request.HeaderValueAsync(name: string)](https://playwright.dev/dotnet/docs/next/api/class-request#request-header-value) - [`method: Request.headerValue`]
- [Response.AllHeadersAsync()](https://playwright.dev/dotnet/docs/next/api/class-response#response-all-headers) - [`method: Response.allHeaders`]
- [Response.HeadersArrayAsync()](https://playwright.dev/dotnet/docs/next/api/class-response#response-headers-array) - [`method: Response.headersArray`]
- [Response.HeaderValueAsync(name: string)](https://playwright.dev/dotnet/docs/next/api/class-response#response-header-value) - [`method: Response.headerValue`]
- [Response.HeaderValuesAsync(name: string)](https://playwright.dev/dotnet/docs/next/api/class-response#response-header-values) - [`method: Response.headerValues`]
### 🌈 Forced-Colors emulation ### 🌈 Forced-Colors emulation
Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [context options](https://playwright.dev/dotnet/docs/next/api/class-browser#browser-new-context-option-forced-colors) or calling [Page.EmulateMediaAsync()](https://playwright.dev/dotnet/docs/next/api/class-page#page-emulate-media). Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [`method: Browser.newContext`] or calling [`method: Page.emulateMedia`].
### New APIs ### New APIs
- [Page.RouteAsync()](https://playwright.dev/dotnet/docs/next/api/class-page#page-route) accepts new `times` option to specify how many times this route should be matched. - [`method: Page.route`] accepts new `times` option to specify how many times this route should be matched.
- [Page.SetCheckedAsync(selector: string, checked: Boolean)](https://playwright.dev/dotnet/docs/next/api/class-page#page-set-checked) and [Locator.SetCheckedAsync(selector: string, checked: Boolean)](https://playwright.dev/dotnet/docs/next/api/class-locator#locator-set-checked) was introduced to set the checked state of a checkbox. - [`method: Page.setChecked`] and [`method: Locator.setChecked`] were introduced to set the checked state of a checkbox.
- [Request.SizesAsync()](https://playwright.dev/dotnet/docs/next/api/class-request#request-sizes) Returns resource size information for given http request. - [`method: Request.sizes`] Returns resource size information for given http request.
- [Tracing.StartChunkAsync()](https://playwright.dev/dotnet/docs/next/api/class-tracing#tracing-start-chunk) - Start a new trace chunk. - [`method: Tracing.startChunk`] - Start a new trace chunk.
- [Tracing.StopChunkAsync()](https://playwright.dev/dotnet/docs/next/api/class-tracing#tracing-stop-chunk) - Stops a new trace chunk. - [`method: Tracing.stopChunk`] - Stops a new trace chunk.
### Important ⚠ ### Important ⚠
* ⬆ .NET Core Apps 2.1 are **no longer** supported for our CLI tooling. As of August 31st, 2021, .NET Core 2.1 is no [longer supported](https://devblogs.microsoft.com/dotnet/net-core-2-1-will-reach-end-of-support-on-august-21-2021/) and will not receive any security updates. We've decided to move the CLI forward and require .NET Core 3.1 as a minimum. * ⬆ .NET Core Apps 2.1 are **no longer** supported for our CLI tooling. As of August 31st, 2021, .NET Core 2.1 is no [longer supported](https://devblogs.microsoft.com/dotnet/net-core-2-1-will-reach-end-of-support-on-august-21-2021/) and will not receive any security updates. We've decided to move the CLI forward and require .NET Core 3.1 as a minimum.

View file

@ -4,6 +4,44 @@ title: "Release notes"
toc_max_heading_level: 2 toc_max_heading_level: 2
--- ---
## Version 1.42
### 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(
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Hej! You are in control of your cookies.")),
() - > {
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Accept all")).click();
});
// Write the test as usual.
page.navigate("https://www.ikea.com/");
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Collection of blue and white")).click();
assertThat(page.getByRole(AriaRole.HEADING, new Page.GetByRoleOptions().setName("Light and easy"))).isVisible();
```
### New APIs
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
### Announcements
* ⚠️ Ubuntu 18 is not supported anymore.
### Browser Versions
* Chromium 121.0.6167.57
* Mozilla Firefox 121.0
* WebKit 17.4
This version was also tested against the following stable channels:
* Google Chrome 120
* Microsoft Edge 120
## Version 1.41 ## Version 1.41
### New APIs ### New APIs
@ -931,31 +969,31 @@ This version of Playwright was also tested against the following stable channels
### 🖱️ Mouse Wheel ### 🖱️ Mouse Wheel
By using [`Mouse.wheel`](https://playwright.dev/java/docs/api/class-mouse#mouse-wheel) you are now able to scroll vertically or horizontally. By using [`method: Mouse.wheel`] you are now able to scroll vertically or horizontally.
### 📜 New Headers API ### 📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available: Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- [Request.allHeaders()](https://playwright.dev/java/docs/api/class-request#request-all-headers) - [`method: Request.allHeaders`]
- [Request.headersArray()](https://playwright.dev/java/docs/api/class-request#request-headers-array) - [`method: Request.headersArray`]
- [Request.headerValue(name: string)](https://playwright.dev/java/docs/api/class-request#request-header-value) - [`method: Request.headerValue`]
- [Response.allHeaders()](https://playwright.dev/java/docs/api/class-response#response-all-headers) - [`method: Response.allHeaders`]
- [Response.headersArray()](https://playwright.dev/java/docs/api/class-response#response-headers-array) - [`method: Response.headersArray`]
- [Response.headerValue(name: string)](https://playwright.dev/java/docs/api/class-response#response-header-value) - [`method: Response.headerValue`]
- [Response.headerValues(name: string)](https://playwright.dev/java/docs/api/class-response#response-header-values) - [`method: Response.headerValues`]
### 🌈 Forced-Colors emulation ### 🌈 Forced-Colors emulation
Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [context options](https://playwright.dev/java/docs/api/class-browser#browser-new-context-option-color-scheme) or calling [Page.emulateMedia()](https://playwright.dev/java/docs/api/class-page#page-emulate-media). Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [`method: Browser.newContext`] or calling [`method: Page.emulateMedia`].
### New APIs ### New APIs
- [Page.route()](https://playwright.dev/java/docs/api/class-page#page-route) accepts new `times` option to specify how many times this route should be matched. - [`method: Page.route`] accepts new `times` option to specify how many times this route should be matched.
- [Page.setChecked(selector: string, checked: boolean)](https://playwright.dev/java/docs/api/class-page#page-set-checked) and [Locator.setChecked(selector: string, checked: boolean)](https://playwright.dev/java/docs/api/class-locator#locator-set-checked) was introduced to set the checked state of a checkbox. - [`method: Page.setChecked`] and [`method: Locator.setChecked`] were introduced to set the checked state of a checkbox.
- [Request.sizes()](https://playwright.dev/java/docs/api/class-request#request-sizes) Returns resource size information for given http request. - [`method: Request.sizes`] Returns resource size information for given http request.
- [Tracing.startChunk()](https://playwright.dev/java/docs/api/class-tracing#tracing-start-chunk) - Start a new trace chunk. - [`method: Tracing.startChunk`] - Start a new trace chunk.
- [Tracing.stopChunk()](https://playwright.dev/java/docs/api/class-tracing#tracing-stop-chunk) - Stops a new trace chunk. - [`method: Tracing.stopChunk`] - Stops a new trace chunk.
### Browser Versions ### Browser Versions

View file

@ -1978,31 +1978,31 @@ This version of Playwright was also tested against the following stable channels
#### 🖱️ Mouse Wheel #### 🖱️ Mouse Wheel
By using [`Page.mouse.wheel`](https://playwright.dev/docs/api/class-mouse#mouse-wheel) you are now able to scroll vertically or horizontally. By using [`method: Mouse.wheel`] you are now able to scroll vertically or horizontally.
#### 📜 New Headers API #### 📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available: Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- [Request.allHeaders()](https://playwright.dev/docs/api/class-request#request-all-headers) - [`method: Request.allHeaders`]
- [Request.headersArray()](https://playwright.dev/docs/api/class-request#request-headers-array) - [`method: Request.headersArray`]
- [Request.headerValue(name: string)](https://playwright.dev/docs/api/class-request#request-header-value) - [`method: Request.headerValue`]
- [Response.allHeaders()](https://playwright.dev/docs/api/class-response#response-all-headers) - [`method: Response.allHeaders`]
- [Response.headersArray()](https://playwright.dev/docs/api/class-response#response-headers-array) - [`method: Response.headersArray`]
- [Response.headerValue(name: string)](https://playwright.dev/docs/api/class-response#response-header-value) - [`method: Response.headerValue`]
- [Response.headerValues(name: string)](https://playwright.dev/docs/api/class-response#response-header-values) - [`method: Response.headerValues`]
#### 🌈 Forced-Colors emulation #### 🌈 Forced-Colors emulation
Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [context options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-forced-colors) or calling [Page.emulateMedia()](https://playwright.dev/docs/api/class-page#page-emulate-media). Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [`method: Browser.newContext`] or calling [`method: Page.emulateMedia`].
#### New APIs #### New APIs
- [Page.route()](https://playwright.dev/docs/api/class-page#page-route) accepts new `times` option to specify how many times this route should be matched. - [`method: Page.route`] accepts new `times` option to specify how many times this route should be matched.
- [Page.setChecked(selector: string, checked: boolean)](https://playwright.dev/docs/api/class-page#page-set-checked) and [Locator.setChecked(selector: string, checked: boolean)](https://playwright.dev/docs/api/class-locator#locator-set-checked) was introduced to set the checked state of a checkbox. - [`method: Page.setChecked`] and [`method: Locator.setChecked`] were introduced to set the checked state of a checkbox.
- [Request.sizes()](https://playwright.dev/docs/api/class-request#request-sizes) Returns resource size information for given http request. - [`method: Request.sizes`] Returns resource size information for given http request.
- [BrowserContext.tracing.startChunk()](https://playwright.dev/docs/api/class-tracing#tracing-start-chunk) - Start a new trace chunk. - [`method: Tracing.startChunk`] - Start a new trace chunk.
- [BrowserContext.tracing.stopChunk()](https://playwright.dev/docs/api/class-tracing#tracing-stop-chunk) - Stops a new trace chunk. - [`method: Tracing.stopChunk`] - Stops a new trace chunk.
### 🎭 Playwright Test ### 🎭 Playwright Test
@ -2017,11 +2017,11 @@ test.describe.parallel('group', () => {
}); });
``` ```
By default, tests in a single file are run in order. If you have many independent tests in a single file, you can now run them in parallel with [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). By default, tests in a single file are run in order. If you have many independent tests in a single file, you can now run them in parallel with [test.describe.parallel(title, callback)](./api/class-test#test-describe-parallel).
#### 🛠 Add `--debug` CLI flag #### 🛠 Add `--debug` CLI flag
By using `npx playwright test --debug` it will enable the [Playwright Inspector](https://playwright.dev/docs/debug#playwright-inspector) for you to debug your tests. By using `npx playwright test --debug` it will enable the [Playwright Inspector](./debug#playwright-inspector) for you to debug your tests.
### Browser Versions ### Browser Versions

View file

@ -4,6 +4,43 @@ title: "Release notes"
toc_max_heading_level: 2 toc_max_heading_level: 2
--- ---
## Version 1.42
### 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(
page.get_by_role("heading", name="Hej! You are in control of your cookies."),
lambda: page.get_by_role("button", name="Accept all").click(),
)
# Write the test as usual.
page.goto("https://www.ikea.com/")
page.get_by_role("link", name="Collection of blue and white").click()
expect(page.get_by_role("heading", name="Light and easy")).to_be_visible()
```
### New APIs
- [`method: Page.pdf`] accepts two new options [`option: tagged`] and [`option: outline`].
### Announcements
* ⚠️ Ubuntu 18 is not supported anymore.
### Browser Versions
* Chromium 121.0.6167.57
* Mozilla Firefox 121.0
* WebKit 17.4
This version was also tested against the following stable channels:
* Google Chrome 120
* Microsoft Edge 120
## Version 1.41 ## Version 1.41
### New APIs ### New APIs
@ -1003,31 +1040,31 @@ This version of Playwright was also tested against the following stable channels
### 🖱️ Mouse Wheel ### 🖱️ Mouse Wheel
By using [`Page.mouse.wheel`](https://playwright.dev/python/docs/api/class-mouse#mouse-wheel) you are now able to scroll vertically or horizontally. By using [`method: Mouse.wheel`] you are now able to scroll vertically or horizontally.
### 📜 New Headers API ### 📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available: Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- [Request.all_headers()](https://playwright.dev/python/docs/api/class-request#request-all-headers) - [`method: Request.allHeaders`]
- [Request.headers_array()](https://playwright.dev/python/docs/api/class-request#request-headers-array) - [`method: Request.headersArray`]
- [Request.header_value(name: str)](https://playwright.dev/python/docs/api/class-request#request-header-value) - [`method: Request.headerValue`]
- [Response.all_headers()](https://playwright.dev/python/docs/api/class-response#response-all-headers) - [`method: Response.allHeaders`]
- [Response.headers_array()](https://playwright.dev/python/docs/api/class-response#response-headers-array) - [`method: Response.headersArray`]
- [Response.header_value(name: str)](https://playwright.dev/python/docs/api/class-response#response-header-value) - [`method: Response.headerValue`]
- [Response.header_values(name: str)](https://playwright.dev/python/docs/api/class-response#response-header-values) - [`method: Response.headerValues`]
### 🌈 Forced-Colors emulation ### 🌈 Forced-Colors emulation
Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [context options](https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-forced-colors) or calling [Page.emulate_media()](https://playwright.dev/python/docs/api/class-page#page-emulate-media). Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [`method: Browser.newContext`] or calling [`method: Page.emulateMedia`].
### New APIs ### New APIs
- [Page.route()](https://playwright.dev/python/docs/api/class-page#page-route) accepts new `times` option to specify how many times this route should be matched. - [`method: Page.route`] accepts new `times` option to specify how many times this route should be matched.
- [Page.set_checked(selector: str, checked: bool)](https://playwright.dev/python/docs/api/class-page#page-set-checked) and [Locator.set_checked(selector: str, checked: bool)](https://playwright.dev/python/docs/api/class-locator#locator-set-checked) was introduced to set the checked state of a checkbox. - [`method: Page.setChecked`] and [`method: Locator.setChecked`] were introduced to set the checked state of a checkbox.
- [Request.sizes()](https://playwright.dev/python/docs/api/class-request#request-sizes) Returns resource size information for given http request. - [`method: Request.sizes`] Returns resource size information for given http request.
- [BrowserContext.tracing.start_chunk()](https://playwright.dev/python/docs/api/class-tracing#tracing-start-chunk) - Start a new trace chunk. - [`method: Tracing.startChunk`] - Start a new trace chunk.
- [BrowserContext.tracing.stop_chunk()](https://playwright.dev/python/docs/api/class-tracing#tracing-stop-chunk) - Stops a new trace chunk. - [`method: Tracing.stopChunk`] - Stops a new trace chunk.
### Browser Versions ### Browser Versions

View file

@ -53,14 +53,14 @@ def test_my_app_is_working(fixture_name):
**Function scope**: These fixtures are created when requested in a test function and destroyed when the test ends. **Function scope**: These fixtures are created when requested in a test function and destroyed when the test ends.
- `context`: New [browser context](https://playwright.dev/python/docs/browser-contexts) for a test. - `context`: New [browser context](./browser-contexts) for a test.
- `page`: New [browser page](https://playwright.dev/python/docs/pages) for a test. - `page`: New [browser page](./pages) for a test.
**Session scope**: These fixtures are created when requested in a test function and destroyed when all tests end. **Session scope**: These fixtures are created when requested in a test function and destroyed when all tests end.
- `playwright`: [Playwright](https://playwright.dev/python/docs/api/class-playwright) instance. - `playwright`: [Playwright](./api/class-playwright) instance.
- `browser_type`: [BrowserType](https://playwright.dev/python/docs/api/class-browsertype) instance of the current browser. - `browser_type`: [BrowserType](./api/class-browsertype) instance of the current browser.
- `browser`: [Browser](https://playwright.dev/python/docs/api/class-browser) instance launched by Playwright. - `browser`: [Browser](./api/class-browser) instance launched by Playwright.
- `browser_name`: Browser name as string. - `browser_name`: Browser name as string.
- `browser_channel`: Browser channel as string. - `browser_channel`: Browser channel as string.
- `is_chromium`, `is_webkit`, `is_firefox`: Booleans for the respective browser types. - `is_chromium`, `is_webkit`, `is_firefox`: Booleans for the respective browser types.