Skip to content

Commit b3ef767

Browse files
committed
DOC: Autogenerate and update documentation
1 parent 326b27c commit b3ef767

6 files changed

Lines changed: 171 additions & 93 deletions

File tree

‎docs/helpers/Appium.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ I.dontSee('#add-to-cart-btn');
256256

257257
Returns **void** automatically synchronized promise through #recorder
258258

259+
### capabilities
260+
261+
Type: CodeceptJS.HelperCapabilities
262+
259263
### checkIfAppIsInstalled
260264

261265
Returns app installation status.

‎docs/helpers/Kitesurf.md‎

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Type: [object][4]
7979
* `apiBase` **[string][3]?** Cloudflare API base URL
8080
* `input` **[string][3]?** how actions are dispatched: `cdp` (real mouse and keyboard events) or `synthetic` (DOM events).
8181
* `capabilities` **[object][4]?** browser capabilities; Kitesurf sets `{ layout: 'real', screenshot: true }`.
82-
* `xpathPolyfill` **([string][3] | [boolean][17])?** inject an XPath polyfill for browsers with incomplete XPath support. `auto` detects when it is needed.
82+
* `xpathPolyfill` **([string][3] | [boolean][18])?** inject an XPath polyfill for browsers with incomplete XPath support. `auto` detects when it is needed.
8383
* `waitForTimeout` **[number][8]?** default timeout for wait* actions, in seconds.
8484
* `waitForAction` **[number][8]?** fixed delay after each action, in milliseconds. When unset, actions wait only for the navigation they trigger.
8585
* `pollInterval` **[number][8]?** interval between checks while waiting, in milliseconds.
@@ -190,6 +190,10 @@ I.dontSee('#add-to-cart-btn');
190190

191191
Returns **void** automatically synchronized promise through #recorder
192192

193+
### capabilities
194+
195+
Type: CodeceptJS.HelperCapabilities
196+
193197
### checkOption
194198

195199
Selects a checkbox or radio button.
@@ -683,6 +687,22 @@ I.forceClick({css: 'nav a.login'});
683687
684688
Returns **void** automatically synchronized promise through #recorder
685689
690+
### grabAriaSnapshot
691+
692+
Retrieves the ARIA snapshot of the page, or of an element, built from the browser accessibility tree.
693+
The format matches Playwright's [ARIA snapshots][14].
694+
695+
```js
696+
const snapshot = await I.grabAriaSnapshot();
697+
const formSnapshot = await I.grabAriaSnapshot('#login-form');
698+
```
699+
700+
#### Parameters
701+
702+
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator. Defaults to body element.
703+
704+
Returns **[Promise][12]<[string][3]>** YAML representation of the accessibility tree
705+
686706
### grabAttributeFrom
687707
688708
Retrieves an attribute from an element located by CSS or XPath and returns it to test.
@@ -714,7 +734,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
714734
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
715735
* `attr` **[string][3]** attribute name.
716736
717-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
737+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
718738
719739
### grabCookie
720740
@@ -742,7 +762,7 @@ Resumes test execution, so **should be used inside async function with `await`**
742762
let cookies = await I.grabCookies();
743763
```
744764
745-
Returns **[Promise][12]<[Array][14]<CodeceptJS.Cookie>>** array of cookie objects.
765+
Returns **[Promise][12]<[Array][15]<CodeceptJS.Cookie>>** array of cookie objects.
746766
747767
### grabCssPropertyFrom
748768
@@ -775,7 +795,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
775795
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
776796
* `cssProperty` **[string][3]** CSS property name.
777797
778-
Returns **[Promise][12]<[Array][14]<[string][3]>>** CSS value
798+
Returns **[Promise][12]<[Array][15]<[string][3]>>** CSS value
779799
780800
### grabCurrentUrl
781801
@@ -835,7 +855,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
835855
* `locator` &#x20;
836856
* `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
837857
838-
Returns **[Promise][12]<[Array][14]<[string][3]>>** HTML code for an element
858+
Returns **[Promise][12]<[Array][15]<[string][3]>>** HTML code for an element
839859
840860
### grabNumberOfElements
841861
@@ -889,7 +909,7 @@ expect(traffics[0].response.status).to.equal(200);
889909
expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
890910
```
891911
892-
Returns **[Array][14]** recorded network traffics
912+
Returns **[Array][15]** recorded network traffics
893913
894914
### grabSource
895915
@@ -932,7 +952,7 @@ let pins = await I.grabTextFromAll('#pin li');
932952
933953
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
934954
935-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
955+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
936956
937957
### grabTitle
938958
@@ -974,7 +994,7 @@ let inputs = await I.grabValueFromAll('//form/input');
974994
975995
* `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
976996
977-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
997+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
978998
979999
### grabWebElement
9801000
@@ -1017,7 +1037,7 @@ I.pressKey(['Control', 'a']);
10171037
10181038
#### Parameters
10191039
1020-
* `key` **([string][3] | [Array][14]<[string][3]>)** a key or an array of keys to combine (modifiers first).
1040+
* `key` **([string][3] | [Array][15]<[string][3]>)** a key or an array of keys to combine (modifiers first).
10211041
10221042
Returns **void** automatically synchronized promise through #recorder
10231043
@@ -1471,7 +1491,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
14711491
#### Parameters
14721492
14731493
* `select` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
1474-
* `option` **([string][3] | [Array][14]<any>)** visible text or value of option.
1494+
* `option` **([string][3] | [Array][15]<any>)** visible text or value of option.
14751495
* `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
14761496
14771497
Returns **void** automatically synchronized promise through #recorder
@@ -1494,7 +1514,7 @@ I.setCookie([
14941514
14951515
#### Parameters
14961516
1497-
* `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
1517+
* `cookie` **(Cookie | [Array][15]<Cookie>)** a cookie object or array of cookie objects.
14981518
14991519
Returns **void** automatically synchronized promise through #recorder
15001520
@@ -1544,13 +1564,13 @@ const video = await I.stopScreencast();
15441564
15451565
* `options` **[object][4]?** `{ lastFrameDelayMs }`: how long the last frame is shown, in milliseconds (1000 by default).
15461566
1547-
Returns **[Promise][12]<([Buffer][15] | null)>** APNG data, or `null` if no frames were recorded.
1567+
Returns **[Promise][12]<([Buffer][16] | null)>** APNG data, or `null` if no frames were recorded.
15481568
15491569
### type
15501570
15511571
Types out the given text into an active field.
15521572
To slow down typing use a second parameter, to set interval between key presses.
1553-
*Note:* Should be used when [`fillField`][16] is not an option.
1573+
*Note:* Should be used when [`fillField`][17] is not an option.
15541574
15551575
```js
15561576
// passing in a string
@@ -1570,7 +1590,7 @@ I.type(secret('123456'));
15701590
15711591
* `keys` &#x20;
15721592
* `delay` **[number][8]?** (optional) delay in ms between key presses
1573-
* `key` **([string][3] | [Array][14]<[string][3]>)** or array of keys to type.
1593+
* `key` **([string][3] | [Array][15]<[string][3]>)** or array of keys to type.
15741594
15751595
Returns **void** automatically synchronized promise through #recorder
15761596
@@ -1690,7 +1710,7 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
16901710
#### Parameters
16911711
16921712
* `fn` **([string][3] | [function][11])** to be executed in browser context.
1693-
* `argsOrSec` **([Array][14]<any> | [number][8])?** (optional, `1` by default) arguments for function or seconds.
1713+
* `argsOrSec` **([Array][15]<any> | [number][8])?** (optional, `1` by default) arguments for function or seconds.
16941714
* `sec` **[number][8]?** (optional, `1` by default) time in seconds to wait
16951715
16961716
Returns **void** automatically synchronized promise through #recorder
@@ -1835,7 +1855,7 @@ Probes a `/json/version`-style URL with a short timeout, used for the courtesy-a
18351855
18361856
* `url` **[string][3]**&#x20;
18371857
1838-
Returns **[Promise][12]<[boolean][17]>** true if the URL answered.
1858+
Returns **[Promise][12]<[boolean][18]>** true if the URL answered.
18391859
18401860
### _resolveBinary
18411861
@@ -1892,10 +1912,12 @@ per run and counts directly toward real-world startup latency.
18921912
18931913
[13]: https://playwright.dev/docs/api/class-locator#locator-focus
18941914
1895-
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1915+
[14]: https://playwright.dev/docs/aria-snapshots
1916+
1917+
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
18961918
1897-
[15]: https://nodejs.org/api/buffer.html
1919+
[16]: https://nodejs.org/api/buffer.html
18981920
1899-
[16]: #fillfield
1921+
[17]: #fillfield
19001922
1901-
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1923+
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

‎docs/helpers/Obscura.md‎

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Type: [object][4]
111111
* `url` **[string][3]?** base url of website to be tested.
112112
* `headers` **[object][4]?** headers sent when connecting to the endpoint, e.g. for authenticated remote browsers.
113113
* `input` **[string][3]?** how actions are dispatched: `cdp` (real mouse and keyboard events) or `synthetic` (DOM events). `auto` picks `cdp` when the browser renders layout.
114-
* `xpathPolyfill` **([string][3] | [boolean][17])?** inject an XPath polyfill for browsers with incomplete XPath support. `auto` detects when it is needed.
115-
* `capabilities` **[object][4]?** browser capabilities (`layout`, `xpath`, `screenshot`, `innerText`) to use instead of detecting them at runtime.
114+
* `xpathPolyfill` **([string][3] | [boolean][18])?** inject an XPath polyfill for browsers with incomplete XPath support. `auto` detects when it is needed.
115+
* `capabilities` **[object][4]?** browser capabilities (`layout`, `xpath`, `screenshot`, `video`, `innerText`, `aria`) to use instead of detecting them at runtime.
116116
* `waitForTimeout` **[number][8]?** default timeout for wait* actions, in seconds.
117117
* `waitForAction` **[number][8]?** fixed delay after each action, in milliseconds. When unset, actions wait only for the navigation they trigger.
118118
* `pollInterval` **[number][8]?** interval between checks while waiting, in milliseconds.
@@ -250,6 +250,10 @@ I.dontSee('#add-to-cart-btn');
250250

251251
Returns **void** automatically synchronized promise through #recorder
252252

253+
### capabilities
254+
255+
Type: CodeceptJS.HelperCapabilities
256+
253257
### checkOption
254258

255259
Selects a checkbox or radio button.
@@ -743,6 +747,22 @@ I.forceClick({css: 'nav a.login'});
743747
744748
Returns **void** automatically synchronized promise through #recorder
745749
750+
### grabAriaSnapshot
751+
752+
Retrieves the ARIA snapshot of the page, or of an element, built from the browser accessibility tree.
753+
The format matches Playwright's [ARIA snapshots][14].
754+
755+
```js
756+
const snapshot = await I.grabAriaSnapshot();
757+
const formSnapshot = await I.grabAriaSnapshot('#login-form');
758+
```
759+
760+
#### Parameters
761+
762+
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator. Defaults to body element.
763+
764+
Returns **[Promise][12]<[string][3]>** YAML representation of the accessibility tree
765+
746766
### grabAttributeFrom
747767
748768
Retrieves an attribute from an element located by CSS or XPath and returns it to test.
@@ -774,7 +794,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
774794
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
775795
* `attr` **[string][3]** attribute name.
776796
777-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
797+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
778798
779799
### grabCookie
780800
@@ -802,7 +822,7 @@ Resumes test execution, so **should be used inside async function with `await`**
802822
let cookies = await I.grabCookies();
803823
```
804824
805-
Returns **[Promise][12]<[Array][14]<CodeceptJS.Cookie>>** array of cookie objects.
825+
Returns **[Promise][12]<[Array][15]<CodeceptJS.Cookie>>** array of cookie objects.
806826
807827
### grabCssPropertyFrom
808828
@@ -835,7 +855,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
835855
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
836856
* `cssProperty` **[string][3]** CSS property name.
837857
838-
Returns **[Promise][12]<[Array][14]<[string][3]>>** CSS value
858+
Returns **[Promise][12]<[Array][15]<[string][3]>>** CSS value
839859
840860
### grabCurrentUrl
841861
@@ -895,7 +915,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
895915
* `locator` &#x20;
896916
* `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
897917
898-
Returns **[Promise][12]<[Array][14]<[string][3]>>** HTML code for an element
918+
Returns **[Promise][12]<[Array][15]<[string][3]>>** HTML code for an element
899919
900920
### grabNumberOfElements
901921
@@ -949,7 +969,7 @@ expect(traffics[0].response.status).to.equal(200);
949969
expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
950970
```
951971
952-
Returns **[Array][14]** recorded network traffics
972+
Returns **[Array][15]** recorded network traffics
953973
954974
### grabSource
955975
@@ -992,7 +1012,7 @@ let pins = await I.grabTextFromAll('#pin li');
9921012
9931013
* `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
9941014
995-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
1015+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
9961016
9971017
### grabTitle
9981018
@@ -1034,7 +1054,7 @@ let inputs = await I.grabValueFromAll('//form/input');
10341054
10351055
* `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
10361056
1037-
Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
1057+
Returns **[Promise][12]<[Array][15]<[string][3]>>** attribute value
10381058
10391059
### grabWebElement
10401060
@@ -1077,7 +1097,7 @@ I.pressKey(['Control', 'a']);
10771097
10781098
#### Parameters
10791099
1080-
* `key` **([string][3] | [Array][14]<[string][3]>)** a key or an array of keys to combine (modifiers first).
1100+
* `key` **([string][3] | [Array][15]<[string][3]>)** a key or an array of keys to combine (modifiers first).
10811101
10821102
Returns **void** automatically synchronized promise through #recorder
10831103
@@ -1531,7 +1551,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
15311551
#### Parameters
15321552
15331553
* `select` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
1534-
* `option` **([string][3] | [Array][14]<any>)** visible text or value of option.
1554+
* `option` **([string][3] | [Array][15]<any>)** visible text or value of option.
15351555
* `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
15361556
15371557
Returns **void** automatically synchronized promise through #recorder
@@ -1554,7 +1574,7 @@ I.setCookie([
15541574
15551575
#### Parameters
15561576
1557-
* `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
1577+
* `cookie` **(Cookie | [Array][15]<Cookie>)** a cookie object or array of cookie objects.
15581578
15591579
Returns **void** automatically synchronized promise through #recorder
15601580
@@ -1604,13 +1624,13 @@ const video = await I.stopScreencast();
16041624
16051625
* `options` **[object][4]?** `{ lastFrameDelayMs }`: how long the last frame is shown, in milliseconds (1000 by default).
16061626
1607-
Returns **[Promise][12]<([Buffer][15] | null)>** APNG data, or `null` if no frames were recorded.
1627+
Returns **[Promise][12]<([Buffer][16] | null)>** APNG data, or `null` if no frames were recorded.
16081628
16091629
### type
16101630
16111631
Types out the given text into an active field.
16121632
To slow down typing use a second parameter, to set interval between key presses.
1613-
*Note:* Should be used when [`fillField`][16] is not an option.
1633+
*Note:* Should be used when [`fillField`][17] is not an option.
16141634
16151635
```js
16161636
// passing in a string
@@ -1630,7 +1650,7 @@ I.type(secret('123456'));
16301650
16311651
* `keys` &#x20;
16321652
* `delay` **[number][8]?** (optional) delay in ms between key presses
1633-
* `key` **([string][3] | [Array][14]<[string][3]>)** or array of keys to type.
1653+
* `key` **([string][3] | [Array][15]<[string][3]>)** or array of keys to type.
16341654
16351655
Returns **void** automatically synchronized promise through #recorder
16361656
@@ -1750,7 +1770,7 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
17501770
#### Parameters
17511771
17521772
* `fn` **([string][3] | [function][11])** to be executed in browser context.
1753-
* `argsOrSec` **([Array][14]<any> | [number][8])?** (optional, `1` by default) arguments for function or seconds.
1773+
* `argsOrSec` **([Array][15]<any> | [number][8])?** (optional, `1` by default) arguments for function or seconds.
17541774
* `sec` **[number][8]?** (optional, `1` by default) time in seconds to wait
17551775
17561776
Returns **void** automatically synchronized promise through #recorder
@@ -1895,7 +1915,7 @@ Probes a `/json/version`-style URL with a short timeout, used for the courtesy-a
18951915
18961916
* `url` **[string][3]**&#x20;
18971917
1898-
Returns **[Promise][12]<[boolean][17]>** true if the URL answered.
1918+
Returns **[Promise][12]<[boolean][18]>** true if the URL answered.
18991919
19001920
### _resolveBinary
19011921
@@ -1952,10 +1972,12 @@ per run and counts directly toward real-world startup latency.
19521972
19531973
[13]: https://playwright.dev/docs/api/class-locator#locator-focus
19541974
1955-
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1975+
[14]: https://playwright.dev/docs/aria-snapshots
1976+
1977+
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
19561978
1957-
[15]: https://nodejs.org/api/buffer.html
1979+
[16]: https://nodejs.org/api/buffer.html
19581980
1959-
[16]: #fillfield
1981+
[17]: #fillfield
19601982
1961-
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1983+
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

0 commit comments

Comments
 (0)