codeceptjs 2.1.3 → 2.2.1

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.
Files changed (173) hide show
  1. package/CHANGELOG.md +125 -37
  2. package/README.md +15 -22
  3. package/bin/codecept.js +4 -1
  4. package/docs/acceptance.md +44 -1
  5. package/docs/advanced.md +1 -1
  6. package/docs/angular.md +6 -9
  7. package/docs/basics.md +388 -75
  8. package/docs/bdd.md +4 -3
  9. package/docs/best.md +1 -1
  10. package/docs/books.md +31 -0
  11. package/docs/build/Appium.js +215 -176
  12. package/docs/build/Nightmare.js +618 -489
  13. package/docs/build/Polly.js +189 -0
  14. package/docs/build/Protractor.js +747 -608
  15. package/docs/build/Puppeteer.js +914 -633
  16. package/docs/build/REST.js +1 -1
  17. package/docs/build/TestCafe.js +1835 -0
  18. package/docs/build/WebDriver.js +861 -805
  19. package/docs/build/WebDriverIO.js +616 -617
  20. package/docs/changelog.md +410 -316
  21. package/docs/commands.md +6 -6
  22. package/docs/community-helpers.md +2 -0
  23. package/docs/detox.md +235 -0
  24. package/docs/examples.md +23 -0
  25. package/docs/helpers/ApiDataFactory.md +11 -10
  26. package/docs/helpers/Appium.md +130 -61
  27. package/docs/helpers/Detox.md +579 -0
  28. package/docs/helpers/FileSystem.md +2 -1
  29. package/docs/helpers/Mochawesome.md +1 -0
  30. package/docs/helpers/Nightmare.md +348 -128
  31. package/docs/helpers/Polly.md +85 -0
  32. package/docs/helpers/Protractor.md +451 -184
  33. package/docs/helpers/Puppeteer-firefox.md +55 -0
  34. package/docs/helpers/Puppeteer.md +619 -183
  35. package/docs/helpers/REST.md +17 -16
  36. package/docs/helpers/SeleniumWebdriver.md +9 -8
  37. package/docs/helpers/TestCafe.md +1168 -0
  38. package/docs/helpers/WebDriver.md +600 -291
  39. package/docs/helpers/WebDriverIO.md +393 -278
  40. package/docs/helpers.md +37 -18
  41. package/docs/locators.md +2 -0
  42. package/docs/mobile-react-native-locators.md +64 -0
  43. package/docs/mobile.md +5 -0
  44. package/docs/plugins.md +54 -13
  45. package/docs/puppeteer.md +74 -26
  46. package/docs/quickstart.md +47 -12
  47. package/docs/react.md +67 -0
  48. package/docs/reports.md +1 -1
  49. package/docs/{webapi/_keys.mustache → shared/keys.mustache} +0 -0
  50. package/docs/shared/react.mustache +1 -0
  51. package/docs/testcafe.md +157 -0
  52. package/docs/videos.md +19 -0
  53. package/docs/webapi/amOnPage.mustache +1 -1
  54. package/docs/webapi/appendField.mustache +2 -2
  55. package/docs/webapi/attachFile.mustache +2 -2
  56. package/docs/webapi/checkOption.mustache +2 -2
  57. package/docs/webapi/clearCookie.mustache +1 -1
  58. package/docs/webapi/clearField.mustache +1 -1
  59. package/docs/webapi/click.mustache +2 -2
  60. package/docs/webapi/clickLink.mustache +3 -3
  61. package/docs/webapi/dontSee.mustache +6 -3
  62. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +7 -1
  63. package/docs/webapi/dontSeeCookie.mustache +5 -1
  64. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +6 -1
  65. package/docs/webapi/dontSeeElement.mustache +5 -1
  66. package/docs/webapi/dontSeeElementInDOM.mustache +5 -1
  67. package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
  68. package/docs/webapi/dontSeeInField.mustache +7 -2
  69. package/docs/webapi/dontSeeInSource.mustache +5 -1
  70. package/docs/webapi/dontSeeInTitle.mustache +5 -1
  71. package/docs/webapi/doubleClick.mustache +2 -2
  72. package/docs/webapi/downloadFile.mustache +2 -2
  73. package/docs/webapi/dragAndDrop.mustache +2 -2
  74. package/docs/webapi/dragSlider.mustache +2 -2
  75. package/docs/webapi/executeAsyncScript.mustache +1 -1
  76. package/docs/webapi/executeScript.mustache +1 -1
  77. package/docs/webapi/fillField.mustache +2 -2
  78. package/docs/webapi/grabAttributeFrom.mustache +3 -2
  79. package/docs/webapi/grabBrowserLogs.mustache +3 -1
  80. package/docs/webapi/grabCookie.mustache +2 -1
  81. package/docs/webapi/grabCssPropertyFrom.mustache +3 -2
  82. package/docs/webapi/grabCurrentUrl.mustache +3 -1
  83. package/docs/webapi/grabDataFromPerformanceTiming.mustache +19 -0
  84. package/docs/webapi/grabHTMLFrom.mustache +2 -1
  85. package/docs/webapi/grabNumberOfOpenTabs.mustache +4 -2
  86. package/docs/webapi/grabNumberOfVisibleElements.mustache +3 -2
  87. package/docs/webapi/grabPageScrollPosition.mustache +3 -1
  88. package/docs/webapi/grabSource.mustache +3 -1
  89. package/docs/webapi/grabTextFrom.mustache +2 -1
  90. package/docs/webapi/grabTitle.mustache +3 -1
  91. package/docs/webapi/grabValueFrom.mustache +2 -1
  92. package/docs/webapi/moveCursorTo.mustache +3 -3
  93. package/docs/webapi/pressKey.mustache +1 -1
  94. package/docs/webapi/resizeWindow.mustache +2 -2
  95. package/docs/webapi/rightClick.mustache +2 -2
  96. package/docs/webapi/saveScreenshot.mustache +3 -3
  97. package/docs/webapi/say.mustache +2 -2
  98. package/docs/webapi/scrollPageToBottom.mustache +1 -1
  99. package/docs/webapi/scrollPageToTop.mustache +1 -1
  100. package/docs/webapi/scrollTo.mustache +3 -3
  101. package/docs/webapi/see.mustache +2 -2
  102. package/docs/webapi/seeAttributesOnElements.mustache +3 -3
  103. package/docs/webapi/seeCheckboxIsChecked.mustache +2 -1
  104. package/docs/webapi/seeCookie.mustache +1 -1
  105. package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -2
  106. package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
  107. package/docs/webapi/seeElement.mustache +1 -1
  108. package/docs/webapi/seeElementInDOM.mustache +1 -1
  109. package/docs/webapi/seeInCurrentUrl.mustache +1 -1
  110. package/docs/webapi/seeInField.mustache +2 -2
  111. package/docs/webapi/seeInSource.mustache +1 -1
  112. package/docs/webapi/seeInTitle.mustache +5 -1
  113. package/docs/webapi/seeNumberOfElements.mustache +10 -0
  114. package/docs/webapi/seeNumberOfVisibleElements.mustache +2 -2
  115. package/docs/webapi/selectOption.mustache +2 -2
  116. package/docs/webapi/setCookie.mustache +1 -1
  117. package/docs/webapi/switchTo.mustache +6 -1
  118. package/docs/webapi/uncheckOption.mustache +2 -2
  119. package/docs/webapi/wait.mustache +1 -2
  120. package/docs/webapi/waitForDetached.mustache +3 -3
  121. package/docs/webapi/waitForElement.mustache +2 -2
  122. package/docs/webapi/waitForEnabled.mustache +1 -1
  123. package/docs/webapi/waitForFunction.mustache +3 -3
  124. package/docs/webapi/waitForInvisible.mustache +3 -3
  125. package/docs/webapi/waitForText.mustache +3 -3
  126. package/docs/webapi/waitForValue.mustache +3 -3
  127. package/docs/webapi/waitForVisible.mustache +3 -3
  128. package/docs/webapi/waitInUrl.mustache +2 -2
  129. package/docs/webapi/waitNumberOfVisibleElements.mustache +3 -3
  130. package/docs/webapi/waitToHide.mustache +3 -3
  131. package/docs/webapi/waitUntil.mustache +3 -3
  132. package/docs/webapi/waitUrlEquals.mustache +2 -2
  133. package/docs/webdriver.md +453 -0
  134. package/lib/codecept.js +11 -9
  135. package/lib/command/definitions.js +183 -30
  136. package/lib/command/gherkin/snippets.js +29 -9
  137. package/lib/command/init.js +31 -9
  138. package/lib/command/run-multiple.js +46 -59
  139. package/lib/command/utils.js +1 -1
  140. package/lib/container.js +30 -4
  141. package/lib/data/dataScenarioConfig.js +18 -0
  142. package/lib/helper/Appium.js +24 -24
  143. package/lib/helper/Nightmare.js +81 -84
  144. package/lib/helper/Polly.js +189 -0
  145. package/lib/helper/Protractor.js +96 -86
  146. package/lib/helper/Puppeteer.js +238 -113
  147. package/lib/helper/REST.js +1 -1
  148. package/lib/helper/TestCafe.js +1257 -0
  149. package/lib/helper/WebDriver.js +217 -277
  150. package/lib/helper/WebDriverIO.js +75 -75
  151. package/lib/helper/clientscripts/nightmare.js +8 -0
  152. package/lib/helper/extras/React.js +55 -0
  153. package/lib/helper/testcafe/testControllerHolder.js +42 -0
  154. package/lib/helper/testcafe/testcafe-utils.js +63 -0
  155. package/lib/history.js +39 -0
  156. package/lib/hooks.js +25 -1
  157. package/lib/interfaces/gherkin.js +17 -1
  158. package/lib/interfaces/scenarioConfig.js +2 -2
  159. package/lib/listener/config.js +3 -3
  160. package/lib/locator.js +6 -0
  161. package/lib/pause.js +22 -1
  162. package/lib/plugin/allure.js +63 -0
  163. package/lib/plugin/autoLogin.js +65 -16
  164. package/lib/plugin/puppeteerCoverage.js +6 -1
  165. package/lib/plugin/stepByStepReport.js +4 -3
  166. package/lib/scenario.js +23 -17
  167. package/lib/step.js +5 -2
  168. package/lib/ui.js +1 -1
  169. package/lib/utils.js +70 -20
  170. package/package.json +20 -19
  171. package/translations/de-DE.js +69 -0
  172. package/translations/index.js +1 -0
  173. package/docs/video.md +0 -26
@@ -81,6 +81,9 @@ class Nightmare extends Helper {
81
81
  static _config() {
82
82
  return [
83
83
  { name: 'url', message: 'Base url of site to be tested', default: 'http://localhost' },
84
+ {
85
+ name: 'show', message: 'Show browser window', default: true, type: 'confirm',
86
+ },
84
87
  ];
85
88
  }
86
89
 
@@ -392,13 +395,9 @@ class Nightmare extends Helper {
392
395
  }
393
396
 
394
397
  /**
395
- * {{> ../webapi/amOnPage }}
396
- *
397
- * In a second argument a list of request headers can be passed:
398
+ * {{> amOnPage }}
399
+ * @param headers {object} list of request headers can be passed
398
400
  *
399
- * ```js
400
- * I.amOnPage('/auth', { 'x-my-custom-header': 'some value' })
401
- * ```
402
401
  */
403
402
  async amOnPage(url, headers = null) {
404
403
  if (!(/^\w+\:\/\//.test(url))) {
@@ -417,7 +416,7 @@ class Nightmare extends Helper {
417
416
  }
418
417
 
419
418
  /**
420
- * {{> ../webapi/seeInTitle }}
419
+ * {{> seeInTitle }}
421
420
  */
422
421
  async seeInTitle(text) {
423
422
  const title = await this.browser.title();
@@ -425,7 +424,7 @@ class Nightmare extends Helper {
425
424
  }
426
425
 
427
426
  /**
428
- * {{> ../webapi/dontSeeInTitle }}
427
+ * {{> dontSeeInTitle }}
429
428
  */
430
429
  async dontSeeInTitle(text) {
431
430
  const title = await this.browser.title();
@@ -433,21 +432,21 @@ class Nightmare extends Helper {
433
432
  }
434
433
 
435
434
  /**
436
- * {{> ../webapi/grabTitle }}
435
+ * {{> grabTitle }}
437
436
  */
438
437
  async grabTitle() {
439
438
  return this.browser.title();
440
439
  }
441
440
 
442
441
  /**
443
- * {{> ../webapi/grabCurrentUrl }}
442
+ * {{> grabCurrentUrl }}
444
443
  */
445
444
  async grabCurrentUrl() {
446
445
  return this.browser.url();
447
446
  }
448
447
 
449
448
  /**
450
- * {{> ../webapi/seeInCurrentUrl }}
449
+ * {{> seeInCurrentUrl }}
451
450
  */
452
451
  async seeInCurrentUrl(url) {
453
452
  const currentUrl = await this.browser.url();
@@ -455,7 +454,7 @@ class Nightmare extends Helper {
455
454
  }
456
455
 
457
456
  /**
458
- * {{> ../webapi/dontSeeInCurrentUrl }}
457
+ * {{> dontSeeInCurrentUrl }}
459
458
  */
460
459
  async dontSeeInCurrentUrl(url) {
461
460
  const currentUrl = await this.browser.url();
@@ -463,7 +462,7 @@ class Nightmare extends Helper {
463
462
  }
464
463
 
465
464
  /**
466
- * {{> ../webapi/seeCurrentUrlEquals }}
465
+ * {{> seeCurrentUrlEquals }}
467
466
  */
468
467
  async seeCurrentUrlEquals(url) {
469
468
  const currentUrl = await this.browser.url();
@@ -471,7 +470,7 @@ class Nightmare extends Helper {
471
470
  }
472
471
 
473
472
  /**
474
- * {{> ../webapi/dontSeeCurrentUrlEquals }}
473
+ * {{> dontSeeCurrentUrlEquals }}
475
474
  */
476
475
  async dontSeeCurrentUrlEquals(url) {
477
476
  const currentUrl = await this.browser.url();
@@ -479,21 +478,21 @@ class Nightmare extends Helper {
479
478
  }
480
479
 
481
480
  /**
482
- * {{> ../webapi/see }}
481
+ * {{> see }}
483
482
  */
484
483
  async see(text, context = null) {
485
484
  return proceedSee.call(this, 'assert', text, context);
486
485
  }
487
486
 
488
487
  /**
489
- * {{> ../webapi/dontSee }}
488
+ * {{> dontSee }}
490
489
  */
491
490
  dontSee(text, context = null) {
492
491
  return proceedSee.call(this, 'negate', text, context);
493
492
  }
494
493
 
495
494
  /**
496
- * {{> ../webapi/seeElement }}
495
+ * {{> seeElement }}
497
496
  */
498
497
  async seeElement(locator) {
499
498
  locator = new Locator(locator, 'css');
@@ -504,7 +503,7 @@ class Nightmare extends Helper {
504
503
  }
505
504
 
506
505
  /**
507
- * {{> ../webapi/dontSeeElement }}
506
+ * {{> dontSeeElement }}
508
507
  */
509
508
  async dontSeeElement(locator) {
510
509
  locator = new Locator(locator, 'css');
@@ -516,7 +515,7 @@ class Nightmare extends Helper {
516
515
  }
517
516
 
518
517
  /**
519
- * {{> ../webapi/seeElementInDOM }}
518
+ * {{> seeElementInDOM }}
520
519
  */
521
520
  async seeElementInDOM(locator) {
522
521
  locator = new Locator(locator, 'css');
@@ -525,7 +524,7 @@ class Nightmare extends Helper {
525
524
  }
526
525
 
527
526
  /**
528
- * {{> ../webapi/dontSeeElementInDOM }}
527
+ * {{> dontSeeElementInDOM }}
529
528
  */
530
529
  async dontSeeElementInDOM(locator) {
531
530
  locator = new Locator(locator, 'css');
@@ -534,7 +533,7 @@ class Nightmare extends Helper {
534
533
  }
535
534
 
536
535
  /**
537
- * {{> ../webapi/seeInSource }}
536
+ * {{> seeInSource }}
538
537
  */
539
538
  async seeInSource(text) {
540
539
  const source = await this.browser.evaluate(() => document.documentElement.outerHTML);
@@ -542,7 +541,7 @@ class Nightmare extends Helper {
542
541
  }
543
542
 
544
543
  /**
545
- * {{> ../webapi/dontSeeInSource }}
544
+ * {{> dontSeeInSource }}
546
545
  */
547
546
  async dontSeeInSource(text) {
548
547
  const source = await this.browser.evaluate(() => document.documentElement.outerHTML);
@@ -550,20 +549,15 @@ class Nightmare extends Helper {
550
549
  }
551
550
 
552
551
  /**
553
- * asserts that an element appears a given number of times in the DOM
554
- * Element is located by label or name or CSS or XPath.
555
- *
556
- * ```js
557
- * I.seeNumberOfElements('#submitBtn', 1);
558
- * ```
552
+ * {{> seeNumberOfElements }}
559
553
  */
560
- async seeNumberOfElements(selector, num) {
561
- const elements = await this._locate(selector);
562
- return equals(`expected number of elements (${selector}) is ${num}, but found ${elements.length}`).assert(elements.length, num);
554
+ async seeNumberOfElements(locator, num) {
555
+ const elements = await this._locate(locator);
556
+ return equals(`expected number of elements (${locator}) is ${num}, but found ${elements.length}`).assert(elements.length, num);
563
557
  }
564
558
 
565
559
  /**
566
- * {{> ../webapi/seeNumberOfVisibleElements }}
560
+ * {{> seeNumberOfVisibleElements }}
567
561
  */
568
562
  async seeNumberOfVisibleElements(locator, num) {
569
563
  const res = await this.grabNumberOfVisibleElements(locator);
@@ -571,7 +565,7 @@ class Nightmare extends Helper {
571
565
  }
572
566
 
573
567
  /**
574
- * {{> ../webapi/grabNumberOfVisibleElements }}
568
+ * {{> grabNumberOfVisibleElements }}
575
569
  */
576
570
  async grabNumberOfVisibleElements(locator) {
577
571
  locator = new Locator(locator, 'css');
@@ -585,7 +579,7 @@ class Nightmare extends Helper {
585
579
  }
586
580
 
587
581
  /**
588
- * {{> ../webapi/click }}
582
+ * {{> click }}
589
583
  */
590
584
  async click(locator, context = null) {
591
585
  const el = await findClickable.call(this, locator, context);
@@ -595,7 +589,7 @@ class Nightmare extends Helper {
595
589
  }
596
590
 
597
591
  /**
598
- * {{> ../webapi/doubleClick }}
592
+ * {{> doubleClick }}
599
593
  */
600
594
  async doubleClick(locator, context = null) {
601
595
  const el = await findClickable.call(this, locator, context);
@@ -606,7 +600,7 @@ class Nightmare extends Helper {
606
600
 
607
601
 
608
602
  /**
609
- * {{> ../webapi/rightClick }}
603
+ * {{> rightClick }}
610
604
  */
611
605
  async rightClick(locator, context = null) {
612
606
  const el = await findClickable.call(this, locator, context);
@@ -617,7 +611,7 @@ class Nightmare extends Helper {
617
611
 
618
612
 
619
613
  /**
620
- * {{> ../webapi/moveCursorTo }}
614
+ * {{> moveCursorTo }}
621
615
  */
622
616
  async moveCursorTo(locator, offsetX = 0, offsetY = 0) {
623
617
  locator = new Locator(locator, 'css');
@@ -629,7 +623,7 @@ class Nightmare extends Helper {
629
623
 
630
624
 
631
625
  /**
632
- * {{> ../webapi/executeScript }}
626
+ * {{> executeScript }}
633
627
  *
634
628
  * Wrapper for synchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2)
635
629
  */
@@ -639,7 +633,7 @@ class Nightmare extends Helper {
639
633
  }
640
634
 
641
635
  /**
642
- * {{> ../webapi/executeAsyncScript }}
636
+ * {{> executeAsyncScript }}
643
637
  *
644
638
  * Wrapper for asynchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2).
645
639
  * Unlike NightmareJS implementation calling `done` will return its first argument.
@@ -650,7 +644,7 @@ class Nightmare extends Helper {
650
644
  }
651
645
 
652
646
  /**
653
- * {{> ../webapi/resizeWindow }}
647
+ * {{> resizeWindow }}
654
648
  */
655
649
  async resizeWindow(width, height) {
656
650
  if (width === 'maximize') {
@@ -660,7 +654,7 @@ class Nightmare extends Helper {
660
654
  }
661
655
 
662
656
  /**
663
- * {{> ../webapi/checkOption }}
657
+ * {{> checkOption }}
664
658
  */
665
659
  async checkOption(field, context = null) {
666
660
  const els = await findCheckable.call(this, field, context);
@@ -670,7 +664,17 @@ class Nightmare extends Helper {
670
664
  }
671
665
 
672
666
  /**
673
- * {{> ../webapi/fillField }}
667
+ * {{> uncheckOption }}
668
+ */
669
+ async uncheckOption(field, context = null) {
670
+ const els = await findCheckable.call(this, field, context);
671
+ assertElementExists(els[0], field, 'Checkbox or radio');
672
+ return this.browser.evaluate(els => window.codeceptjs.unCheckEl(els[0]), els)
673
+ .wait(this.options.waitForAction);
674
+ }
675
+
676
+ /**
677
+ * {{> fillField }}
674
678
  */
675
679
  async fillField(field, value) {
676
680
  const el = await findField.call(this, field);
@@ -680,14 +684,14 @@ class Nightmare extends Helper {
680
684
  }
681
685
 
682
686
  /**
683
- * {{> ../webapi/clearField }}
687
+ * {{> clearField }}
684
688
  */
685
689
  async clearField(field) {
686
690
  return this.fillField(field, '');
687
691
  }
688
692
 
689
693
  /**
690
- * {{> ../webapi/appendField }}
694
+ * {{> appendField }}
691
695
  */
692
696
  async appendField(field, value) {
693
697
  const el = await findField.call(this, field);
@@ -697,14 +701,14 @@ class Nightmare extends Helper {
697
701
  }
698
702
 
699
703
  /**
700
- * {{> ../webapi/seeInField }}
704
+ * {{> seeInField }}
701
705
  */
702
706
  async seeInField(field, value) {
703
707
  return proceedSeeInField.call(this, 'assert', field, value);
704
708
  }
705
709
 
706
710
  /**
707
- * {{> ../webapi/dontSeeInField }}
711
+ * {{> dontSeeInField }}
708
712
  */
709
713
  async dontSeeInField(field, value) {
710
714
  return proceedSeeInField.call(this, 'negate', field, value);
@@ -739,26 +743,25 @@ class Nightmare extends Helper {
739
743
  }
740
744
 
741
745
  /**
742
- * {{> ../webapi/seeCheckboxIsChecked }}
746
+ * {{> seeCheckboxIsChecked }}
743
747
  */
744
748
  async seeCheckboxIsChecked(field) {
745
749
  return proceedIsChecked.call(this, 'assert', field);
746
750
  }
747
751
 
748
752
  /**
749
- * {{> ../webapi/dontSeeCheckboxIsChecked }}
753
+ * {{> dontSeeCheckboxIsChecked }}
750
754
  */
751
755
  async dontSeeCheckboxIsChecked(field) {
752
756
  return proceedIsChecked.call(this, 'negate', field);
753
757
  }
754
758
 
755
759
  /**
756
- * {{> ../webapi/attachFile }}
760
+ * {{> attachFile }}
757
761
  *
758
- * ##### Limitations:
762
+ * Doesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more](https://github.com/rosshinkley/nightmare-upload#important-note-about-setting-file-upload-inputs))
759
763
  *
760
- * * works only with CSS selectors.
761
- * * doesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more](https://github.com/rosshinkley/nightmare-upload#important-note-about-setting-file-upload-inputs))
764
+ * @param locator CSS locator (XPath not allowed)
762
765
  */
763
766
  async attachFile(locator, pathToFile) {
764
767
  const file = path.join(global.codecept_dir, pathToFile);
@@ -775,7 +778,7 @@ class Nightmare extends Helper {
775
778
  }
776
779
 
777
780
  /**
778
- * {{> ../webapi/grabTextFrom }}
781
+ * {{> grabTextFrom }}
779
782
  */
780
783
  async grabTextFrom(locator) {
781
784
  locator = new Locator(locator, 'css');
@@ -791,7 +794,7 @@ class Nightmare extends Helper {
791
794
  }
792
795
 
793
796
  /**
794
- * {{> ../webapi/grabValueFrom }}
797
+ * {{> grabValueFrom }}
795
798
  */
796
799
  async grabValueFrom(locator) {
797
800
  const el = await findField.call(this, locator);
@@ -800,7 +803,7 @@ class Nightmare extends Helper {
800
803
  }
801
804
 
802
805
  /**
803
- * {{> ../webapi/grabAttributeFrom }}
806
+ * {{> grabAttributeFrom }}
804
807
  */
805
808
  async grabAttributeFrom(locator, attr) {
806
809
  locator = new Locator(locator, 'css');
@@ -817,7 +820,7 @@ class Nightmare extends Helper {
817
820
  }
818
821
 
819
822
  /**
820
- * {{> ../webapi/grabHTMLFrom }}
823
+ * {{> grabHTMLFrom }}
821
824
  */
822
825
  async grabHTMLFrom(locator) {
823
826
  locator = new Locator(locator, 'css');
@@ -840,7 +843,7 @@ class Nightmare extends Helper {
840
843
  }
841
844
 
842
845
  /**
843
- * {{> ../webapi/selectOption }}
846
+ * {{> selectOption }}
844
847
  */
845
848
  async selectOption(select, option) {
846
849
  const fetchAndCheckOption = function (el, locator) {
@@ -883,7 +886,7 @@ class Nightmare extends Helper {
883
886
  }
884
887
 
885
888
  /**
886
- * {{> ../webapi/setCookie }}
889
+ * {{> setCookie }}
887
890
  *
888
891
  * Wrapper for `.cookies.set(cookie)`.
889
892
  * [See more](https://github.com/segmentio/nightmare/blob/master/Readme.md#cookiessetcookie)
@@ -893,7 +896,7 @@ class Nightmare extends Helper {
893
896
  }
894
897
 
895
898
  /**
896
- * {{> ../webapi/seeCookie}}
899
+ * {{> seeCookie }}
897
900
  *
898
901
  */
899
902
  async seeCookie(name) {
@@ -902,7 +905,7 @@ class Nightmare extends Helper {
902
905
  }
903
906
 
904
907
  /**
905
- * {{> ../webapi/dontSeeCookie}}
908
+ * {{> dontSeeCookie }}
906
909
  */
907
910
  async dontSeeCookie(name) {
908
911
  const res = await this.browser.cookies.get(name);
@@ -910,24 +913,18 @@ class Nightmare extends Helper {
910
913
  }
911
914
 
912
915
  /**
913
- * {{> ../webapi/grabCookie}}
916
+ * {{> grabCookie }}
914
917
  *
915
- * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
916
- *
917
- * Multiple cookies can be received by passing query object:
918
- *
919
- * ```js
920
- * I.grabCookie({ secure: true});
921
- * ```
918
+ * @returns Promise<object> Cookie in JSON format. If name not passed returns all cookies for this domain.
922
919
  *
923
- * If you'd like get all cookies for all urls, use: `.grabCookie({ url: null }).`
920
+ * Multiple cookies can be received by passing query object `I.grabCookie({ secure: true});`. If you'd like get all cookies for all urls, use: `.grabCookie({ url: null }).`
924
921
  */
925
922
  async grabCookie(name) {
926
923
  return this.browser.cookies.get(name);
927
924
  }
928
925
 
929
926
  /**
930
- * {{> ../webapi/clearCookie}}
927
+ * {{> clearCookie }}
931
928
  */
932
929
  async clearCookie(cookie) {
933
930
  if (!cookie) {
@@ -937,7 +934,7 @@ class Nightmare extends Helper {
937
934
  }
938
935
 
939
936
  /**
940
- * {{> ../webapi/waitForFunction }}
937
+ * {{> waitForFunction }}
941
938
  */
942
939
  async waitForFunction(fn, argsOrSec = null, sec = null) {
943
940
  let args = [];
@@ -953,7 +950,7 @@ class Nightmare extends Helper {
953
950
  }
954
951
 
955
952
  /**
956
- * {{> ../webapi/wait }}
953
+ * {{> wait }}
957
954
  */
958
955
  async wait(sec) {
959
956
  return new Promise(((done) => {
@@ -962,7 +959,7 @@ class Nightmare extends Helper {
962
959
  }
963
960
 
964
961
  /**
965
- * {{> ../webapi/waitForText }}
962
+ * {{> waitForText }}
966
963
  */
967
964
  async waitForText(text, sec, context = null) {
968
965
  if (!context) {
@@ -982,7 +979,7 @@ class Nightmare extends Helper {
982
979
  }
983
980
 
984
981
  /**
985
- * {{> ../webapi/waitForVisible }}
982
+ * {{> waitForVisible }}
986
983
  */
987
984
  waitForVisible(locator, sec) {
988
985
  this.browser.options.waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1000,14 +997,14 @@ class Nightmare extends Helper {
1000
997
  }
1001
998
 
1002
999
  /**
1003
- * {{> ../webapi/waitToHide }}
1000
+ * {{> waitToHide }}
1004
1001
  */
1005
1002
  async waitToHide(locator, sec = null) {
1006
1003
  return this.waitForInvisible(locator, sec);
1007
1004
  }
1008
1005
 
1009
1006
  /**
1010
- * {{> ../webapi/waitForInvisible }}
1007
+ * {{> waitForInvisible }}
1011
1008
  */
1012
1009
  waitForInvisible(locator, sec) {
1013
1010
  this.browser.options.waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1025,7 +1022,7 @@ class Nightmare extends Helper {
1025
1022
  }
1026
1023
 
1027
1024
  /**
1028
- * {{> ../webapi/waitForElement }}
1025
+ * {{> waitForElement }}
1029
1026
  */
1030
1027
  async waitForElement(locator, sec) {
1031
1028
  this.browser.options.waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1046,7 +1043,7 @@ class Nightmare extends Helper {
1046
1043
  }
1047
1044
 
1048
1045
  /**
1049
- * {{> ../webapi/waitForDetached }}
1046
+ * {{> waitForDetached }}
1050
1047
  */
1051
1048
  async waitForDetached(locator, sec) {
1052
1049
  this.browser.options.waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1061,7 +1058,7 @@ class Nightmare extends Helper {
1061
1058
  }
1062
1059
 
1063
1060
  /**
1064
- * {{> ../webapi/refreshPage }}
1061
+ * {{> refreshPage }}
1065
1062
  */
1066
1063
  async refreshPage() {
1067
1064
  return this.browser.refresh();
@@ -1076,7 +1073,7 @@ class Nightmare extends Helper {
1076
1073
  }
1077
1074
 
1078
1075
  /**
1079
- * {{> ../webapi/saveScreenshot }}
1076
+ * {{> saveScreenshot }}
1080
1077
  */
1081
1078
  async saveScreenshot(fileName, fullPage = this.options.fullPageScreenshots) {
1082
1079
  const outputFile = screenshotOutputFolder(fileName);
@@ -1099,7 +1096,7 @@ class Nightmare extends Helper {
1099
1096
  }
1100
1097
 
1101
1098
  /**
1102
- * {{> ../webapi/scrollTo }}
1099
+ * {{> scrollTo }}
1103
1100
  */
1104
1101
  async scrollTo(locator, offsetX = 0, offsetY = 0) {
1105
1102
  if (typeof locator === 'number' && typeof offsetX === 'number') {
@@ -1121,14 +1118,14 @@ class Nightmare extends Helper {
1121
1118
  }
1122
1119
 
1123
1120
  /**
1124
- * {{> ../webapi/scrollPageToTop }}
1121
+ * {{> scrollPageToTop }}
1125
1122
  */
1126
1123
  async scrollPageToTop() {
1127
1124
  return this.executeScript(() => window.scrollTo(0, 0));
1128
1125
  }
1129
1126
 
1130
1127
  /**
1131
- * {{> ../webapi/scrollPageToBottom }}
1128
+ * {{> scrollPageToBottom }}
1132
1129
  */
1133
1130
  async scrollPageToBottom() {
1134
1131
  /* eslint-disable prefer-arrow-callback, comma-dangle */
@@ -1144,7 +1141,7 @@ class Nightmare extends Helper {
1144
1141
  }
1145
1142
 
1146
1143
  /**
1147
- * {{> ../webapi/grabPageScrollPosition}}
1144
+ * {{> grabPageScrollPosition }}
1148
1145
  */
1149
1146
  async grabPageScrollPosition() {
1150
1147
  /* eslint-disable comma-dangle */