codeceptjs 3.5.10 → 3.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/build/Appium.js +36 -36
- package/docs/build/Expect.js +33 -33
- package/docs/build/Nightmare.js +50 -50
- package/docs/build/Playwright.js +126 -122
- package/docs/build/Protractor.js +59 -59
- package/docs/build/Puppeteer.js +93 -89
- package/docs/build/TestCafe.js +48 -48
- package/docs/build/WebDriver.js +90 -92
- package/docs/helpers/Appium.md +1 -1
- package/docs/helpers/Expect.md +33 -33
- package/docs/helpers/Playwright.md +73 -35
- package/docs/helpers/Puppeteer.md +35 -24
- package/docs/helpers/WebDriver.md +26 -13
- package/docs/parallel.md +2 -2
- package/docs/plugins.md +3 -3
- package/docs/react.md +2 -1
- package/docs/vue.md +22 -0
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/lib/command/workers/runTests.js +17 -1
- package/lib/helper/Expect.js +33 -33
- package/lib/helper/Playwright.js +28 -24
- package/lib/helper/Puppeteer.js +23 -19
- package/lib/helper/WebDriver.js +15 -17
- package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
- package/lib/plugin/retryFailedStep.js +2 -2
- package/lib/plugin/tryTo.js +5 -4
- package/package.json +15 -15
- package/typings/index.d.ts +1 -1
- package/typings/promiseBasedTypes.d.ts +119 -74
- package/typings/types.d.ts +111 -143
- package/lib/helper/extras/PlaywrightReact.js +0 -9
|
@@ -44,7 +44,7 @@ Type: [object][4]
|
|
|
44
44
|
- `disableScreenshots` **[boolean][20]?** don't save screenshot on failure.
|
|
45
45
|
- `fullPageScreenshots` **[boolean][20]?** make full page screenshots on failure.
|
|
46
46
|
- `uniqueScreenshotNames` **[boolean][20]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
47
|
-
- `trace` **[boolean][20]?** record [tracing information][
|
|
47
|
+
- `trace` **[boolean][20]?** record [tracing information][24] with screenshots.
|
|
48
48
|
- `keepTraceForPassedTests` **[boolean][20]?** save trace for passed tests.
|
|
49
49
|
- `keepBrowserState` **[boolean][20]?** keep browser state between tests when `restart` is set to false.
|
|
50
50
|
- `keepCookies` **[boolean][20]?** keep cookies between tests when `restart` is set to false.
|
|
@@ -57,7 +57,7 @@ Type: [object][4]
|
|
|
57
57
|
- `userAgent` **[string][6]?** user-agent string.
|
|
58
58
|
- `manualStart` **[boolean][20]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
59
59
|
- `browser` **[string][6]?** can be changed to `firefox` when using [puppeteer-firefox][2].
|
|
60
|
-
- `chrome` **[object][4]?** pass additional [Puppeteer run options][
|
|
60
|
+
- `chrome` **[object][4]?** pass additional [Puppeteer run options][25].
|
|
61
61
|
- `highlightElement` **[boolean][20]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
62
62
|
|
|
63
63
|
|
|
@@ -211,7 +211,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
211
211
|
|
|
212
212
|
### _locateCheckable
|
|
213
213
|
|
|
214
|
-
Find a checkbox by providing human
|
|
214
|
+
Find a checkbox by providing human-readable text:
|
|
215
215
|
NOTE: Assumes the checkable element exists
|
|
216
216
|
|
|
217
217
|
```js
|
|
@@ -225,7 +225,7 @@ this.helpers['Puppeteer']._locateCheckable('I agree with terms and conditions').
|
|
|
225
225
|
|
|
226
226
|
### _locateClickable
|
|
227
227
|
|
|
228
|
-
Find a clickable element by providing human
|
|
228
|
+
Find a clickable element by providing human-readable text:
|
|
229
229
|
|
|
230
230
|
```js
|
|
231
231
|
this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
@@ -237,7 +237,7 @@ this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
|
237
237
|
|
|
238
238
|
### _locateFields
|
|
239
239
|
|
|
240
|
-
Find field elements by providing human
|
|
240
|
+
Find field elements by providing human-readable text:
|
|
241
241
|
|
|
242
242
|
```js
|
|
243
243
|
this.helpers['Puppeteer']._locateFields('Your email').then // ...
|
|
@@ -324,6 +324,8 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
324
324
|
|
|
325
325
|
### attachFile
|
|
326
326
|
|
|
327
|
+
> ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1][7], downgrade to 2.0.0 if you face it.
|
|
328
|
+
|
|
327
329
|
Attaches a file to element located by label, name, CSS or XPath
|
|
328
330
|
Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
329
331
|
File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -338,7 +340,7 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
338
340
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
339
341
|
- `pathToFile` **[string][6]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
340
342
|
|
|
341
|
-
Returns **void** automatically synchronized promise through #recorder
|
|
343
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
342
344
|
|
|
343
345
|
### blur
|
|
344
346
|
|
|
@@ -718,6 +720,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
718
720
|
|
|
719
721
|
### executeAsyncScript
|
|
720
722
|
|
|
723
|
+
Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
721
724
|
Executes async script on page.
|
|
722
725
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
723
726
|
|
|
@@ -744,10 +747,12 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
744
747
|
- `args` **...any** to be passed to function.
|
|
745
748
|
- `fn` **([string][6] | [function][12])** function to be executed in browser context.
|
|
746
749
|
|
|
747
|
-
Returns **[Promise][13]<any>** script return
|
|
750
|
+
Returns **[Promise][13]<any>** script return value
|
|
748
751
|
|
|
749
752
|
### executeScript
|
|
750
753
|
|
|
754
|
+
If a function returns a Promise, tt will wait for its resolution.
|
|
755
|
+
|
|
751
756
|
Executes sync script on a page.
|
|
752
757
|
Pass arguments to function as additional parameters.
|
|
753
758
|
Will return execution result to a test.
|
|
@@ -777,7 +782,7 @@ let date = await I.executeScript(function(el) {
|
|
|
777
782
|
- `args` **...any** to be passed to function.
|
|
778
783
|
- `fn` **([string][6] | [function][12])** function to be executed in browser context.
|
|
779
784
|
|
|
780
|
-
Returns **[Promise][13]<any>** script return
|
|
785
|
+
Returns **[Promise][13]<any>** script return value
|
|
781
786
|
|
|
782
787
|
### fillField
|
|
783
788
|
|
|
@@ -1236,7 +1241,7 @@ Returns **[Promise][13]<any>** WebElement of being used Web helper
|
|
|
1236
1241
|
Sets a directory to where save files. Allows to test file downloads.
|
|
1237
1242
|
Should be used with [FileSystem helper][16] to check that file were downloaded correctly.
|
|
1238
1243
|
|
|
1239
|
-
By default files are saved to `output/downloads`.
|
|
1244
|
+
By default, files are saved to `output/downloads`.
|
|
1240
1245
|
This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
|
|
1241
1246
|
|
|
1242
1247
|
```js
|
|
@@ -1282,9 +1287,11 @@ I.openNewTab();
|
|
|
1282
1287
|
|
|
1283
1288
|
### pressKey
|
|
1284
1289
|
|
|
1290
|
+
_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313][17]).
|
|
1291
|
+
|
|
1285
1292
|
Presses a key in the browser (on a focused element).
|
|
1286
1293
|
|
|
1287
|
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][
|
|
1294
|
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][18].
|
|
1288
1295
|
|
|
1289
1296
|
```js
|
|
1290
1297
|
I.pressKey('Backspace');
|
|
@@ -1345,7 +1352,7 @@ Some of the supported key names are:
|
|
|
1345
1352
|
|
|
1346
1353
|
- `key` **([string][6] | [Array][15]<[string][6]>)** key or array of keys to press.
|
|
1347
1354
|
|
|
1348
|
-
Returns **void** automatically synchronized promise through #
|
|
1355
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1349
1356
|
|
|
1350
1357
|
### pressKeyDown
|
|
1351
1358
|
|
|
@@ -1395,6 +1402,10 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
1395
1402
|
|
|
1396
1403
|
### resizeWindow
|
|
1397
1404
|
|
|
1405
|
+
Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
1406
|
+
Puppeteer does not control the window of a browser, so it can't adjust its real size.
|
|
1407
|
+
It also can't maximize a window.
|
|
1408
|
+
|
|
1398
1409
|
Resize the current window to provided width and height.
|
|
1399
1410
|
First parameter can be set to `maximize`.
|
|
1400
1411
|
|
|
@@ -1403,9 +1414,7 @@ First parameter can be set to `maximize`.
|
|
|
1403
1414
|
- `width` **[number][10]** width in pixels or `maximize`.
|
|
1404
1415
|
- `height` **[number][10]** height in pixels.
|
|
1405
1416
|
|
|
1406
|
-
Returns **void** automatically synchronized promise through #
|
|
1407
|
-
Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
1408
|
-
It also can't maximize a window.
|
|
1417
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1409
1418
|
|
|
1410
1419
|
### rightClick
|
|
1411
1420
|
|
|
@@ -1898,7 +1907,7 @@ I.switchToPreviousTab(2);
|
|
|
1898
1907
|
|
|
1899
1908
|
Types out the given text into an active field.
|
|
1900
1909
|
To slow down typing use a second parameter, to set interval between key presses.
|
|
1901
|
-
_Note:_ Should be used when [`fillField`][
|
|
1910
|
+
_Note:_ Should be used when [`fillField`][18] is not an option.
|
|
1902
1911
|
|
|
1903
1912
|
```js
|
|
1904
1913
|
// passing in a string
|
|
@@ -2084,9 +2093,9 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
2084
2093
|
|
|
2085
2094
|
### waitForNavigation
|
|
2086
2095
|
|
|
2087
|
-
Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
2096
|
+
Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
|
|
2088
2097
|
|
|
2089
|
-
See [
|
|
2098
|
+
See [Puppeteer's reference][23]
|
|
2090
2099
|
|
|
2091
2100
|
#### Parameters
|
|
2092
2101
|
|
|
@@ -2169,7 +2178,11 @@ I.waitForVisible('#popup');
|
|
|
2169
2178
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
2170
2179
|
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2171
2180
|
|
|
2172
|
-
Returns **void** automatically synchronized promise through #
|
|
2181
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2182
|
+
|
|
2183
|
+
|
|
2184
|
+
This action supports [React locators](https://codecept.io/react#locators)
|
|
2185
|
+
|
|
2173
2186
|
|
|
2174
2187
|
### waitInUrl
|
|
2175
2188
|
|
|
@@ -2270,9 +2283,9 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
2270
2283
|
|
|
2271
2284
|
[16]: https://codecept.io/helpers/FileSystem
|
|
2272
2285
|
|
|
2273
|
-
[17]:
|
|
2286
|
+
[17]: https://github.com/GoogleChrome/puppeteer/issues/1313
|
|
2274
2287
|
|
|
2275
|
-
[18]:
|
|
2288
|
+
[18]: #fillfield
|
|
2276
2289
|
|
|
2277
2290
|
[19]: #click
|
|
2278
2291
|
|
|
@@ -2284,8 +2297,6 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
2284
2297
|
|
|
2285
2298
|
[23]: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions
|
|
2286
2299
|
|
|
2287
|
-
[24]: https://
|
|
2288
|
-
|
|
2289
|
-
[25]: https://pptr.dev/api/puppeteer.tracing
|
|
2300
|
+
[24]: https://pptr.dev/api/puppeteer.tracing
|
|
2290
2301
|
|
|
2291
|
-
[
|
|
2302
|
+
[25]: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions
|
|
@@ -482,6 +482,8 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
482
482
|
|
|
483
483
|
### attachFile
|
|
484
484
|
|
|
485
|
+
Appium: not tested
|
|
486
|
+
|
|
485
487
|
Attaches a file to element located by label, name, CSS or XPath
|
|
486
488
|
Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
487
489
|
File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -496,7 +498,7 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
496
498
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
497
499
|
- `pathToFile` **[string][17]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
498
500
|
|
|
499
|
-
Returns **void** automatically synchronized promise through #
|
|
501
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
500
502
|
|
|
501
503
|
### blur
|
|
502
504
|
|
|
@@ -525,10 +527,11 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
525
527
|
|
|
526
528
|
### cancelPopup
|
|
527
529
|
|
|
528
|
-
Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt
|
|
530
|
+
Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
|
|
529
531
|
|
|
530
532
|
### checkOption
|
|
531
533
|
|
|
534
|
+
Appium: not tested
|
|
532
535
|
Selects a checkbox or radio button.
|
|
533
536
|
Element is located by label or name or CSS or XPath.
|
|
534
537
|
|
|
@@ -545,7 +548,7 @@ I.checkOption('agree', '//form');
|
|
|
545
548
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
546
549
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
547
550
|
|
|
548
|
-
Returns **void** automatically synchronized promise through #
|
|
551
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
549
552
|
|
|
550
553
|
### clearCookie
|
|
551
554
|
|
|
@@ -671,6 +674,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
671
674
|
|
|
672
675
|
### dontSeeCheckboxIsChecked
|
|
673
676
|
|
|
677
|
+
Appium: not tested
|
|
674
678
|
Verifies that the specified checkbox is not checked.
|
|
675
679
|
|
|
676
680
|
```js
|
|
@@ -683,7 +687,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
683
687
|
|
|
684
688
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
685
689
|
|
|
686
|
-
Returns **void** automatically synchronized promise through #
|
|
690
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
687
691
|
|
|
688
692
|
### dontSeeCookie
|
|
689
693
|
|
|
@@ -828,6 +832,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
828
832
|
|
|
829
833
|
### dragAndDrop
|
|
830
834
|
|
|
835
|
+
Appium: not tested
|
|
831
836
|
Drag an item to a destination element.
|
|
832
837
|
|
|
833
838
|
```js
|
|
@@ -839,7 +844,7 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
839
844
|
- `srcElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
840
845
|
- `destElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
841
846
|
|
|
842
|
-
Returns **void** automatically synchronized promise through #
|
|
847
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
843
848
|
|
|
844
849
|
### dragSlider
|
|
845
850
|
|
|
@@ -890,6 +895,8 @@ Returns **[Promise][25]<any>** script return value
|
|
|
890
895
|
|
|
891
896
|
### executeScript
|
|
892
897
|
|
|
898
|
+
Wraps [execute][26] command.
|
|
899
|
+
|
|
893
900
|
Executes sync script on a page.
|
|
894
901
|
Pass arguments to function as additional parameters.
|
|
895
902
|
Will return execution result to a test.
|
|
@@ -919,7 +926,7 @@ let date = await I.executeScript(function(el) {
|
|
|
919
926
|
- `args` **...any** to be passed to function.
|
|
920
927
|
- `fn` **([string][17] | [function][24])** function to be executed in browser context.
|
|
921
928
|
|
|
922
|
-
Returns **[Promise][25]<any>** script return
|
|
929
|
+
Returns **[Promise][25]<any>** script return value
|
|
923
930
|
|
|
924
931
|
### fillField
|
|
925
932
|
|
|
@@ -1419,6 +1426,8 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
1419
1426
|
|
|
1420
1427
|
### pressKey
|
|
1421
1428
|
|
|
1429
|
+
_Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
1430
|
+
|
|
1422
1431
|
Presses a key in the browser (on a focused element).
|
|
1423
1432
|
|
|
1424
1433
|
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][30].
|
|
@@ -1482,7 +1491,7 @@ Some of the supported key names are:
|
|
|
1482
1491
|
|
|
1483
1492
|
- `key` **([string][17] | [Array][28]<[string][17]>)** key or array of keys to press.
|
|
1484
1493
|
|
|
1485
|
-
Returns **void** automatically synchronized promise through #
|
|
1494
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1486
1495
|
|
|
1487
1496
|
### pressKeyDown
|
|
1488
1497
|
|
|
@@ -1532,6 +1541,8 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
1532
1541
|
|
|
1533
1542
|
### resizeWindow
|
|
1534
1543
|
|
|
1544
|
+
Appium: not tested in web, in apps doesn't work
|
|
1545
|
+
|
|
1535
1546
|
Resize the current window to provided width and height.
|
|
1536
1547
|
First parameter can be set to `maximize`.
|
|
1537
1548
|
|
|
@@ -1540,7 +1551,7 @@ First parameter can be set to `maximize`.
|
|
|
1540
1551
|
- `width` **[number][22]** width in pixels or `maximize`.
|
|
1541
1552
|
- `height` **[number][22]** height in pixels.
|
|
1542
1553
|
|
|
1543
|
-
Returns **void** automatically synchronized promise through #
|
|
1554
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1544
1555
|
|
|
1545
1556
|
### rightClick
|
|
1546
1557
|
|
|
@@ -1639,7 +1650,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1639
1650
|
#### Parameters
|
|
1640
1651
|
|
|
1641
1652
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1642
|
-
- `scrollIntoViewOptions` **ScrollIntoViewOptions**
|
|
1653
|
+
- `scrollIntoViewOptions` **(ScrollIntoViewOptions | [boolean][32])** either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][33].
|
|
1643
1654
|
|
|
1644
1655
|
Returns **void** automatically synchronized promise through #recorder
|
|
1645
1656
|
|
|
@@ -1720,6 +1731,7 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
1720
1731
|
|
|
1721
1732
|
### seeCheckboxIsChecked
|
|
1722
1733
|
|
|
1734
|
+
Appium: not tested
|
|
1723
1735
|
Verifies that the specified checkbox is checked.
|
|
1724
1736
|
|
|
1725
1737
|
```js
|
|
@@ -1732,7 +1744,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1732
1744
|
|
|
1733
1745
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1734
1746
|
|
|
1735
|
-
Returns **void** automatically synchronized promise through #
|
|
1747
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1736
1748
|
|
|
1737
1749
|
### seeCookie
|
|
1738
1750
|
|
|
@@ -1983,6 +1995,7 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
1983
1995
|
|
|
1984
1996
|
### setCookie
|
|
1985
1997
|
|
|
1998
|
+
Uses Selenium's JSON [cookie format][34].
|
|
1986
1999
|
Sets cookie(s).
|
|
1987
2000
|
|
|
1988
2001
|
Can be a single cookie object or an array of cookies:
|
|
@@ -2001,8 +2014,7 @@ I.setCookie([
|
|
|
2001
2014
|
|
|
2002
2015
|
- `cookie` **(Cookie | [Array][28]<Cookie>)** a cookie object or array of cookie objects.
|
|
2003
2016
|
|
|
2004
|
-
Returns **void** automatically synchronized promise through #
|
|
2005
|
-
format][34].
|
|
2017
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2006
2018
|
|
|
2007
2019
|
### setGeoLocation
|
|
2008
2020
|
|
|
@@ -2116,6 +2128,7 @@ Returns **void** automatically synchronized promise through #recorder
|
|
|
2116
2128
|
|
|
2117
2129
|
### uncheckOption
|
|
2118
2130
|
|
|
2131
|
+
Appium: not tested
|
|
2119
2132
|
Unselects a checkbox or radio button.
|
|
2120
2133
|
Element is located by label or name or CSS or XPath.
|
|
2121
2134
|
|
|
@@ -2132,7 +2145,7 @@ I.uncheckOption('agree', '//form');
|
|
|
2132
2145
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2133
2146
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2134
2147
|
|
|
2135
|
-
Returns **void** automatically synchronized promise through #
|
|
2148
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2136
2149
|
|
|
2137
2150
|
### useWebDriverTo
|
|
2138
2151
|
|
package/docs/parallel.md
CHANGED
|
@@ -96,7 +96,7 @@ FAIL | 7 passed, 1 failed, 1 skipped // 2s
|
|
|
96
96
|
"actor": "I",
|
|
97
97
|
"name": "amOnPage",
|
|
98
98
|
"status": "success",
|
|
99
|
-
"
|
|
99
|
+
"args": [
|
|
100
100
|
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST"
|
|
101
101
|
],
|
|
102
102
|
"startedAt": 1698760652610,
|
|
@@ -109,7 +109,7 @@ FAIL | 7 passed, 1 failed, 1 skipped // 2s
|
|
|
109
109
|
"actor": "I",
|
|
110
110
|
"name": "grabCurrentUrl",
|
|
111
111
|
"status": "success",
|
|
112
|
-
"
|
|
112
|
+
"args": [],
|
|
113
113
|
"startedAt": 1698760653098,
|
|
114
114
|
"startTime": 1698760653098,
|
|
115
115
|
"endTime": 1698760653099,
|
package/docs/plugins.md
CHANGED
|
@@ -721,7 +721,7 @@ Run tests with plugin enabled:
|
|
|
721
721
|
- `factor` - The exponential factor to use. Default is 1.5.
|
|
722
722
|
- `minTimeout` - The number of milliseconds before starting the first retry. Default is 1000.
|
|
723
723
|
- `maxTimeout` - The maximum number of milliseconds between two retries. Default is Infinity.
|
|
724
|
-
- `randomize` - Randomizes the timeouts by multiplying with a factor
|
|
724
|
+
- `randomize` - Randomizes the timeouts by multiplying with a factor from 1 to 2. Default is false.
|
|
725
725
|
- `defaultIgnoredSteps` - an array of steps to be ignored for retry. Includes:
|
|
726
726
|
- `amOnPage`
|
|
727
727
|
- `wait*`
|
|
@@ -1085,7 +1085,7 @@ plugins: {
|
|
|
1085
1085
|
|
|
1086
1086
|
## tryTo
|
|
1087
1087
|
|
|
1088
|
-
Adds global `tryTo` function
|
|
1088
|
+
Adds global `tryTo` function in which all failed steps won't fail a test but will return true/false.
|
|
1089
1089
|
|
|
1090
1090
|
Enable this plugin in `codecept.conf.js` (enabled by default for new setups):
|
|
1091
1091
|
|
|
@@ -1124,7 +1124,7 @@ Add assert requires first:
|
|
|
1124
1124
|
const assert = require('assert');
|
|
1125
1125
|
````
|
|
1126
1126
|
|
|
1127
|
-
Then use the
|
|
1127
|
+
Then use the assertion:
|
|
1128
1128
|
const result1 = await tryTo(() => I.see('Hello, user'));
|
|
1129
1129
|
const result2 = await tryTo(() => I.seeElement('.welcome'));
|
|
1130
1130
|
assert.ok(result1 && result2, 'Assertions were not succesful');
|
package/docs/react.md
CHANGED
|
@@ -66,4 +66,5 @@ To find React element names and props in a tree use [React DevTools](https://chr
|
|
|
66
66
|
|
|
67
67
|
> Turn off minification for application builds otherwise component names will be uglified as well
|
|
68
68
|
|
|
69
|
-
React locators work via [resq](https://github.com/baruchvlz/resq) library, which handles React 16 and above.
|
|
69
|
+
- With WebDriver and Puppeteer, React locators work via [resq](https://github.com/baruchvlz/resq) library, which handles React 16 and above.
|
|
70
|
+
- With Playwright, React locators work via [Playwright React Locator](https://playwright.dev/docs/other-locators#react-locator).
|
package/docs/vue.md
CHANGED
|
@@ -104,6 +104,28 @@ tests
|
|
|
104
104
|
|
|
105
105
|
If you agreed to create a demo component, you will also see `TestMe` component in `src/components` folder.
|
|
106
106
|
|
|
107
|
+
## Locators
|
|
108
|
+
|
|
109
|
+
For Vue apps a special `vue` locator is available. It allows to select an element by its component name, and props.
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
{ vue: 'MyComponent' }
|
|
113
|
+
{ vue: 'Button', props: { title: 'Click Me' }}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
With Playwright, you can use Vue locators in any method where locator is required:
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
I.click({ vue: 'Tab', props: { title: 'Click Me!' }});
|
|
120
|
+
I.seeElement({ vue: 't', props: { title: 'Clicked' }});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
To find Vue element names and props in a tree use [Vue DevTools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) extension.
|
|
124
|
+
|
|
125
|
+
> Turn off minification for application builds otherwise component names will be uglified as well
|
|
126
|
+
|
|
127
|
+
Vue locators work via [Playwright Vue Locator](https://playwright.dev/docs/other-locators#vue-locator).
|
|
128
|
+
|
|
107
129
|
## How to write tests?
|
|
108
130
|
|
|
109
131
|
* Open `tests/e2e/app_js` and see the demo test
|
|
@@ -7,5 +7,5 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
@param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
10
|
-
@param {ScrollIntoViewOptions} scrollIntoViewOptions
|
|
10
|
+
@param {ScrollIntoViewOptions|boolean} scrollIntoViewOptions either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
11
11
|
@returns {void} automatically synchronized promise through #recorder
|
|
@@ -141,11 +141,27 @@ function initializeListeners() {
|
|
|
141
141
|
const _steps = [];
|
|
142
142
|
|
|
143
143
|
for (step of steps) {
|
|
144
|
+
const _args = [];
|
|
145
|
+
|
|
146
|
+
if (step.args) {
|
|
147
|
+
for (const arg of step.args) {
|
|
148
|
+
// check if arg is a JOI object
|
|
149
|
+
if (arg && arg.$_root) {
|
|
150
|
+
_args.push(JSON.stringify(arg).slice(0, 300));
|
|
151
|
+
// check if arg is a function
|
|
152
|
+
} else if (arg && typeof arg === 'function') {
|
|
153
|
+
_args.push(arg.name);
|
|
154
|
+
} else {
|
|
155
|
+
_args.push(arg);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
144
160
|
_steps.push({
|
|
145
161
|
actor: step.actor,
|
|
146
162
|
name: step.name,
|
|
147
163
|
status: step.status,
|
|
148
|
-
agrs:
|
|
164
|
+
agrs: _args,
|
|
149
165
|
startedAt: step.startedAt,
|
|
150
166
|
startTime: step.startTime,
|
|
151
167
|
endTime: step.endTime,
|