You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/release-notes-js.md
+8-6
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,15 @@ import LiteYouTube from '@site/src/components/LiteYouTube';
13
13
- 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:
14
14
```js
15
15
// Setup the handler.
16
-
awaitpage.addLocatorHandler(page.getByRole('button', { name:'Accept all cookies' }), async () => {
17
-
awaitpage.getByRole('button', { name:'Reject all cookies' }).click();
18
-
});
19
-
16
+
awaitpage.addLocatorHandler(
17
+
page.getByRole('heading', { name:'Hej! You are in control of your cookies.' }),
awaitpage.getByRole('link', { name:'Collection of blue and white' }).click();
24
+
awaitexpect(page.getByRole('heading', { name:'Light and easy' })).toBeVisible();
23
25
```
24
26
25
27
-`expect(callback).toPass()` timeout can now be configured by `expect.toPass.timeout` option [globally](./api/class-testconfig#test-config-expect) or in [project config](./api/class-testproject#test-project-expect)
0 commit comments