mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: note on locator handler trigger (#30004)
Fixes https://github.com/microsoft/playwright/issues/30003
This commit is contained in:
parent
911fd204cf
commit
da2b099b5c
@ -3156,7 +3156,7 @@ This method lets you set up a special function, called a handler, that activates
|
||||
|
||||
Things to keep in mind:
|
||||
* When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as a part of your normal test flow, instead of using [`method: Page.addLocatorHandler`].
|
||||
* Playwright checks for the overlay every time before executing or retrying an action that requires an [actionability check](../actionability.md), or before performing an auto-waiting assertion check. When overlay is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
|
||||
* Playwright checks for the overlay every time before executing or retrying an action that requires an [actionability check](../actionability.md), or before performing an auto-waiting assertion check. When overlay is visible, Playwright calls the handler first, and then proceeds with the action/assertion. Note that the handler is only called when you perform an action/assertion - if the overlay becomes visible but you don't perform any actions, the handler will not be triggered.
|
||||
* The execution time of the handler counts towards the timeout of the action/assertion that executed the handler. If your handler takes too long, it might cause timeouts.
|
||||
* You can register multiple handlers. However, only a single handler will be running at a time. Make sure the actions within a handler don't depend on another handler.
|
||||
|
||||
|
||||
4
packages/playwright-core/types/types.d.ts
vendored
4
packages/playwright-core/types/types.d.ts
vendored
@ -1796,7 +1796,9 @@ export interface Page {
|
||||
* [page.addLocatorHandler(locator, handler)](https://playwright.dev/docs/api/class-page#page-add-locator-handler).
|
||||
* - Playwright checks for the overlay every time before executing or retrying an action that requires an
|
||||
* [actionability check](https://playwright.dev/docs/actionability), or before performing an auto-waiting assertion check. When overlay
|
||||
* is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
|
||||
* is visible, Playwright calls the handler first, and then proceeds with the action/assertion. Note that the
|
||||
* handler is only called when you perform an action/assertion - if the overlay becomes visible but you don't
|
||||
* perform any actions, the handler will not be triggered.
|
||||
* - The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.
|
||||
* If your handler takes too long, it might cause timeouts.
|
||||
* - You can register multiple handlers. However, only a single handler will be running at a time. Make sure the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user