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/webapi/click.mustache
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,13 @@ If a fuzzy locator is given, the page will be searched for a button, link, or im
3
3
For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
4
4
For images, the "alt" attribute and inner text of any parent links are searched.
5
5
6
+
If no locator is provided, defaults to clicking the body element (`'//body'`).
7
+
6
8
The second parameter is a context (CSS or XPath locator) to narrow the search.
7
9
8
10
```js
11
+
// click body element (default)
12
+
I.click();
9
13
// simple link
10
14
I.click('Logout');
11
15
// button of form
@@ -20,6 +24,6 @@ I.click('Logout', '#nav');
20
24
I.click({css: 'nav a.login'});
21
25
```
22
26
23
-
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
27
+
@param {CodeceptJS.LocatorOrString}[locator='//body'] (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
24
28
@param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
25
29
@returns {void} automatically synchronized promise through #recorder
@@ -2640,6 +2640,33 @@ class Playwright extends Helper {
2640
2640
returnarray
2641
2641
}
2642
2642
2643
+
/**
2644
+
* Retrieves the ARIA snapshot for an element using Playwright's [`locator.ariaSnapshot`](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot).
2645
+
* This method returns a YAML representation of the accessibility tree that can be used for assertions.
2646
+
* If no locator is provided, it captures the snapshot of the entire page body.
0 commit comments