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
This applies a common definition of visibility to clicks and waitfors:
- non-empty bounding box - implies non-empty content and no display:none;
- no visibility:hidden.
Copy file name to clipboardExpand all lines: docs/api.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -947,7 +947,7 @@ Shortcut for [page.mainFrame().addStyleTag(options)](#frameaddstyletagoptions).
947
947
-`selector` <[string]> A selector to search for checkbox or radio button to check. If there are multiple elements satisfying the selector, the first will be checked.
948
948
-`options` <[Object]>
949
949
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
950
-
- displayed (for example, no `display:none`),
950
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
951
951
- is not moving (for example, waits until css transition finishes),
952
952
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
953
953
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -971,7 +971,7 @@ Shortcut for [page.mainFrame().check(selector[, options])](#framecheckselector-o
971
971
- y <[number]>
972
972
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
973
973
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
974
-
- displayed (for example, no `display:none`),
974
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
975
975
- is not moving (for example, waits until css transition finishes),
976
976
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
977
977
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -1024,7 +1024,7 @@ Browser-specific Coverage implementation, only available for Chromium atm. See [
1024
1024
- y <[number]>
1025
1025
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
1026
1026
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
1027
-
- displayed (for example, no `display:none`),
1027
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
1028
1028
- is not moving (for example, waits until css transition finishes),
1029
1029
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
1030
1030
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -1333,7 +1333,7 @@ Shortcut for [page.mainFrame().goto(url[, options])](#framegotourl-options)
1333
1333
- y <[number]>
1334
1334
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
1335
1335
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
1336
-
- displayed (for example, no `display:none`),
1336
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
1337
1337
- is not moving (for example, waits until css transition finishes),
1338
1338
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
1339
1339
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -1658,7 +1658,7 @@ Shortcut for [page.mainFrame().type(selector, text[, options])](#frametypeselect
1658
1658
-`selector` <[string]> A selector to search for uncheckbox to check. If there are multiple elements satisfying the selector, the first will be checked.
1659
1659
-`options` <[Object]>
1660
1660
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
1661
-
- displayed (for example, no `display:none`),
1661
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
1662
1662
- is not moving (for example, waits until css transition finishes),
1663
1663
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
1664
1664
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -1819,6 +1819,8 @@ return finalResponse.ok();
1819
1819
1820
1820
Wait for the `selector` to satisfy `waitFor` option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
1821
1821
1822
+
Element is considered `visible` when it has non-empty bounding box (for example, it has some content and no `display:none`) and no `visibility:hidden`. Element is considired `hidden` when it is not `visible` as defined above.
1823
+
1822
1824
This method works across navigations:
1823
1825
```js
1824
1826
const { chromium } =require('playwright'); // Or 'firefox' or 'webkit'.
@@ -2002,7 +2004,7 @@ Adds a `<link rel="stylesheet">` tag into the page with the desired url or a `<s
2002
2004
-`selector` <[string]> A selector to search for checkbox to check. If there are multiple elements satisfying the selector, the first will be checked.
2003
2005
-`options` <[Object]>
2004
2006
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2005
-
- displayed (for example, no `display:none`),
2007
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2006
2008
- is not moving (for example, waits until css transition finishes),
2007
2009
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2008
2010
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2027,7 +2029,7 @@ If there's no element matching `selector`, the method throws an error.
2027
2029
- y <[number]>
2028
2030
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2029
2031
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2030
-
- displayed (for example, no `display:none`),
2032
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2031
2033
- is not moving (for example, waits until css transition finishes),
2032
2034
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2033
2035
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2053,7 +2055,7 @@ Gets the full HTML contents of the frame, including the doctype.
2053
2055
- y <[number]>
2054
2056
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2055
2057
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2056
-
- displayed (for example, no `display:none`),
2058
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2057
2059
- is not moving (for example, waits until css transition finishes),
2058
2060
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2059
2061
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2228
2230
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2229
-
- displayed (for example, no `display:none`),
2231
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2230
2232
- is not moving (for example, waits until css transition finishes),
2231
2233
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2232
2234
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2349,7 +2351,7 @@ await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a
2349
2351
-`selector` <[string]> A selector to search for uncheckbox to check. If there are multiple elements satisfying the selector, the first will be checked.
2350
2352
-`options` <[Object]>
2351
2353
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2352
-
- displayed (for example, no `display:none`),
2354
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2353
2355
- is not moving (for example, waits until css transition finishes),
2354
2356
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2355
2357
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2593,7 +2595,7 @@ This method returns the bounding box of the element (relative to the main frame)
2593
2595
#### elementHandle.check([options])
2594
2596
-`options` <[Object]>
2595
2597
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2596
-
- displayed (for example, no `display:none`),
2598
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2597
2599
- is not moving (for example, waits until css transition finishes),
2598
2600
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2599
2601
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2613,7 +2615,7 @@ If element is not already checked, it scrolls it into view if needed, and then u
2613
2615
- y <[number]>
2614
2616
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2615
2617
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2616
-
- displayed (for example, no `display:none`),
2618
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2617
2619
- is not moving (for example, waits until css transition finishes),
2618
2620
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2619
2621
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2636,7 +2638,7 @@ If the element is detached from DOM, the method throws an error.
2636
2638
- y <[number]>
2637
2639
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2638
2640
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2639
-
- displayed (for example, no `display:none`),
2641
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2640
2642
- is not moving (for example, waits until css transition finishes),
2641
2643
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2642
2644
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
@@ -2709,7 +2711,7 @@ Returns element attribute value.
2709
2711
- y <[number]>
2710
2712
-`modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
2711
2713
-`force` <[boolean]> Whether to bypass the actionability checks. By default actions wait until the element is:
2712
-
- displayed (for example, no `display:none`),
2714
+
- displayed (for example, not empty, no `display:none`, no `visibility:hidden`),
2713
2715
- is not moving (for example, waits until css transition finishes),
2714
2716
- receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements).
2715
2717
Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`.
0 commit comments