codeceptjs 3.5.6 → 3.5.7
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/README.md +5 -1
- package/docs/advanced.md +1 -1
- package/docs/bdd.md +11 -7
- package/docs/build/ApiDataFactory.js +2 -1
- package/docs/build/Appium.js +26 -23
- package/docs/build/Expect.js +422 -0
- package/docs/build/Nightmare.js +53 -56
- package/docs/build/Playwright.js +202 -103
- package/docs/build/Protractor.js +66 -69
- package/docs/build/Puppeteer.js +124 -81
- package/docs/build/TestCafe.js +56 -55
- package/docs/build/WebDriver.js +81 -82
- package/docs/changelog.md +562 -1
- package/docs/commands.md +12 -0
- package/docs/community-helpers.md +8 -4
- package/docs/examples.md +8 -2
- package/docs/helpers/Appium.md +50 -32
- package/docs/helpers/Expect.md +275 -0
- package/docs/helpers/Nightmare.md +141 -94
- package/docs/helpers/Playwright.md +360 -261
- package/docs/helpers/Protractor.md +229 -169
- package/docs/helpers/Puppeteer.md +270 -187
- package/docs/helpers/TestCafe.md +201 -149
- package/docs/helpers/WebDriver.md +252 -178
- package/docs/mobile.md +17 -21
- package/docs/plugins.md +35 -1
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -0
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +0 -2
- package/docs/webapi/executeScript.mustache +0 -2
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabCookie.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/docs/webdriver.md +1 -1
- package/lib/cli.js +3 -1
- package/lib/command/dryRun.js +2 -1
- package/lib/helper/ApiDataFactory.js +2 -1
- package/lib/helper/Appium.js +8 -5
- package/lib/helper/Expect.js +422 -0
- package/lib/helper/Playwright.js +127 -32
- package/lib/helper/Puppeteer.js +47 -4
- package/lib/interfaces/gherkin.js +21 -2
- package/lib/output.js +1 -1
- package/lib/plugin/autoLogin.js +41 -3
- package/lib/utils.js +1 -1
- package/lib/workers.js +23 -2
- package/package.json +25 -16
- package/translations/de-DE.js +5 -0
- package/translations/fr-FR.js +1 -0
- package/translations/it-IT.js +1 -0
- package/translations/ja-JP.js +5 -0
- package/translations/pl-PL.js +5 -0
- package/translations/pt-BR.js +1 -0
- package/translations/ru-RU.js +1 -0
- package/translations/zh-CN.js +5 -0
- package/translations/zh-TW.js +5 -0
- package/typings/promiseBasedTypes.d.ts +928 -862
- package/typings/types.d.ts +932 -845
|
@@ -44,22 +44,32 @@ 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][25] with screenshots.
|
|
48
|
+
- `keepTraceForPassedTests` **[boolean][20]?** save trace for passed tests.
|
|
47
49
|
- `keepBrowserState` **[boolean][20]?** keep browser state between tests when `restart` is set to false.
|
|
48
50
|
- `keepCookies` **[boolean][20]?** keep cookies between tests when `restart` is set to false.
|
|
49
|
-
- `waitForAction` **[number][
|
|
51
|
+
- `waitForAction` **[number][11]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
50
52
|
- `waitForNavigation` **[string][6]?** when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API][23]. Array values are accepted as well.
|
|
51
|
-
- `pressKeyDelay` **[number][
|
|
52
|
-
- `getPageTimeout` **[number][
|
|
53
|
-
- `waitForTimeout` **[number][
|
|
53
|
+
- `pressKeyDelay` **[number][11]?** delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
|
|
54
|
+
- `getPageTimeout` **[number][11]?** config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
|
|
55
|
+
- `waitForTimeout` **[number][11]?** default wait* timeout in ms.
|
|
54
56
|
- `windowSize` **[string][6]?** default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`.
|
|
55
57
|
- `userAgent` **[string][6]?** user-agent string.
|
|
56
58
|
- `manualStart` **[boolean][20]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
57
59
|
- `browser` **[string][6]?** can be changed to `firefox` when using [puppeteer-firefox][2].
|
|
58
|
-
- `chrome` **[object][4]?** pass additional [Puppeteer run options][
|
|
60
|
+
- `chrome` **[object][4]?** pass additional [Puppeteer run options][26].
|
|
59
61
|
- `highlightElement` **[boolean][20]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
60
62
|
|
|
61
63
|
|
|
62
64
|
|
|
65
|
+
#### Trace Recording Customization
|
|
66
|
+
|
|
67
|
+
Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run.
|
|
68
|
+
Traces will be saved to `output/trace`
|
|
69
|
+
|
|
70
|
+
- `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
|
|
71
|
+
- `keepTraceForPassedTests`: - save trace for passed tests
|
|
72
|
+
|
|
63
73
|
#### Example #1: Wait for 0 network connections.
|
|
64
74
|
|
|
65
75
|
```js
|
|
@@ -288,7 +298,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
288
298
|
|
|
289
299
|
- `url` **[string][6]** url path or global url.
|
|
290
300
|
|
|
291
|
-
Returns **void
|
|
301
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
292
302
|
|
|
293
303
|
### appendField
|
|
294
304
|
|
|
@@ -305,7 +315,8 @@ I.appendField('password', secret('123456'));
|
|
|
305
315
|
|
|
306
316
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator
|
|
307
317
|
- `value` **[string][6]** text value to append.
|
|
308
|
-
|
|
318
|
+
|
|
319
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
309
320
|
|
|
310
321
|
|
|
311
322
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -326,12 +337,13 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
326
337
|
|
|
327
338
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
328
339
|
- `pathToFile` **[string][6]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
329
|
-
|
|
340
|
+
|
|
341
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder> ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1][8], downgrade to 2.0.0 if you face it.
|
|
330
342
|
|
|
331
343
|
### blur
|
|
332
344
|
|
|
333
345
|
Remove focus from a text input, button, etc.
|
|
334
|
-
Calls [blur][
|
|
346
|
+
Calls [blur][9] on the element.
|
|
335
347
|
|
|
336
348
|
Examples:
|
|
337
349
|
|
|
@@ -349,7 +361,9 @@ I.dontSee('#add-to-cart-btn');
|
|
|
349
361
|
#### Parameters
|
|
350
362
|
|
|
351
363
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
352
|
-
- `options` **any?** Playwright only: [Additional options][
|
|
364
|
+
- `options` **any?** Playwright only: [Additional options][10] for available options object as 2nd argument.
|
|
365
|
+
|
|
366
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
353
367
|
|
|
354
368
|
### cancelPopup
|
|
355
369
|
|
|
@@ -371,8 +385,9 @@ I.checkOption('agree', '//form');
|
|
|
371
385
|
#### Parameters
|
|
372
386
|
|
|
373
387
|
- `field` **([string][6] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
374
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
375
|
-
|
|
388
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
389
|
+
|
|
390
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
376
391
|
|
|
377
392
|
### clearCookie
|
|
378
393
|
|
|
@@ -387,8 +402,9 @@ I.clearCookie('test');
|
|
|
387
402
|
#### Parameters
|
|
388
403
|
|
|
389
404
|
- `name`
|
|
390
|
-
- `cookie` **[string][6]?** (optional, `null` by default) cookie name
|
|
391
|
-
|
|
405
|
+
- `cookie` **[string][6]?** (optional, `null` by default) cookie name
|
|
406
|
+
|
|
407
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
392
408
|
|
|
393
409
|
### clearField
|
|
394
410
|
|
|
@@ -404,7 +420,8 @@ I.clearField('#email');
|
|
|
404
420
|
|
|
405
421
|
- `field`
|
|
406
422
|
- `editable` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
407
|
-
|
|
423
|
+
|
|
424
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder.
|
|
408
425
|
|
|
409
426
|
### click
|
|
410
427
|
|
|
@@ -433,12 +450,13 @@ I.click({css: 'nav a.login'});
|
|
|
433
450
|
#### Parameters
|
|
434
451
|
|
|
435
452
|
- `locator` **([string][6] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
436
|
-
- `context` **([string][6]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
437
|
-
|
|
453
|
+
- `context` **([string][6]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
454
|
+
|
|
455
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
438
456
|
|
|
439
457
|
|
|
440
458
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
441
|
-
|
|
459
|
+
|
|
442
460
|
|
|
443
461
|
### clickLink
|
|
444
462
|
|
|
@@ -451,12 +469,13 @@ I.clickLink('Logout', '#nav');
|
|
|
451
469
|
#### Parameters
|
|
452
470
|
|
|
453
471
|
- `locator` **([string][6] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
454
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
455
|
-
|
|
472
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
473
|
+
|
|
474
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
456
475
|
|
|
457
476
|
|
|
458
477
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
459
|
-
|
|
478
|
+
|
|
460
479
|
|
|
461
480
|
### closeCurrentTab
|
|
462
481
|
|
|
@@ -487,12 +506,13 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
487
506
|
#### Parameters
|
|
488
507
|
|
|
489
508
|
- `text` **[string][6]** which is not present.
|
|
490
|
-
- `context` **([string][6] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
491
|
-
|
|
509
|
+
- `context` **([string][6] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
510
|
+
|
|
511
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
492
512
|
|
|
493
513
|
|
|
494
514
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
495
|
-
|
|
515
|
+
|
|
496
516
|
|
|
497
517
|
### dontSeeCheckboxIsChecked
|
|
498
518
|
|
|
@@ -507,7 +527,8 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
507
527
|
#### Parameters
|
|
508
528
|
|
|
509
529
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
510
|
-
|
|
530
|
+
|
|
531
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
511
532
|
|
|
512
533
|
### dontSeeCookie
|
|
513
534
|
|
|
@@ -520,7 +541,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
520
541
|
#### Parameters
|
|
521
542
|
|
|
522
543
|
- `name` **[string][6]** cookie name.
|
|
523
|
-
|
|
544
|
+
|
|
545
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
524
546
|
|
|
525
547
|
### dontSeeCurrentUrlEquals
|
|
526
548
|
|
|
@@ -535,7 +557,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
535
557
|
#### Parameters
|
|
536
558
|
|
|
537
559
|
- `url` **[string][6]** value to check.
|
|
538
|
-
|
|
560
|
+
|
|
561
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
539
562
|
|
|
540
563
|
### dontSeeElement
|
|
541
564
|
|
|
@@ -548,7 +571,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
548
571
|
#### Parameters
|
|
549
572
|
|
|
550
573
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|Strict locator.
|
|
551
|
-
|
|
574
|
+
|
|
575
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
552
576
|
|
|
553
577
|
|
|
554
578
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -565,7 +589,8 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
565
589
|
#### Parameters
|
|
566
590
|
|
|
567
591
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|Strict locator.
|
|
568
|
-
|
|
592
|
+
|
|
593
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
569
594
|
|
|
570
595
|
### dontSeeInCurrentUrl
|
|
571
596
|
|
|
@@ -574,7 +599,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
574
599
|
#### Parameters
|
|
575
600
|
|
|
576
601
|
- `url` **[string][6]** value to check.
|
|
577
|
-
|
|
602
|
+
|
|
603
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
578
604
|
|
|
579
605
|
### dontSeeInField
|
|
580
606
|
|
|
@@ -590,7 +616,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
590
616
|
|
|
591
617
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
592
618
|
- `value` **([string][6] | [object][4])** value to check.
|
|
593
|
-
|
|
619
|
+
|
|
620
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
594
621
|
|
|
595
622
|
### dontSeeInSource
|
|
596
623
|
|
|
@@ -604,7 +631,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
604
631
|
|
|
605
632
|
- `text`
|
|
606
633
|
- `value` **[string][6]** to check.
|
|
607
|
-
|
|
634
|
+
|
|
635
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
608
636
|
|
|
609
637
|
### dontSeeInTitle
|
|
610
638
|
|
|
@@ -617,7 +645,8 @@ I.dontSeeInTitle('Error');
|
|
|
617
645
|
#### Parameters
|
|
618
646
|
|
|
619
647
|
- `text` **[string][6]** value to check.
|
|
620
|
-
|
|
648
|
+
|
|
649
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
621
650
|
|
|
622
651
|
### doubleClick
|
|
623
652
|
|
|
@@ -634,12 +663,13 @@ I.doubleClick('.btn.edit');
|
|
|
634
663
|
#### Parameters
|
|
635
664
|
|
|
636
665
|
- `locator` **([string][6] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
637
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
638
|
-
|
|
666
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
667
|
+
|
|
668
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
639
669
|
|
|
640
670
|
|
|
641
671
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
642
|
-
|
|
672
|
+
|
|
643
673
|
|
|
644
674
|
### downloadFile
|
|
645
675
|
|
|
@@ -664,7 +694,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
664
694
|
|
|
665
695
|
- `srcElement` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
666
696
|
- `destElement` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
667
|
-
|
|
697
|
+
|
|
698
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
668
699
|
|
|
669
700
|
### dragSlider
|
|
670
701
|
|
|
@@ -679,19 +710,20 @@ I.dragSlider('#slider', -70);
|
|
|
679
710
|
#### Parameters
|
|
680
711
|
|
|
681
712
|
- `locator` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
682
|
-
- `offsetX` **[number][
|
|
683
|
-
|
|
713
|
+
- `offsetX` **[number][11]** position to drag.
|
|
714
|
+
|
|
715
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
684
716
|
|
|
685
717
|
|
|
686
718
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
687
|
-
|
|
719
|
+
|
|
688
720
|
|
|
689
721
|
### executeAsyncScript
|
|
690
722
|
|
|
691
723
|
Executes async script on page.
|
|
692
724
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
693
725
|
|
|
694
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
726
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][12].
|
|
695
727
|
|
|
696
728
|
```js
|
|
697
729
|
I.executeAsyncScript(function(done) {
|
|
@@ -712,9 +744,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
712
744
|
#### Parameters
|
|
713
745
|
|
|
714
746
|
- `args` **...any** to be passed to function.
|
|
715
|
-
- `fn` **([string][6] | [function][
|
|
747
|
+
- `fn` **([string][6] | [function][13])** function to be executed in browser context.
|
|
716
748
|
|
|
717
|
-
Returns **[Promise][
|
|
749
|
+
Returns **[Promise][7]<any>** script return valueAsynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
718
750
|
|
|
719
751
|
### executeScript
|
|
720
752
|
|
|
@@ -745,9 +777,9 @@ let date = await I.executeScript(function(el) {
|
|
|
745
777
|
#### Parameters
|
|
746
778
|
|
|
747
779
|
- `args` **...any** to be passed to function.
|
|
748
|
-
- `fn` **([string][6] | [function][
|
|
780
|
+
- `fn` **([string][6] | [function][13])** function to be executed in browser context.
|
|
749
781
|
|
|
750
|
-
Returns **[Promise][
|
|
782
|
+
Returns **[Promise][7]<any>** script return valueIf a function returns a Promise It will wait for it resolution.
|
|
751
783
|
|
|
752
784
|
### fillField
|
|
753
785
|
|
|
@@ -769,7 +801,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
769
801
|
|
|
770
802
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
771
803
|
- `value` **([string][6] | [object][4])** text value to fill.
|
|
772
|
-
|
|
804
|
+
|
|
805
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
773
806
|
|
|
774
807
|
|
|
775
808
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -777,7 +810,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
777
810
|
|
|
778
811
|
### focus
|
|
779
812
|
|
|
780
|
-
Calls [focus][
|
|
813
|
+
Calls [focus][9] on the matching element.
|
|
781
814
|
|
|
782
815
|
Examples:
|
|
783
816
|
|
|
@@ -792,6 +825,8 @@ I.see('#add-to-cart-bnt');
|
|
|
792
825
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
793
826
|
- `options` **any?** Playwright only: [Additional options][14] for available options object as 2nd argument.
|
|
794
827
|
|
|
828
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
829
|
+
|
|
795
830
|
### forceClick
|
|
796
831
|
|
|
797
832
|
Perform an emulated click on a link or a button, given by a locator.
|
|
@@ -822,12 +857,13 @@ I.forceClick({css: 'nav a.login'});
|
|
|
822
857
|
#### Parameters
|
|
823
858
|
|
|
824
859
|
- `locator` **([string][6] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
825
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
826
|
-
|
|
860
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
861
|
+
|
|
862
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
827
863
|
|
|
828
864
|
|
|
829
865
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
830
|
-
|
|
866
|
+
|
|
831
867
|
|
|
832
868
|
### grabAttributeFrom
|
|
833
869
|
|
|
@@ -844,7 +880,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
844
880
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
845
881
|
- `attr` **[string][6]** attribute name.
|
|
846
882
|
|
|
847
|
-
Returns **[Promise][
|
|
883
|
+
Returns **[Promise][7]<[string][6]>** attribute value
|
|
848
884
|
|
|
849
885
|
|
|
850
886
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -864,7 +900,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
864
900
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
865
901
|
- `attr` **[string][6]** attribute name.
|
|
866
902
|
|
|
867
|
-
Returns **[Promise][
|
|
903
|
+
Returns **[Promise][7]<[Array][15]<[string][6]>>** attribute value
|
|
868
904
|
|
|
869
905
|
|
|
870
906
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -879,7 +915,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
879
915
|
console.log(JSON.stringify(logs))
|
|
880
916
|
```
|
|
881
917
|
|
|
882
|
-
Returns **[Promise][
|
|
918
|
+
Returns **[Promise][7]<[Array][15]<any>>**
|
|
883
919
|
|
|
884
920
|
### grabCookie
|
|
885
921
|
|
|
@@ -896,7 +932,7 @@ assert(cookie.value, '123456');
|
|
|
896
932
|
|
|
897
933
|
- `name` **[string][6]?** cookie name.
|
|
898
934
|
|
|
899
|
-
Returns **
|
|
935
|
+
Returns **any** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
900
936
|
|
|
901
937
|
### grabCssPropertyFrom
|
|
902
938
|
|
|
@@ -913,7 +949,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
913
949
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
914
950
|
- `cssProperty` **[string][6]** CSS property name.
|
|
915
951
|
|
|
916
|
-
Returns **[Promise][
|
|
952
|
+
Returns **[Promise][7]<[string][6]>** CSS value
|
|
917
953
|
|
|
918
954
|
|
|
919
955
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -933,7 +969,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
933
969
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
934
970
|
- `cssProperty` **[string][6]** CSS property name.
|
|
935
971
|
|
|
936
|
-
Returns **[Promise][
|
|
972
|
+
Returns **[Promise][7]<[Array][15]<[string][6]>>** CSS value
|
|
937
973
|
|
|
938
974
|
|
|
939
975
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -949,7 +985,7 @@ let url = await I.grabCurrentUrl();
|
|
|
949
985
|
console.log(`Current URL is [${url}]`);
|
|
950
986
|
```
|
|
951
987
|
|
|
952
|
-
Returns **[Promise][
|
|
988
|
+
Returns **[Promise][7]<[string][6]>** current URL
|
|
953
989
|
|
|
954
990
|
### grabDataFromPerformanceTiming
|
|
955
991
|
|
|
@@ -974,7 +1010,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
974
1010
|
}
|
|
975
1011
|
```
|
|
976
1012
|
|
|
977
|
-
Returns **[Promise][
|
|
1013
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
978
1014
|
|
|
979
1015
|
### grabElementBoundingRect
|
|
980
1016
|
|
|
@@ -1002,7 +1038,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1002
1038
|
- `prop`
|
|
1003
1039
|
- `elementSize` **[string][6]?** x, y, width or height of the given element.
|
|
1004
1040
|
|
|
1005
|
-
Returns **([Promise][
|
|
1041
|
+
Returns **([Promise][7]<DOMRect> | [Promise][7]<[number][11]>)** Element bounding rectangle
|
|
1006
1042
|
|
|
1007
1043
|
### grabHTMLFrom
|
|
1008
1044
|
|
|
@@ -1019,7 +1055,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1019
1055
|
- `locator`
|
|
1020
1056
|
- `element` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1021
1057
|
|
|
1022
|
-
Returns **[Promise][
|
|
1058
|
+
Returns **[Promise][7]<[string][6]>** HTML code for an element
|
|
1023
1059
|
|
|
1024
1060
|
### grabHTMLFromAll
|
|
1025
1061
|
|
|
@@ -1035,7 +1071,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1035
1071
|
- `locator`
|
|
1036
1072
|
- `element` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1037
1073
|
|
|
1038
|
-
Returns **[Promise][
|
|
1074
|
+
Returns **[Promise][7]<[Array][15]<[string][6]>>** HTML code for an element
|
|
1039
1075
|
|
|
1040
1076
|
### grabNumberOfOpenTabs
|
|
1041
1077
|
|
|
@@ -1046,7 +1082,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1046
1082
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1047
1083
|
```
|
|
1048
1084
|
|
|
1049
|
-
Returns **[Promise][
|
|
1085
|
+
Returns **[Promise][7]<[number][11]>** number of open tabs
|
|
1050
1086
|
|
|
1051
1087
|
### grabNumberOfVisibleElements
|
|
1052
1088
|
|
|
@@ -1061,7 +1097,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1061
1097
|
|
|
1062
1098
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1063
1099
|
|
|
1064
|
-
Returns **[Promise][
|
|
1100
|
+
Returns **[Promise][7]<[number][11]>** number of visible elements
|
|
1065
1101
|
|
|
1066
1102
|
|
|
1067
1103
|
|
|
@@ -1077,7 +1113,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1077
1113
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1078
1114
|
```
|
|
1079
1115
|
|
|
1080
|
-
Returns **[Promise][
|
|
1116
|
+
Returns **[Promise][7]<PageScrollPosition>** scroll position
|
|
1081
1117
|
|
|
1082
1118
|
### grabPopupText
|
|
1083
1119
|
|
|
@@ -1087,7 +1123,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1087
1123
|
await I.grabPopupText();
|
|
1088
1124
|
```
|
|
1089
1125
|
|
|
1090
|
-
Returns **[Promise][
|
|
1126
|
+
Returns **[Promise][7]<([string][6] | null)>**
|
|
1091
1127
|
|
|
1092
1128
|
### grabSource
|
|
1093
1129
|
|
|
@@ -1098,7 +1134,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1098
1134
|
let pageSource = await I.grabSource();
|
|
1099
1135
|
```
|
|
1100
1136
|
|
|
1101
|
-
Returns **[Promise][
|
|
1137
|
+
Returns **[Promise][7]<[string][6]>** source code
|
|
1102
1138
|
|
|
1103
1139
|
### grabTextFrom
|
|
1104
1140
|
|
|
@@ -1115,7 +1151,7 @@ If multiple elements found returns first element.
|
|
|
1115
1151
|
|
|
1116
1152
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1117
1153
|
|
|
1118
|
-
Returns **[Promise][
|
|
1154
|
+
Returns **[Promise][7]<[string][6]>** attribute value
|
|
1119
1155
|
|
|
1120
1156
|
|
|
1121
1157
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1134,7 +1170,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1134
1170
|
|
|
1135
1171
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1136
1172
|
|
|
1137
|
-
Returns **[Promise][
|
|
1173
|
+
Returns **[Promise][7]<[Array][15]<[string][6]>>** attribute value
|
|
1138
1174
|
|
|
1139
1175
|
|
|
1140
1176
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1149,7 +1185,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1149
1185
|
let title = await I.grabTitle();
|
|
1150
1186
|
```
|
|
1151
1187
|
|
|
1152
|
-
Returns **[Promise][
|
|
1188
|
+
Returns **[Promise][7]<[string][6]>** title
|
|
1153
1189
|
|
|
1154
1190
|
### grabValueFrom
|
|
1155
1191
|
|
|
@@ -1165,7 +1201,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1165
1201
|
|
|
1166
1202
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
1167
1203
|
|
|
1168
|
-
Returns **[Promise][
|
|
1204
|
+
Returns **[Promise][7]<[string][6]>** attribute value
|
|
1169
1205
|
|
|
1170
1206
|
### grabValueFromAll
|
|
1171
1207
|
|
|
@@ -1180,7 +1216,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1180
1216
|
|
|
1181
1217
|
- `locator` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
1182
1218
|
|
|
1183
|
-
Returns **[Promise][
|
|
1219
|
+
Returns **[Promise][7]<[Array][15]<[string][6]>>** attribute value
|
|
1184
1220
|
|
|
1185
1221
|
### handleDownloads
|
|
1186
1222
|
|
|
@@ -1201,20 +1237,6 @@ I.seeFile('avatar.jpg');
|
|
|
1201
1237
|
|
|
1202
1238
|
- `downloadPath` **[string][6]** change this parameter to set another directory for saving
|
|
1203
1239
|
|
|
1204
|
-
### haveRequestHeaders
|
|
1205
|
-
|
|
1206
|
-
Set headers for all next requests
|
|
1207
|
-
|
|
1208
|
-
```js
|
|
1209
|
-
I.haveRequestHeaders({
|
|
1210
|
-
'X-Sent-By': 'CodeceptJS',
|
|
1211
|
-
});
|
|
1212
|
-
```
|
|
1213
|
-
|
|
1214
|
-
#### Parameters
|
|
1215
|
-
|
|
1216
|
-
- `customHeaders` **[object][4]** headers to set
|
|
1217
|
-
|
|
1218
1240
|
### moveCursorTo
|
|
1219
1241
|
|
|
1220
1242
|
Moves cursor to element matched by locator.
|
|
@@ -1228,13 +1250,14 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1228
1250
|
#### Parameters
|
|
1229
1251
|
|
|
1230
1252
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1231
|
-
- `offsetX` **[number][
|
|
1232
|
-
- `offsetY` **[number][
|
|
1233
|
-
|
|
1253
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
1254
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1255
|
+
|
|
1256
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1234
1257
|
|
|
1235
1258
|
|
|
1236
1259
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1237
|
-
|
|
1260
|
+
|
|
1238
1261
|
|
|
1239
1262
|
### openNewTab
|
|
1240
1263
|
|
|
@@ -1308,7 +1331,8 @@ Some of the supported key names are:
|
|
|
1308
1331
|
#### Parameters
|
|
1309
1332
|
|
|
1310
1333
|
- `key` **([string][6] | [Array][15]<[string][6]>)** key or array of keys to press.
|
|
1311
|
-
|
|
1334
|
+
|
|
1335
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313][18]).
|
|
1312
1336
|
|
|
1313
1337
|
### pressKeyDown
|
|
1314
1338
|
|
|
@@ -1325,7 +1349,8 @@ I.pressKeyUp('Control');
|
|
|
1325
1349
|
#### Parameters
|
|
1326
1350
|
|
|
1327
1351
|
- `key` **[string][6]** name of key to press down.
|
|
1328
|
-
|
|
1352
|
+
|
|
1353
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1329
1354
|
|
|
1330
1355
|
### pressKeyUp
|
|
1331
1356
|
|
|
@@ -1342,7 +1367,8 @@ I.pressKeyUp('Control');
|
|
|
1342
1367
|
#### Parameters
|
|
1343
1368
|
|
|
1344
1369
|
- `key` **[string][6]** name of key to release.
|
|
1345
|
-
|
|
1370
|
+
|
|
1371
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1346
1372
|
|
|
1347
1373
|
### refreshPage
|
|
1348
1374
|
|
|
@@ -1352,7 +1378,7 @@ Reload the current page.
|
|
|
1352
1378
|
I.refreshPage();
|
|
1353
1379
|
```
|
|
1354
1380
|
|
|
1355
|
-
|
|
1381
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1356
1382
|
|
|
1357
1383
|
### resizeWindow
|
|
1358
1384
|
|
|
@@ -1361,11 +1387,12 @@ First parameter can be set to `maximize`.
|
|
|
1361
1387
|
|
|
1362
1388
|
#### Parameters
|
|
1363
1389
|
|
|
1364
|
-
- `width` **[number][
|
|
1365
|
-
- `height` **[number][
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1390
|
+
- `width` **[number][11]** width in pixels or `maximize`.
|
|
1391
|
+
- `height` **[number][11]** height in pixels.
|
|
1392
|
+
|
|
1393
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorderUnlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
1394
|
+
Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
1395
|
+
It also can't maximize a window.
|
|
1369
1396
|
|
|
1370
1397
|
### rightClick
|
|
1371
1398
|
|
|
@@ -1383,12 +1410,13 @@ I.rightClick('Click me', '.context');
|
|
|
1383
1410
|
#### Parameters
|
|
1384
1411
|
|
|
1385
1412
|
- `locator` **([string][6] | [object][4])** clickable element located by CSS|XPath|strict locator.
|
|
1386
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1387
|
-
|
|
1413
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1414
|
+
|
|
1415
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1388
1416
|
|
|
1389
1417
|
|
|
1390
1418
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1391
|
-
|
|
1419
|
+
|
|
1392
1420
|
|
|
1393
1421
|
### saveElementScreenshot
|
|
1394
1422
|
|
|
@@ -1403,7 +1431,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1403
1431
|
|
|
1404
1432
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1405
1433
|
- `fileName` **[string][6]** file name to save.
|
|
1406
|
-
|
|
1434
|
+
|
|
1435
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1407
1436
|
|
|
1408
1437
|
### saveScreenshot
|
|
1409
1438
|
|
|
@@ -1419,8 +1448,9 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1419
1448
|
#### Parameters
|
|
1420
1449
|
|
|
1421
1450
|
- `fileName` **[string][6]** file name to save.
|
|
1422
|
-
- `fullPage` **[boolean][20]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1423
|
-
|
|
1451
|
+
- `fullPage` **[boolean][20]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1452
|
+
|
|
1453
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1424
1454
|
|
|
1425
1455
|
### scrollPageToBottom
|
|
1426
1456
|
|
|
@@ -1430,7 +1460,7 @@ Scroll page to the bottom.
|
|
|
1430
1460
|
I.scrollPageToBottom();
|
|
1431
1461
|
```
|
|
1432
1462
|
|
|
1433
|
-
|
|
1463
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1434
1464
|
|
|
1435
1465
|
### scrollPageToTop
|
|
1436
1466
|
|
|
@@ -1440,7 +1470,7 @@ Scroll page to the top.
|
|
|
1440
1470
|
I.scrollPageToTop();
|
|
1441
1471
|
```
|
|
1442
1472
|
|
|
1443
|
-
|
|
1473
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1444
1474
|
|
|
1445
1475
|
### scrollTo
|
|
1446
1476
|
|
|
@@ -1455,9 +1485,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1455
1485
|
#### Parameters
|
|
1456
1486
|
|
|
1457
1487
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1458
|
-
- `offsetX` **[number][
|
|
1459
|
-
- `offsetY` **[number][
|
|
1460
|
-
|
|
1488
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
1489
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1490
|
+
|
|
1491
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1461
1492
|
|
|
1462
1493
|
### see
|
|
1463
1494
|
|
|
@@ -1473,12 +1504,13 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1473
1504
|
#### Parameters
|
|
1474
1505
|
|
|
1475
1506
|
- `text` **[string][6]** expected on page.
|
|
1476
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1477
|
-
|
|
1507
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1508
|
+
|
|
1509
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1478
1510
|
|
|
1479
1511
|
|
|
1480
1512
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1481
|
-
|
|
1513
|
+
|
|
1482
1514
|
|
|
1483
1515
|
### seeAttributesOnElements
|
|
1484
1516
|
|
|
@@ -1492,7 +1524,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1492
1524
|
|
|
1493
1525
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1494
1526
|
- `attributes` **[object][4]** attributes and their values to check.
|
|
1495
|
-
|
|
1527
|
+
|
|
1528
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1496
1529
|
|
|
1497
1530
|
|
|
1498
1531
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1511,7 +1544,8 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1511
1544
|
#### Parameters
|
|
1512
1545
|
|
|
1513
1546
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
1514
|
-
|
|
1547
|
+
|
|
1548
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1515
1549
|
|
|
1516
1550
|
### seeCookie
|
|
1517
1551
|
|
|
@@ -1524,7 +1558,8 @@ I.seeCookie('Auth');
|
|
|
1524
1558
|
#### Parameters
|
|
1525
1559
|
|
|
1526
1560
|
- `name` **[string][6]** cookie name.
|
|
1527
|
-
|
|
1561
|
+
|
|
1562
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1528
1563
|
|
|
1529
1564
|
### seeCssPropertiesOnElements
|
|
1530
1565
|
|
|
@@ -1538,7 +1573,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1538
1573
|
|
|
1539
1574
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1540
1575
|
- `cssProperties` **[object][4]** object with CSS properties and their values to check.
|
|
1541
|
-
|
|
1576
|
+
|
|
1577
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1542
1578
|
|
|
1543
1579
|
|
|
1544
1580
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1558,7 +1594,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1558
1594
|
#### Parameters
|
|
1559
1595
|
|
|
1560
1596
|
- `url` **[string][6]** value to check.
|
|
1561
|
-
|
|
1597
|
+
|
|
1598
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1562
1599
|
|
|
1563
1600
|
### seeElement
|
|
1564
1601
|
|
|
@@ -1572,7 +1609,8 @@ I.seeElement('#modal');
|
|
|
1572
1609
|
#### Parameters
|
|
1573
1610
|
|
|
1574
1611
|
- `locator` **([string][6] | [object][4])** located by CSS|XPath|strict locator.
|
|
1575
|
-
|
|
1612
|
+
|
|
1613
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1576
1614
|
|
|
1577
1615
|
|
|
1578
1616
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1590,7 +1628,8 @@ I.seeElementInDOM('#modal');
|
|
|
1590
1628
|
#### Parameters
|
|
1591
1629
|
|
|
1592
1630
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1593
|
-
|
|
1631
|
+
|
|
1632
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1594
1633
|
|
|
1595
1634
|
### seeInCurrentUrl
|
|
1596
1635
|
|
|
@@ -1603,7 +1642,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1603
1642
|
#### Parameters
|
|
1604
1643
|
|
|
1605
1644
|
- `url` **[string][6]** a fragment to check
|
|
1606
|
-
|
|
1645
|
+
|
|
1646
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1607
1647
|
|
|
1608
1648
|
### seeInField
|
|
1609
1649
|
|
|
@@ -1621,7 +1661,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1621
1661
|
|
|
1622
1662
|
- `field` **([string][6] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
1623
1663
|
- `value` **([string][6] | [object][4])** value to check.
|
|
1624
|
-
|
|
1664
|
+
|
|
1665
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1625
1666
|
|
|
1626
1667
|
### seeInPopup
|
|
1627
1668
|
|
|
@@ -1635,7 +1676,8 @@ I.seeInPopup('Popup text');
|
|
|
1635
1676
|
#### Parameters
|
|
1636
1677
|
|
|
1637
1678
|
- `text` **[string][6]** value to check.
|
|
1638
|
-
|
|
1679
|
+
|
|
1680
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1639
1681
|
|
|
1640
1682
|
### seeInSource
|
|
1641
1683
|
|
|
@@ -1648,7 +1690,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1648
1690
|
#### Parameters
|
|
1649
1691
|
|
|
1650
1692
|
- `text` **[string][6]** value to check.
|
|
1651
|
-
|
|
1693
|
+
|
|
1694
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1652
1695
|
|
|
1653
1696
|
### seeInTitle
|
|
1654
1697
|
|
|
@@ -1661,7 +1704,8 @@ I.seeInTitle('Home Page');
|
|
|
1661
1704
|
#### Parameters
|
|
1662
1705
|
|
|
1663
1706
|
- `text` **[string][6]** text value to check.
|
|
1664
|
-
|
|
1707
|
+
|
|
1708
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1665
1709
|
|
|
1666
1710
|
### seeNumberOfElements
|
|
1667
1711
|
|
|
@@ -1675,8 +1719,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1675
1719
|
#### Parameters
|
|
1676
1720
|
|
|
1677
1721
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1678
|
-
- `num` **[number][
|
|
1679
|
-
|
|
1722
|
+
- `num` **[number][11]** number of elements.
|
|
1723
|
+
|
|
1724
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1680
1725
|
|
|
1681
1726
|
|
|
1682
1727
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1694,8 +1739,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1694
1739
|
#### Parameters
|
|
1695
1740
|
|
|
1696
1741
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1697
|
-
- `num` **[number][
|
|
1698
|
-
|
|
1742
|
+
- `num` **[number][11]** number of elements.
|
|
1743
|
+
|
|
1744
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1699
1745
|
|
|
1700
1746
|
|
|
1701
1747
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1712,8 +1758,9 @@ I.seeTextEquals('text', 'h1');
|
|
|
1712
1758
|
#### Parameters
|
|
1713
1759
|
|
|
1714
1760
|
- `text` **[string][6]** element value to check.
|
|
1715
|
-
- `context` **([string][6] | [object][4])?** element located by CSS|XPath|strict locator.
|
|
1716
|
-
|
|
1761
|
+
- `context` **([string][6] | [object][4])?** element located by CSS|XPath|strict locator.
|
|
1762
|
+
|
|
1763
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1717
1764
|
|
|
1718
1765
|
### seeTitleEquals
|
|
1719
1766
|
|
|
@@ -1726,7 +1773,8 @@ I.seeTitleEquals('Test title.');
|
|
|
1726
1773
|
#### Parameters
|
|
1727
1774
|
|
|
1728
1775
|
- `text` **[string][6]** value to check.
|
|
1729
|
-
|
|
1776
|
+
|
|
1777
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1730
1778
|
|
|
1731
1779
|
### selectOption
|
|
1732
1780
|
|
|
@@ -1753,7 +1801,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1753
1801
|
|
|
1754
1802
|
- `select` **([string][6] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
1755
1803
|
- `option` **([string][6] | [Array][15]<any>)** visible text or value of option.
|
|
1756
|
-
|
|
1804
|
+
|
|
1805
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1757
1806
|
|
|
1758
1807
|
### setCookie
|
|
1759
1808
|
|
|
@@ -1774,7 +1823,22 @@ I.setCookie([
|
|
|
1774
1823
|
#### Parameters
|
|
1775
1824
|
|
|
1776
1825
|
- `cookie` **(Cookie | [Array][15]<Cookie>)** a cookie object or array of cookie objects.
|
|
1777
|
-
|
|
1826
|
+
|
|
1827
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1828
|
+
|
|
1829
|
+
### setPuppeteerRequestHeaders
|
|
1830
|
+
|
|
1831
|
+
Set headers for all next requests
|
|
1832
|
+
|
|
1833
|
+
```js
|
|
1834
|
+
I.setPuppeteerRequestHeaders({
|
|
1835
|
+
'X-Sent-By': 'CodeceptJS',
|
|
1836
|
+
});
|
|
1837
|
+
```
|
|
1838
|
+
|
|
1839
|
+
#### Parameters
|
|
1840
|
+
|
|
1841
|
+
- `customHeaders` **[object][4]** headers to set
|
|
1778
1842
|
|
|
1779
1843
|
### switchTo
|
|
1780
1844
|
|
|
@@ -1787,8 +1851,9 @@ I.switchTo(); // switch back to main page
|
|
|
1787
1851
|
|
|
1788
1852
|
#### Parameters
|
|
1789
1853
|
|
|
1790
|
-
- `locator` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1791
|
-
|
|
1854
|
+
- `locator` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1855
|
+
|
|
1856
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1792
1857
|
|
|
1793
1858
|
### switchToNextTab
|
|
1794
1859
|
|
|
@@ -1801,7 +1866,7 @@ I.switchToNextTab(2);
|
|
|
1801
1866
|
|
|
1802
1867
|
#### Parameters
|
|
1803
1868
|
|
|
1804
|
-
- `num` **[number][
|
|
1869
|
+
- `num` **[number][11]**
|
|
1805
1870
|
|
|
1806
1871
|
### switchToPreviousTab
|
|
1807
1872
|
|
|
@@ -1814,7 +1879,7 @@ I.switchToPreviousTab(2);
|
|
|
1814
1879
|
|
|
1815
1880
|
#### Parameters
|
|
1816
1881
|
|
|
1817
|
-
- `num` **[number][
|
|
1882
|
+
- `num` **[number][11]**
|
|
1818
1883
|
|
|
1819
1884
|
### type
|
|
1820
1885
|
|
|
@@ -1839,10 +1904,11 @@ I.type(secret('123456'));
|
|
|
1839
1904
|
#### Parameters
|
|
1840
1905
|
|
|
1841
1906
|
- `keys`
|
|
1842
|
-
- `delay` **[number][
|
|
1843
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1907
|
+
- `delay` **[number][11]?** (optional) delay in ms between key presses
|
|
1844
1908
|
- `key` **([string][6] | [Array][15]<[string][6]>)** or array of keys to type.
|
|
1845
1909
|
|
|
1910
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1911
|
+
|
|
1846
1912
|
### uncheckOption
|
|
1847
1913
|
|
|
1848
1914
|
Unselects a checkbox or radio button.
|
|
@@ -1859,8 +1925,9 @@ I.uncheckOption('agree', '//form');
|
|
|
1859
1925
|
#### Parameters
|
|
1860
1926
|
|
|
1861
1927
|
- `field` **([string][6] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1862
|
-
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1863
|
-
|
|
1928
|
+
- `context` **([string][6]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1929
|
+
|
|
1930
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1864
1931
|
|
|
1865
1932
|
### usePuppeteerTo
|
|
1866
1933
|
|
|
@@ -1880,7 +1947,7 @@ I.usePuppeteerTo('emulate offline mode', async ({ page }) {
|
|
|
1880
1947
|
#### Parameters
|
|
1881
1948
|
|
|
1882
1949
|
- `description` **[string][6]** used to show in logs.
|
|
1883
|
-
- `fn` **[function][
|
|
1950
|
+
- `fn` **[function][13]** async function that is executed with Puppeteer as argument
|
|
1884
1951
|
|
|
1885
1952
|
### wait
|
|
1886
1953
|
|
|
@@ -1892,8 +1959,9 @@ I.wait(2); // wait 2 secs
|
|
|
1892
1959
|
|
|
1893
1960
|
#### Parameters
|
|
1894
1961
|
|
|
1895
|
-
- `sec` **[number][
|
|
1896
|
-
|
|
1962
|
+
- `sec` **[number][11]** number of second to wait.
|
|
1963
|
+
|
|
1964
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1897
1965
|
|
|
1898
1966
|
### waitForClickable
|
|
1899
1967
|
|
|
@@ -1909,8 +1977,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1909
1977
|
|
|
1910
1978
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1911
1979
|
- `waitTimeout`
|
|
1912
|
-
- `sec` **[number][
|
|
1913
|
-
|
|
1980
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1981
|
+
|
|
1982
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1914
1983
|
|
|
1915
1984
|
### waitForDetached
|
|
1916
1985
|
|
|
@@ -1924,8 +1993,9 @@ I.waitForDetached('#popup');
|
|
|
1924
1993
|
#### Parameters
|
|
1925
1994
|
|
|
1926
1995
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1927
|
-
- `sec` **[number][
|
|
1928
|
-
|
|
1996
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1997
|
+
|
|
1998
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1929
1999
|
|
|
1930
2000
|
### waitForElement
|
|
1931
2001
|
|
|
@@ -1940,8 +2010,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1940
2010
|
#### Parameters
|
|
1941
2011
|
|
|
1942
2012
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1943
|
-
- `sec` **[number][
|
|
1944
|
-
|
|
2013
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
2014
|
+
|
|
2015
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1945
2016
|
|
|
1946
2017
|
|
|
1947
2018
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1955,8 +2026,9 @@ Element can be located by CSS or XPath.
|
|
|
1955
2026
|
#### Parameters
|
|
1956
2027
|
|
|
1957
2028
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1958
|
-
- `sec` **[number][
|
|
1959
|
-
|
|
2029
|
+
- `sec` **[number][11]** (optional) time in seconds to wait, 1 by default.
|
|
2030
|
+
|
|
2031
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1960
2032
|
|
|
1961
2033
|
### waitForFunction
|
|
1962
2034
|
|
|
@@ -1975,10 +2047,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1975
2047
|
|
|
1976
2048
|
#### Parameters
|
|
1977
2049
|
|
|
1978
|
-
- `fn` **([string][6] | [function][
|
|
1979
|
-
- `argsOrSec` **([Array][15]<any> | [number][
|
|
1980
|
-
- `sec` **[number][
|
|
1981
|
-
|
|
2050
|
+
- `fn` **([string][6] | [function][13])** to be executed in browser context.
|
|
2051
|
+
- `argsOrSec` **([Array][15]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
2052
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
2053
|
+
|
|
2054
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1982
2055
|
|
|
1983
2056
|
### waitForInvisible
|
|
1984
2057
|
|
|
@@ -1992,8 +2065,9 @@ I.waitForInvisible('#popup');
|
|
|
1992
2065
|
#### Parameters
|
|
1993
2066
|
|
|
1994
2067
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1995
|
-
- `sec` **[number][
|
|
1996
|
-
|
|
2068
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2069
|
+
|
|
2070
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
1997
2071
|
|
|
1998
2072
|
### waitForNavigation
|
|
1999
2073
|
|
|
@@ -2016,8 +2090,8 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
2016
2090
|
|
|
2017
2091
|
#### Parameters
|
|
2018
2092
|
|
|
2019
|
-
- `urlOrPredicate` **([string][6] | [function][
|
|
2020
|
-
- `sec` **[number][
|
|
2093
|
+
- `urlOrPredicate` **([string][6] | [function][13])**
|
|
2094
|
+
- `sec` **[number][11]?** seconds to wait
|
|
2021
2095
|
|
|
2022
2096
|
### waitForResponse
|
|
2023
2097
|
|
|
@@ -2030,8 +2104,8 @@ I.waitForResponse(response => response.url() === 'http://example.com' && respons
|
|
|
2030
2104
|
|
|
2031
2105
|
#### Parameters
|
|
2032
2106
|
|
|
2033
|
-
- `urlOrPredicate` **([string][6] | [function][
|
|
2034
|
-
- `sec` **[number][
|
|
2107
|
+
- `urlOrPredicate` **([string][6] | [function][13])**
|
|
2108
|
+
- `sec` **[number][11]?** number of seconds to wait
|
|
2035
2109
|
|
|
2036
2110
|
### waitForText
|
|
2037
2111
|
|
|
@@ -2047,9 +2121,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2047
2121
|
#### Parameters
|
|
2048
2122
|
|
|
2049
2123
|
- `text` **[string][6]** to wait for.
|
|
2050
|
-
- `sec` **[number][
|
|
2051
|
-
- `context` **([string][6] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
|
|
2052
|
-
|
|
2124
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2125
|
+
- `context` **([string][6] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
|
|
2126
|
+
|
|
2127
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2053
2128
|
|
|
2054
2129
|
### waitForValue
|
|
2055
2130
|
|
|
@@ -2063,8 +2138,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2063
2138
|
|
|
2064
2139
|
- `field` **([string][6] | [object][4])** input field.
|
|
2065
2140
|
- `value` **[string][6]** expected value.
|
|
2066
|
-
- `sec` **[number][
|
|
2067
|
-
|
|
2141
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2142
|
+
|
|
2143
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2068
2144
|
|
|
2069
2145
|
### waitForVisible
|
|
2070
2146
|
|
|
@@ -2078,8 +2154,9 @@ I.waitForVisible('#popup');
|
|
|
2078
2154
|
#### Parameters
|
|
2079
2155
|
|
|
2080
2156
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
2081
|
-
- `sec` **[number][
|
|
2082
|
-
|
|
2157
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2158
|
+
|
|
2159
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorderThis method accepts [React selectors][24].
|
|
2083
2160
|
|
|
2084
2161
|
### waitInUrl
|
|
2085
2162
|
|
|
@@ -2092,8 +2169,9 @@ I.waitInUrl('/info', 2);
|
|
|
2092
2169
|
#### Parameters
|
|
2093
2170
|
|
|
2094
2171
|
- `urlPart` **[string][6]** value to check.
|
|
2095
|
-
- `sec` **[number][
|
|
2096
|
-
|
|
2172
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2173
|
+
|
|
2174
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2097
2175
|
|
|
2098
2176
|
### waitNumberOfVisibleElements
|
|
2099
2177
|
|
|
@@ -2106,13 +2184,14 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2106
2184
|
#### Parameters
|
|
2107
2185
|
|
|
2108
2186
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
2109
|
-
- `num` **[number][
|
|
2110
|
-
- `sec` **[number][
|
|
2111
|
-
|
|
2187
|
+
- `num` **[number][11]** number of elements.
|
|
2188
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2189
|
+
|
|
2190
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2112
2191
|
|
|
2113
2192
|
|
|
2114
2193
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
2115
|
-
|
|
2194
|
+
|
|
2116
2195
|
|
|
2117
2196
|
### waitToHide
|
|
2118
2197
|
|
|
@@ -2126,8 +2205,9 @@ I.waitToHide('#popup');
|
|
|
2126
2205
|
#### Parameters
|
|
2127
2206
|
|
|
2128
2207
|
- `locator` **([string][6] | [object][4])** element located by CSS|XPath|strict locator.
|
|
2129
|
-
- `sec` **[number][
|
|
2130
|
-
|
|
2208
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2209
|
+
|
|
2210
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2131
2211
|
|
|
2132
2212
|
### waitUrlEquals
|
|
2133
2213
|
|
|
@@ -2141,8 +2221,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2141
2221
|
#### Parameters
|
|
2142
2222
|
|
|
2143
2223
|
- `urlPart` **[string][6]** value to check.
|
|
2144
|
-
- `sec` **[number][
|
|
2145
|
-
|
|
2224
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2225
|
+
|
|
2226
|
+
Returns **[Promise][7]<void>** automatically synchronized promise through #recorder
|
|
2146
2227
|
|
|
2147
2228
|
[1]: https://github.com/GoogleChrome/puppeteer
|
|
2148
2229
|
|
|
@@ -2156,19 +2237,19 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2156
2237
|
|
|
2157
2238
|
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2158
2239
|
|
|
2159
|
-
[7]: https://
|
|
2240
|
+
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2160
2241
|
|
|
2161
|
-
[8]: https://
|
|
2242
|
+
[8]: https://github.com/puppeteer/puppeteer/issues/5420
|
|
2162
2243
|
|
|
2163
|
-
[9]: https://
|
|
2244
|
+
[9]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
|
|
2164
2245
|
|
|
2165
|
-
[10]: https://
|
|
2246
|
+
[10]: https://playwright.dev/docs/api/class-locator#locator-blur
|
|
2166
2247
|
|
|
2167
|
-
[11]: https://
|
|
2248
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2168
2249
|
|
|
2169
|
-
[12]: https://
|
|
2250
|
+
[12]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2170
2251
|
|
|
2171
|
-
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2252
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2172
2253
|
|
|
2173
2254
|
[14]: https://playwright.dev/docs/api/class-locator#locator-focus
|
|
2174
2255
|
|
|
@@ -2192,4 +2273,6 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2192
2273
|
|
|
2193
2274
|
[24]: https://codecept.io/react
|
|
2194
2275
|
|
|
2195
|
-
[25]: https://
|
|
2276
|
+
[25]: https://pptr.dev/api/puppeteer.tracing
|
|
2277
|
+
|
|
2278
|
+
[26]: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions
|