Skip to content

chore: roll Playwright to 1.25.0-alpha-1660067092000 #1485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->104.0.5112.81<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->105.0.5195.19<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->16.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->103.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Expand Down
72 changes: 60 additions & 12 deletions playwright/async_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def headers(self) -> typing.Dict[str, str]:
def from_service_worker(self) -> bool:
"""Response.from_service_worker

Indicates whether this Response was fullfilled by a Service Worker's Fetch Handler (i.e. via
Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via
[FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).

Returns
Expand Down Expand Up @@ -2528,7 +2528,7 @@ async def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -7995,7 +7995,7 @@ async def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -11047,7 +11047,7 @@ async def new_context(

Creates a new browser context. It won't share cookies/cache with other browser contexts.

> NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicilty close the returned
> NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned
context via `browser_context.close()` when your code is done with the `BrowserContext`, and before calling
`browser.close()`. This will ensure the `context` is closed gracefully and any artifacts—like HARs and
videos—are fully flushed and saved.
Expand Down Expand Up @@ -13317,7 +13317,7 @@ async def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -14649,14 +14649,38 @@ async def to_contain_text(
await expect(locator).to_contain_text(re.compile(r\"\\d messages\"))
```

Note that if array is passed as an expected value, entire lists of elements can be asserted:
If you pass an array as an expected value, the expectations are:
1. Locator resolves to a list of elements.
1. Elements from a **subset** of this list contain text from the expected array, respectively.
1. The matching subset of elements has the same order as the expected array.
1. Each text value from the expected array is matched by some element from the list.

For example, consider the following list:

```html
<ul>
<li>Item Text 1</li>
<li>Item Text 2</li>
<li>Item Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```py
import re
from playwright.async_api import expect

locator = page.locator(\"list > .list-item\")
await expect(locator).to_contain_text([\"Text 1\", \"Text 4\", \"Text 5\"])
# ✓ Contains the right items in the right order
await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])

# ✖ Wrong order
await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])

# ✖ No item contains this text
await expect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])

# ✖ Locator points to the outer list element, not to the list items
await expect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])
```

Parameters
Expand Down Expand Up @@ -15231,13 +15255,37 @@ async def to_have_text(
await expect(locator).to_have_text(re.compile(r\"Welcome, .*\"))
```

Note that if array is passed as an expected value, entire lists of elements can be asserted:
If you pass an array as an expected value, the expectations are:
1. Locator resolves to a list of elements.
1. The number of elements equals the number of expected values in the array.
1. Elements from the list have text matching expected array values, one by one, in order.

For example, consider the following list:

```html
<ul>
<li>Text 1</li>
<li>Text 2</li>
<li>Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```py
from playwright.async_api import expect

locator = page.locator(\"list > .component\")
await expect(locator).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
# ✓ Has the right items in the right order
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])

# ✖ Wrong order
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])

# ✖ Last item does not match
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])

# ✖ Locator points to the outer list element, not to the list items
await expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
```

Parameters
Expand Down
72 changes: 60 additions & 12 deletions playwright/sync_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def headers(self) -> typing.Dict[str, str]:
def from_service_worker(self) -> bool:
"""Response.from_service_worker

Indicates whether this Response was fullfilled by a Service Worker's Fetch Handler (i.e. via
Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via
[FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).

Returns
Expand Down Expand Up @@ -2554,7 +2554,7 @@ def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -8031,7 +8031,7 @@ def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -11081,7 +11081,7 @@ def new_context(

Creates a new browser context. It won't share cookies/cache with other browser contexts.

> NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicilty close the returned
> NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned
context via `browser_context.close()` when your code is done with the `BrowserContext`, and before calling
`browser.close()`. This will ensure the `context` is closed gracefully and any artifacts—like HARs and
videos—are fully flushed and saved.
Expand Down Expand Up @@ -13404,7 +13404,7 @@ def screenshot(

Defaults to `"device"`.
mask : Union[List[Locator], NoneType]
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box
Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
`#FF00FF` that completely covers its bounding box.

Returns
Expand Down Expand Up @@ -14776,14 +14776,38 @@ def to_contain_text(
expect(locator).to_contain_text(re.compile(r\"\\d messages\"))
```

Note that if array is passed as an expected value, entire lists of elements can be asserted:
If you pass an array as an expected value, the expectations are:
1. Locator resolves to a list of elements.
1. Elements from a **subset** of this list contain text from the expected array, respectively.
1. The matching subset of elements has the same order as the expected array.
1. Each text value from the expected array is matched by some element from the list.

For example, consider the following list:

```html
<ul>
<li>Item Text 1</li>
<li>Item Text 2</li>
<li>Item Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```py
import re
from playwright.sync_api import expect

locator = page.locator(\"list > .list-item\")
expect(locator).to_contain_text([\"Text 1\", \"Text 4\", \"Text 5\"])
# ✓ Contains the right items in the right order
expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])

# ✖ Wrong order
expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])

# ✖ No item contains this text
expect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])

# ✖ Locator points to the outer list element, not to the list items
expect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])
```

Parameters
Expand Down Expand Up @@ -15380,13 +15404,37 @@ def to_have_text(
expect(locator).to_have_text(re.compile(r\"Welcome, .*\"))
```

Note that if array is passed as an expected value, entire lists of elements can be asserted:
If you pass an array as an expected value, the expectations are:
1. Locator resolves to a list of elements.
1. The number of elements equals the number of expected values in the array.
1. Elements from the list have text matching expected array values, one by one, in order.

For example, consider the following list:

```html
<ul>
<li>Text 1</li>
<li>Text 2</li>
<li>Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```py
from playwright.sync_api import expect

locator = page.locator(\"list > .component\")
expect(locator).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
# ✓ Has the right items in the right order
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])

# ✖ Wrong order
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])

# ✖ Last item does not match
await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])

# ✖ Locator points to the outer list element, not to the list items
await expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
```

Parameters
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
InWheel = None
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand

driver_version = "1.25.0-alpha-1659629898000"
driver_version = "1.25.0-alpha-1660067092000"


def extractall(zip: zipfile.ZipFile, path: str) -> None:
Expand Down