Skip to content

Commit 58551ad

Browse files
authored
chore(roll): roll Playwright to v1.42.1 (#2340)
1 parent f6071ee commit 58551ad

File tree

4 files changed

+51
-47
lines changed

4 files changed

+51
-47
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
44

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->122.0.6261.39<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->123.0.6312.4<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->17.4<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->122.0<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->123.0<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

playwright/async_api/_generated.py

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11669,35 +11669,37 @@ async def add_locator_handler(
1166911669
) -> None:
1167011670
"""Page.add_locator_handler
1167111671

11672-
Sometimes, the web page can show an overlay that obstructs elements behind it and prevents certain actions, like
11673-
click, from completing. When such an overlay is shown predictably, we recommend dismissing it as a part of your
11674-
test flow. However, sometimes such an overlay may appear non-deterministically, for example certain cookies consent
11675-
dialogs behave this way. In this case, `page.add_locator_handler()` allows handling an overlay during an
11676-
action that it would block.
11677-
11678-
This method registers a handler for an overlay that is executed once the locator is visible on the page. The
11679-
handler should get rid of the overlay so that actions blocked by it can proceed. This is useful for
11680-
nondeterministic interstitial pages or dialogs, like a cookie consent dialog.
11681-
11682-
Note that execution time of the handler counts towards the timeout of the action/assertion that executed the
11683-
handler.
11684-
11685-
You can register multiple handlers. However, only a single handler will be running at a time. Any actions inside a
11686-
handler must not require another handler to run.
11687-
11688-
**NOTE** Running the interceptor will alter your page state mid-test. For example it will change the currently
11689-
focused element and move the mouse. Make sure that the actions that run after the interceptor are self-contained
11690-
and do not rely on the focus and mouse state. <br /> <br /> For example, consider a test that calls
11672+
When testing a web page, sometimes unexpected overlays like a coookie consent dialog appear and block actions you
11673+
want to automate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time,
11674+
making them tricky to handle in automated tests.
11675+
11676+
This method lets you set up a special function, called a handler, that activates when it detects that overlay is
11677+
visible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there.
11678+
11679+
Things to keep in mind:
11680+
- When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as
11681+
a part of your normal test flow, instead of using `page.add_locator_handler()`.
11682+
- Playwright checks for the overlay every time before executing or retrying an action that requires an
11683+
[actionability check](https://playwright.dev/python/docs/actionability), or before performing an auto-waiting assertion check. When overlay
11684+
is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
11685+
- The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.
11686+
If your handler takes too long, it might cause timeouts.
11687+
- You can register multiple handlers. However, only a single handler will be running at a time. Make sure the
11688+
actions within a handler don't depend on another handler.
11689+
11690+
**NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused
11691+
element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on
11692+
the focus and mouse state being unchanged. <br /> <br /> For example, consider a test that calls
1169111693
`locator.focus()` followed by `keyboard.press()`. If your handler clicks a button between these two
1169211694
actions, the focused element most likely will be wrong, and key press will happen on the unexpected element. Use
1169311695
`locator.press()` instead to avoid this problem. <br /> <br /> Another example is a series of mouse
1169411696
actions, where `mouse.move()` is followed by `mouse.down()`. Again, when the handler runs between
11695-
these two actions, the mouse position will be wrong during the mouse down. Prefer methods like
11696-
`locator.click()` that are self-contained.
11697+
these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions like
11698+
`locator.click()` that do not rely on the state being unchanged by a handler.
1169711699

1169811700
**Usage**
1169911701

11700-
An example that closes a cookie dialog when it appears:
11702+
An example that closes a cookie consent dialog when it appears:
1170111703

1170211704
```py
1170311705
# Setup the handler.

playwright/sync_api/_generated.py

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11752,35 +11752,37 @@ def set_checked(
1175211752
def add_locator_handler(self, locator: "Locator", handler: typing.Callable) -> None:
1175311753
"""Page.add_locator_handler
1175411754

11755-
Sometimes, the web page can show an overlay that obstructs elements behind it and prevents certain actions, like
11756-
click, from completing. When such an overlay is shown predictably, we recommend dismissing it as a part of your
11757-
test flow. However, sometimes such an overlay may appear non-deterministically, for example certain cookies consent
11758-
dialogs behave this way. In this case, `page.add_locator_handler()` allows handling an overlay during an
11759-
action that it would block.
11760-
11761-
This method registers a handler for an overlay that is executed once the locator is visible on the page. The
11762-
handler should get rid of the overlay so that actions blocked by it can proceed. This is useful for
11763-
nondeterministic interstitial pages or dialogs, like a cookie consent dialog.
11764-
11765-
Note that execution time of the handler counts towards the timeout of the action/assertion that executed the
11766-
handler.
11767-
11768-
You can register multiple handlers. However, only a single handler will be running at a time. Any actions inside a
11769-
handler must not require another handler to run.
11770-
11771-
**NOTE** Running the interceptor will alter your page state mid-test. For example it will change the currently
11772-
focused element and move the mouse. Make sure that the actions that run after the interceptor are self-contained
11773-
and do not rely on the focus and mouse state. <br /> <br /> For example, consider a test that calls
11755+
When testing a web page, sometimes unexpected overlays like a coookie consent dialog appear and block actions you
11756+
want to automate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time,
11757+
making them tricky to handle in automated tests.
11758+
11759+
This method lets you set up a special function, called a handler, that activates when it detects that overlay is
11760+
visible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there.
11761+
11762+
Things to keep in mind:
11763+
- When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as
11764+
a part of your normal test flow, instead of using `page.add_locator_handler()`.
11765+
- Playwright checks for the overlay every time before executing or retrying an action that requires an
11766+
[actionability check](https://playwright.dev/python/docs/actionability), or before performing an auto-waiting assertion check. When overlay
11767+
is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
11768+
- The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.
11769+
If your handler takes too long, it might cause timeouts.
11770+
- You can register multiple handlers. However, only a single handler will be running at a time. Make sure the
11771+
actions within a handler don't depend on another handler.
11772+
11773+
**NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused
11774+
element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on
11775+
the focus and mouse state being unchanged. <br /> <br /> For example, consider a test that calls
1177411776
`locator.focus()` followed by `keyboard.press()`. If your handler clicks a button between these two
1177511777
actions, the focused element most likely will be wrong, and key press will happen on the unexpected element. Use
1177611778
`locator.press()` instead to avoid this problem. <br /> <br /> Another example is a series of mouse
1177711779
actions, where `mouse.move()` is followed by `mouse.down()`. Again, when the handler runs between
11778-
these two actions, the mouse position will be wrong during the mouse down. Prefer methods like
11779-
`locator.click()` that are self-contained.
11780+
these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions like
11781+
`locator.click()` that do not rely on the state being unchanged by a handler.
1178011782

1178111783
**Usage**
1178211784

11783-
An example that closes a cookie dialog when it appears:
11785+
An example that closes a cookie consent dialog when it appears:
1178411786

1178511787
```py
1178611788
# Setup the handler.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
InWheel = None
3131
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
3232

33-
driver_version = "1.42.0-alpha-2024-02-19"
33+
driver_version = "1.42.1"
3434

3535

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

0 commit comments

Comments
 (0)