Compare commits

...

6 commits

Author SHA1 Message Date
Yury Semikhatsky 00895e36d4
cherry-pick(#19532): docs: remove Serializable from Route.*.postData in java (#19533) 2022-12-16 11:21:51 -08:00
Yury Semikhatsky 0cf3ec2e64
cherry-pick(#19527): docs: route.fetch.postData in java (#19528) 2022-12-16 10:16:40 -08:00
Andrey Lushnikov 5c3be309df
chore: mark 1.29.0 (#19491) 2022-12-16 09:49:56 -08:00
Andrey Lushnikov a100191ec9 cherry-pick(#19497): chore: release notes 1.29
Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-12-16 09:48:53 -08:00
Playwright Service 4b871153d0
chery-pick(#19509): docs: fix locator all since version (#19521)
This PR cherry-picks the following commits:

- 1e31afd9d7
2022-12-16 18:19:51 +01:00
Playwright Service 8a9692e2c5
chery-pick(#19507): docs: fix HTML snippets (#19508)
This PR cherry-picks the following commits:

- ba8a6c4b08
2022-12-16 18:19:35 +01:00
18 changed files with 166 additions and 73 deletions

View file

@ -7,7 +7,7 @@ a way to find element(s) on the page at any moment. Locator can be created with
[Learn more about locators](../locators.md).
## async method: Locator.all
* since: v1.14
* since: v1.29
- returns: <[Array]<[Locator]>>
When locator points to a list of elements, returns array of locators, pointing

View file

@ -114,11 +114,18 @@ If set changes the request method (e.g. GET or POST).
### option: Route.continue.postData
* since: v1.8
* langs: js, python, java
* langs: js, python
- `postData` <[string]|[Buffer]|[Serializable]>
If set changes the post data of request.
### option: Route.continue.postData
* since: v1.8
* langs: java
- `postData` <[string]|[Buffer]>
If set changes the post data of request.
### option: Route.continue.postData
* since: v1.8
* langs: csharp
@ -390,11 +397,18 @@ If set changes the request method (e.g. GET or POST).
### option: Route.fallback.postData
* since: v1.23
* langs: js, python, java
* langs: js, python
- `postData` <[string]|[Buffer]|[Serializable]>
If set changes the post data of request.
### option: Route.fallback.postData
* since: v1.23
* langs: java
- `postData` <[string]|[Buffer]>
If set changes the post data of request.
### option: Route.fallback.postData
* since: v1.23
* langs: csharp
@ -480,8 +494,21 @@ If set changes the request URL. New URL must have same protocol as original one.
If set changes the request method (e.g. GET or POST).
### option: Route.fetch.postData = %%-js-python-csharp-fetch-option-post-data-%%
### option: Route.fetch.postData
* langs: js, python
* since: v1.29
- `postData` <[string]|[Buffer]|[Serializable]>
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be
set to `application/octet-stream` if not explicitly set.
### option: Route.fetch.postData
* langs: java
* since: v1.29
- `postData` <[string]|[Buffer]>
If set changes the post data of request.
### option: Route.fetch.postData
* since: v1.29

View file

@ -389,14 +389,6 @@ Allows to set post data of the request. If the data parameter is an object, it w
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be
set to `application/octet-stream` if not explicitly set.
## js-python-csharp-fetch-option-post-data
* langs: js, python, csharp
- `postData` <[string]|[Buffer]|[Serializable]>
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be
set to `application/octet-stream` if not explicitly set.
## js-python-csharp-fetch-option-ignorehttpserrors
* langs: js, python, csharp
- `ignoreHTTPSErrors` <[boolean]>

View file

@ -815,7 +815,7 @@ Consider the following DOM structure where we want to click on the buy button of
<h3>Product 2</h3>
<button>Add to cart</button>
</li>
<ul>
</ul>
```
### Filter by text
@ -854,7 +854,7 @@ page.get_by_role("listitem").filter(has_text="Product 2").get_by_role(
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() { HasText = "Product 2" })
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```
@ -893,7 +893,7 @@ page.get_by_role("listitem").filter(has_text=re.compile("Product 2")).get_by_rol
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() { HasTextRegex = new Regex("Product 2") })
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```
@ -948,11 +948,11 @@ page.get_by_role("listitem").filter(
await page
.GetByRole(AriaRole.Listitem)
.Filter(new() {
Has = page.GetByRole(AriaRole.Heading, new () {
Has = page.GetByRole(AriaRole.Heading, new() {
Name = "Product 2"
})
})
.GetByRole(AriaRole.Button, new () { Name = "Add to cart" })
.GetByRole(AriaRole.Button, new() { Name = "Add to cart" })
.ClickAsync();
```
@ -992,7 +992,7 @@ expect(
await Expect(page
.GetByRole(AriaRole.Listitem)
.Filter(new() {
Has = page.GetByRole(AriaRole.Heading, new () { Name = "Product 2" })
Has = page.GetByRole(AriaRole.Heading, new() { Name = "Product 2" })
})
.toHaveCountAsync(1);
```

View file

@ -4,6 +4,80 @@ title: "Release notes"
toc_max_heading_level: 2
---
## Version 1.29
### New APIs
- New method [`method: Route.fetch`] and new option `json` for [`method: Route.fulfill`]:
```js
await page.route('**/api/settings', async route => {
// Fetch original settings.
const response = await route.fetch();
// Force settings theme to a predefined value.
const json = await response.json();
json.theme = 'Solorized';
// Fulfill with modified data.
await route.fulfill({ json });
});
```
- New method [`method: Locator.all`] to iterate over all matching elements:
```js
// Check all checkboxes!
const checkboxes = page.getByRole('checkbox');
for (const checkbox of await checkboxes.all())
await checkbox.check();
```
- Retry blocks of code until all assertions pass:
```js
await expect(async () => {
const response = await page.request.get('https://api.example.com');
await expect(response).toBeOK();
}).toPass();
```
Read more in [our documentation](./test-assertions.md#retrying).
- Automatically capture **full page screenshot** on test failure:
```js
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
use: {
screenshot: {
mode: 'only-on-failure',
fullPage: true,
}
}
};
export default config;
```
### Miscellaneous
- Playwright Test now respects [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig).
- New options `args` and `proxy` for [`method: AndroidDevice.launchBrowser`].
- Option `postData` in method [`method: Route.continue`] now supports [serializable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#description) values.
### Browser Versions
* Chromium 109.0.5414.46
* Mozilla Firefox 107.0
* WebKit 16.4
This version was also tested against the following stable channels:
* Google Chrome 108
* Microsoft Edge 108
## Version 1.28
<div className="embed-youtube">

66
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "playwright-internal",
"version": "1.29.0-next",
"version": "1.29.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playwright-internal",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"workspaces": [
"packages/*"
@ -5886,11 +5886,11 @@
"version": "0.0.0"
},
"packages/playwright": {
"version": "1.29.0-next",
"version": "1.29.0",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
},
"bin": {
"playwright": "cli.js"
@ -5900,11 +5900,11 @@
}
},
"packages/playwright-chromium": {
"version": "1.29.0-next",
"version": "1.29.0",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
},
"bin": {
"playwright": "cli.js"
@ -5914,7 +5914,7 @@
}
},
"packages/playwright-core": {
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"bin": {
"playwright": "cli.js"
@ -5925,10 +5925,10 @@
},
"packages/playwright-ct-react": {
"name": "@playwright/experimental-ct-react",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.1"
},
@ -5965,10 +5965,10 @@
},
"packages/playwright-ct-solid": {
"name": "@playwright/experimental-ct-solid",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"vite": "^3.2.1",
"vite-plugin-solid": "^2.3.10"
},
@ -5981,10 +5981,10 @@
},
"packages/playwright-ct-svelte": {
"name": "@playwright/experimental-ct-svelte",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@sveltejs/vite-plugin-svelte": "^1.1.0",
"vite": "^3.2.1"
},
@ -5997,10 +5997,10 @@
},
"packages/playwright-ct-vue": {
"name": "@playwright/experimental-ct-vue",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-vue": "^3.2.0",
"vite": "^3.2.1"
},
@ -6046,10 +6046,10 @@
},
"packages/playwright-ct-vue2": {
"name": "@playwright/experimental-ct-vue2",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-vue2": "^2.0.0",
"vite": "^3.2.1"
},
@ -6061,11 +6061,11 @@
}
},
"packages/playwright-firefox": {
"version": "1.29.0-next",
"version": "1.29.0",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
},
"bin": {
"playwright": "cli.js"
@ -6076,11 +6076,11 @@
},
"packages/playwright-test": {
"name": "@playwright/test",
"version": "1.29.0-next",
"version": "1.29.0",
"license": "Apache-2.0",
"dependencies": {
"@types/node": "*",
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
},
"bin": {
"playwright": "cli.js"
@ -6090,11 +6090,11 @@
}
},
"packages/playwright-webkit": {
"version": "1.29.0-next",
"version": "1.29.0",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
},
"bin": {
"playwright": "cli.js"
@ -6698,7 +6698,7 @@
"@playwright/experimental-ct-react": {
"version": "file:packages/playwright-ct-react",
"requires": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.1"
},
@ -6725,7 +6725,7 @@
"@playwright/experimental-ct-solid": {
"version": "file:packages/playwright-ct-solid",
"requires": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"solid-js": "^1.4.7",
"vite": "^3.2.1",
"vite-plugin-solid": "^2.3.10"
@ -6734,7 +6734,7 @@
"@playwright/experimental-ct-svelte": {
"version": "file:packages/playwright-ct-svelte",
"requires": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@sveltejs/vite-plugin-svelte": "^1.1.0",
"svelte": "^3.49.0",
"vite": "^3.2.1"
@ -6743,7 +6743,7 @@
"@playwright/experimental-ct-vue": {
"version": "file:packages/playwright-ct-vue",
"requires": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-vue": "^3.2.0",
"vite": "^3.2.1"
},
@ -6778,7 +6778,7 @@
"@playwright/experimental-ct-vue2": {
"version": "file:packages/playwright-ct-vue2",
"requires": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-vue2": "^2.0.0",
"vite": "^3.2.1",
"vue": "^2.7.13"
@ -6788,7 +6788,7 @@
"version": "file:packages/playwright-test",
"requires": {
"@types/node": "*",
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
},
"@rollup/pluginutils": {
@ -8899,13 +8899,13 @@
"playwright": {
"version": "file:packages/playwright",
"requires": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
},
"playwright-chromium": {
"version": "file:packages/playwright-chromium",
"requires": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
},
"playwright-core": {
@ -8914,13 +8914,13 @@
"playwright-firefox": {
"version": "file:packages/playwright-firefox",
"requires": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
},
"playwright-webkit": {
"version": "file:packages/playwright-webkit",
"requires": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
},
"postcss": {

View file

@ -1,7 +1,7 @@
{
"name": "playwright-internal",
"private": true,
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",

View file

@ -1,6 +1,6 @@
{
"name": "playwright-chromium",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate Chromium",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -28,6 +28,6 @@
"install": "node install.js"
},
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "playwright-core",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/experimental-ct-react",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "Playwright Component Testing for React",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -27,7 +27,7 @@
},
"dependencies": {
"@vitejs/plugin-react": "^2.2.0",
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"vite": "^3.2.1"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/experimental-ct-solid",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "Playwright Component Testing for Solid",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -28,7 +28,7 @@
"dependencies": {
"vite": "^3.2.1",
"vite-plugin-solid": "^2.3.10",
"@playwright/test": "1.29.0-next"
"@playwright/test": "1.29.0"
},
"devDependencies": {
"solid-js": "^1.4.7"

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/experimental-ct-svelte",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "Playwright Component Testing for Svelte",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -26,7 +26,7 @@
}
},
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@sveltejs/vite-plugin-svelte": "^1.1.0",
"vite": "^3.2.1"
},

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/experimental-ct-vue",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "Playwright Component Testing for Vue",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -27,7 +27,7 @@
},
"dependencies": {
"@vitejs/plugin-vue": "^3.2.0",
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"vite": "^3.2.1"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/experimental-ct-vue2",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "Playwright Component Testing for Vue2",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -26,7 +26,7 @@
}
},
"dependencies": {
"@playwright/test": "1.29.0-next",
"@playwright/test": "1.29.0",
"@vitejs/plugin-vue2": "^2.0.0",
"vite": "^3.2.1"
},

View file

@ -1,6 +1,6 @@
{
"name": "playwright-firefox",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate Firefox",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -28,6 +28,6 @@
"install": "node install.js"
},
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@playwright/test",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -34,6 +34,6 @@
"license": "Apache-2.0",
"dependencies": {
"@types/node": "*",
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "playwright-webkit",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate WebKit",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -28,6 +28,6 @@
"install": "node install.js"
},
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "playwright",
"version": "1.29.0-next",
"version": "1.29.0",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
@ -28,6 +28,6 @@
"install": "node install.js"
},
"dependencies": {
"playwright-core": "1.29.0-next"
"playwright-core": "1.29.0"
}
}