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
@@ -13,7 +13,6 @@ const truth = require('../assert/truth').truth;
13
13
  const {
14
14
  xpathLocator,
15
15
  fileExists,
16
- clearString,
17
16
  convertCssPropertiesToCamelCase,
18
17
  screenshotOutputFolder,
19
18
  } = require('../utils');
@@ -25,7 +24,6 @@ const ElementNotFound = require('./errors/ElementNotFound');
25
24
  const ConnectionRefused = require('./errors/ConnectionRefused');
26
25
  const Locator = require('../locator');
27
26
  const path = require('path');
28
- const recorder = require('../recorder');
29
27
 
30
28
  let withinStore = {};
31
29
  let Runner;
@@ -424,7 +422,7 @@ class Protractor extends Helper {
424
422
  }
425
423
 
426
424
  /**
427
- * {{> ../webapi/amOnPage }}
425
+ * {{> amOnPage }}
428
426
  */
429
427
  async amOnPage(url) {
430
428
  if (!(/^\w+\:\/\//.test(url))) {
@@ -436,7 +434,7 @@ class Protractor extends Helper {
436
434
  }
437
435
 
438
436
  /**
439
- * {{> ../webapi/click }}
437
+ * {{> click }}
440
438
  */
441
439
  async click(locator, context = null) {
442
440
  let matcher = this.browser;
@@ -450,7 +448,7 @@ class Protractor extends Helper {
450
448
  }
451
449
 
452
450
  /**
453
- * {{> ../webapi/doubleClick }}
451
+ * {{> doubleClick }}
454
452
  */
455
453
  async doubleClick(locator, context = null) {
456
454
  let matcher = this.browser;
@@ -464,7 +462,7 @@ class Protractor extends Helper {
464
462
  }
465
463
 
466
464
  /**
467
- * {{> ../webapi/rightClick }}
465
+ * {{> rightClick }}
468
466
  */
469
467
  async rightClick(locator, context = null) {
470
468
  /**
@@ -486,7 +484,7 @@ class Protractor extends Helper {
486
484
  }
487
485
 
488
486
  /**
489
- * {{> ../webapi/moveCursorTo}}
487
+ * {{> moveCursorTo }}
490
488
  */
491
489
  async moveCursorTo(locator, offsetX = null, offsetY = null) {
492
490
  let offset = null;
@@ -499,7 +497,7 @@ class Protractor extends Helper {
499
497
  }
500
498
 
501
499
  /**
502
- * {{> ../webapi/see }}
500
+ * {{> see }}
503
501
  */
504
502
  async see(text, context = null) {
505
503
  return proceedSee.call(this, 'assert', text, context);
@@ -517,28 +515,28 @@ class Protractor extends Helper {
517
515
  }
518
516
 
519
517
  /**
520
- * {{> ../webapi/dontSee }}
518
+ * {{> dontSee }}
521
519
  */
522
520
  dontSee(text, context = null) {
523
521
  return proceedSee.call(this, 'negate', text, context);
524
522
  }
525
523
 
526
524
  /**
527
- * {{> ../webapi/grabBrowserLogs }}
525
+ * {{> grabBrowserLogs }}
528
526
  */
529
527
  async grabBrowserLogs() {
530
528
  return this.browser.manage().logs().get('browser');
531
529
  }
532
530
 
533
531
  /**
534
- * {{> ../webapi/grabCurrentUrl }}
532
+ * {{> grabCurrentUrl }}
535
533
  */
536
534
  async grabCurrentUrl() {
537
535
  return this.browser.getCurrentUrl();
538
536
  }
539
537
 
540
538
  /**
541
- * {{> ../webapi/selectOption }}
539
+ * {{> selectOption }}
542
540
  */
543
541
  async selectOption(select, option) {
544
542
  const fields = await findFields(this.browser, select);
@@ -561,7 +559,7 @@ class Protractor extends Helper {
561
559
  }
562
560
 
563
561
  /**
564
- * {{> ../webapi/fillField }}
562
+ * {{> fillField }}
565
563
  */
566
564
  async fillField(field, value) {
567
565
  const els = await findFields(this.browser, field);
@@ -570,8 +568,8 @@ class Protractor extends Helper {
570
568
  }
571
569
 
572
570
  /**
573
- * {{> ../webapi/pressKey }}
574
- * {{> ../webapi/_keys }}
571
+ * {{> pressKey }}
572
+ * {{ keys }}
575
573
  */
576
574
  async pressKey(key) {
577
575
  let modifier;
@@ -593,7 +591,7 @@ class Protractor extends Helper {
593
591
  }
594
592
 
595
593
  /**
596
- * {{> ../webapi/attachFile }}
594
+ * {{> attachFile }}
597
595
  */
598
596
  async attachFile(locator, pathToFile) {
599
597
  const file = path.join(global.codecept_dir, pathToFile);
@@ -610,21 +608,21 @@ class Protractor extends Helper {
610
608
  }
611
609
 
612
610
  /**
613
- * {{> ../webapi/seeInField }}
611
+ * {{> seeInField }}
614
612
  */
615
613
  async seeInField(field, value) {
616
614
  return proceedSeeInField.call(this, 'assert', field, value);
617
615
  }
618
616
 
619
617
  /**
620
- * {{> ../webapi/dontSeeInField }}
618
+ * {{> dontSeeInField }}
621
619
  */
622
620
  async dontSeeInField(field, value) {
623
621
  return proceedSeeInField.call(this, 'negate', field, value);
624
622
  }
625
623
 
626
624
  /**
627
- * {{> ../webapi/appendField }}
625
+ * {{> appendField }}
628
626
  */
629
627
  async appendField(field, value) {
630
628
  const els = await findFields(this.browser, field);
@@ -633,7 +631,7 @@ class Protractor extends Helper {
633
631
  }
634
632
 
635
633
  /**
636
- * {{> ../webapi/clearField }}
634
+ * {{> clearField }}
637
635
  */
638
636
  async clearField(field) {
639
637
  const els = await findFields(this.browser, field);
@@ -642,7 +640,7 @@ class Protractor extends Helper {
642
640
  }
643
641
 
644
642
  /**
645
- * {{> ../webapi/checkOption }}
643
+ * {{> checkOption }}
646
644
  */
647
645
  async checkOption(field, context = null) {
648
646
  let matcher = this.browser;
@@ -658,21 +656,37 @@ class Protractor extends Helper {
658
656
  }
659
657
 
660
658
  /**
661
- * {{> ../webapi/seeCheckboxIsChecked }}
659
+ * {{> uncheckOption }}
660
+ */
661
+ async uncheckOption(field, context = null) {
662
+ let matcher = this.browser;
663
+ if (context) {
664
+ const els = await this._locate(context, true);
665
+ assertElementExists(els, context);
666
+ matcher = els[0];
667
+ }
668
+ const els = await findCheckable(matcher, field);
669
+ assertElementExists(els, field, 'Checkbox or radio');
670
+ const isSelected = await els[0].isSelected();
671
+ if (isSelected) return els[0].click();
672
+ }
673
+
674
+ /**
675
+ * {{> seeCheckboxIsChecked }}
662
676
  */
663
677
  async seeCheckboxIsChecked(field) {
664
678
  return proceedIsChecked.call(this, 'assert', field);
665
679
  }
666
680
 
667
681
  /**
668
- * {{> ../webapi/dontSeeCheckboxIsChecked }}
682
+ * {{> dontSeeCheckboxIsChecked }}
669
683
  */
670
684
  async dontSeeCheckboxIsChecked(field) {
671
685
  return proceedIsChecked.call(this, 'negate', field);
672
686
  }
673
687
 
674
688
  /**
675
- * {{> ../webapi/grabTextFrom }}
689
+ * {{> grabTextFrom }}
676
690
  */
677
691
  async grabTextFrom(locator) {
678
692
  const els = await this._locate(locator);
@@ -686,7 +700,7 @@ class Protractor extends Helper {
686
700
  }
687
701
 
688
702
  /**
689
- * {{> ../webapi/grabHTMLFrom }}
703
+ * {{> grabHTMLFrom }}
690
704
  */
691
705
  async grabHTMLFrom(locator) {
692
706
  const els = await this._locate(locator);
@@ -703,7 +717,7 @@ class Protractor extends Helper {
703
717
  }
704
718
 
705
719
  /**
706
- * {{> ../webapi/grabValueFrom }}
720
+ * {{> grabValueFrom }}
707
721
  */
708
722
  async grabValueFrom(locator) {
709
723
  const els = await findFields(this.browser, locator);
@@ -712,7 +726,7 @@ class Protractor extends Helper {
712
726
  }
713
727
 
714
728
  /**
715
- * {{> ../webapi/grabCssPropertyFrom }}
729
+ * {{> grabCssPropertyFrom }}
716
730
  */
717
731
  async grabCssPropertyFrom(locator, cssProperty) {
718
732
  const els = await this._locate(locator, true);
@@ -726,7 +740,7 @@ class Protractor extends Helper {
726
740
  }
727
741
 
728
742
  /**
729
- * {{> ../webapi/grabAttributeFrom }}
743
+ * {{> grabAttributeFrom }}
730
744
  */
731
745
  async grabAttributeFrom(locator, attr) {
732
746
  const els = await this._locate(locator);
@@ -740,7 +754,7 @@ class Protractor extends Helper {
740
754
  return array.length === 1 ? array[0] : array;
741
755
  }
742
756
  /**
743
- * {{> ../webapi/seeInTitle }}
757
+ * {{> seeInTitle }}
744
758
  */
745
759
  async seeInTitle(text) {
746
760
  return this.browser.getTitle().then(title => stringIncludes('web page title').assert(text, title));
@@ -759,14 +773,14 @@ class Protractor extends Helper {
759
773
  }
760
774
 
761
775
  /**
762
- * {{> ../webapi/dontSeeInTitle }}
776
+ * {{> dontSeeInTitle }}
763
777
  */
764
778
  async dontSeeInTitle(text) {
765
779
  return this.browser.getTitle().then(title => stringIncludes('web page title').negate(text, title));
766
780
  }
767
781
 
768
782
  /**
769
- * {{> ../webapi/grabTitle }}
783
+ * {{> grabTitle }}
770
784
  */
771
785
  async grabTitle() {
772
786
  return this.browser.getTitle().then((title) => {
@@ -776,7 +790,7 @@ class Protractor extends Helper {
776
790
  }
777
791
 
778
792
  /**
779
- * {{> ../webapi/seeElement }}
793
+ * {{> seeElement }}
780
794
  */
781
795
  async seeElement(locator) {
782
796
  let els = await this._locate(locator, true);
@@ -785,7 +799,7 @@ class Protractor extends Helper {
785
799
  }
786
800
 
787
801
  /**
788
- * {{> ../webapi/dontSeeElement }}
802
+ * {{> dontSeeElement }}
789
803
  */
790
804
  async dontSeeElement(locator) {
791
805
  let els = await this._locate(locator, false);
@@ -794,55 +808,50 @@ class Protractor extends Helper {
794
808
  }
795
809
 
796
810
  /**
797
- * {{> ../webapi/seeElementInDOM }}
811
+ * {{> seeElementInDOM }}
798
812
  */
799
813
  async seeElementInDOM(locator) {
800
814
  return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').negate(els.fill('ELEMENT')));
801
815
  }
802
816
 
803
817
  /**
804
- * {{> ../webapi/dontSeeElementInDOM }}
818
+ * {{> dontSeeElementInDOM }}
805
819
  */
806
820
  async dontSeeElementInDOM(locator) {
807
821
  return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').assert(els.fill('ELEMENT')));
808
822
  }
809
823
 
810
824
  /**
811
- * {{> ../webapi/seeInSource }}
825
+ * {{> seeInSource }}
812
826
  */
813
827
  async seeInSource(text) {
814
828
  return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').assert(text, source));
815
829
  }
816
830
 
817
831
  /**
818
- * {{> ../webapi/grabSource }}
832
+ * {{> grabSource }}
819
833
  */
820
834
  async grabSource() {
821
835
  return this.browser.getPageSource();
822
836
  }
823
837
 
824
838
  /**
825
- * {{> ../webapi/dontSeeInSource }}
839
+ * {{> dontSeeInSource }}
826
840
  */
827
841
  async dontSeeInSource(text) {
828
842
  return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').negate(text, source));
829
843
  }
830
844
 
831
845
  /**
832
- * asserts that an element appears a given number of times in the DOM
833
- * Element is located by label or name or CSS or XPath.
834
- *
835
- * ```js
836
- * I.seeNumberOfElements('#submitBtn', 1);
837
- * ```
846
+ * {{> seeNumberOfElements }}
838
847
  */
839
- async seeNumberOfElements(selector, num) {
840
- const elements = await this._locate(selector);
841
- return equals(`expected number of elements (${selector}) is ${num}, but found ${elements.length}`).assert(elements.length, num);
848
+ async seeNumberOfElements(locator, num) {
849
+ const elements = await this._locate(locator);
850
+ return equals(`expected number of elements (${locator}) is ${num}, but found ${elements.length}`).assert(elements.length, num);
842
851
  }
843
852
 
844
853
  /**
845
- * {{> ../webapi/seeNumberOfVisibleElements }}
854
+ * {{> seeNumberOfVisibleElements }}
846
855
  */
847
856
  async seeNumberOfVisibleElements(locator, num) {
848
857
  const res = await this.grabNumberOfVisibleElements(locator);
@@ -850,7 +859,7 @@ class Protractor extends Helper {
850
859
  }
851
860
 
852
861
  /**
853
- * {{> ../webapi/grabNumberOfVisibleElements }}
862
+ * {{> grabNumberOfVisibleElements }}
854
863
  */
855
864
  async grabNumberOfVisibleElements(locator) {
856
865
  let els = await this._locate(locator);
@@ -859,7 +868,7 @@ class Protractor extends Helper {
859
868
  }
860
869
 
861
870
  /**
862
- * {{> ../webapi/seeCssPropertiesOnElements }}
871
+ * {{> seeCssPropertiesOnElements }}
863
872
  */
864
873
  async seeCssPropertiesOnElements(locator, cssProperties) {
865
874
  const els = await this._locate(locator);
@@ -890,7 +899,7 @@ class Protractor extends Helper {
890
899
  }
891
900
 
892
901
  /**
893
- * {{> ../webapi/seeAttributesOnElements }}
902
+ * {{> seeAttributesOnElements }}
894
903
  */
895
904
  async seeAttributesOnElements(locator, attributes) {
896
905
  const els = await this._locate(locator);
@@ -917,14 +926,14 @@ class Protractor extends Helper {
917
926
  }
918
927
 
919
928
  /**
920
- * {{> ../webapi/executeScript }}
929
+ * {{> executeScript }}
921
930
  */
922
931
  async executeScript(fn) {
923
932
  return this.browser.executeScript.apply(this.browser, arguments);
924
933
  }
925
934
 
926
935
  /**
927
- * {{> ../webapi/executeAsyncScript }}
936
+ * {{> executeAsyncScript }}
928
937
  */
929
938
  async executeAsyncScript(fn) {
930
939
  this.browser.manage().timeouts().setScriptTimeout(this.options.scriptTimeout);
@@ -932,35 +941,35 @@ class Protractor extends Helper {
932
941
  }
933
942
 
934
943
  /**
935
- * {{> ../webapi/seeInCurrentUrl }}
944
+ * {{> seeInCurrentUrl }}
936
945
  */
937
946
  async seeInCurrentUrl(url) {
938
947
  return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').assert(url, currentUrl));
939
948
  }
940
949
 
941
950
  /**
942
- * {{> ../webapi/dontSeeInCurrentUrl }}
951
+ * {{> dontSeeInCurrentUrl }}
943
952
  */
944
953
  async dontSeeInCurrentUrl(url) {
945
954
  return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').negate(url, currentUrl));
946
955
  }
947
956
 
948
957
  /**
949
- * {{> ../webapi/seeCurrentUrlEquals }}
958
+ * {{> seeCurrentUrlEquals }}
950
959
  */
951
960
  async seeCurrentUrlEquals(url) {
952
961
  return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).assert(url, currentUrl));
953
962
  }
954
963
 
955
964
  /**
956
- * {{> ../webapi/dontSeeCurrentUrlEquals }}
965
+ * {{> dontSeeCurrentUrlEquals }}
957
966
  */
958
967
  async dontSeeCurrentUrlEquals(url) {
959
968
  return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).negate(url, currentUrl));
960
969
  }
961
970
 
962
971
  /**
963
- * {{> ../webapi/saveScreenshot }}
972
+ * {{> saveScreenshot }}
964
973
  */
965
974
  async saveScreenshot(fileName, fullPage = false) {
966
975
  const outputFile = screenshotOutputFolder(fileName);
@@ -993,7 +1002,7 @@ class Protractor extends Helper {
993
1002
  }
994
1003
 
995
1004
  /**
996
- * {{> ../webapi/clearCookie}}
1005
+ * {{> clearCookie }}
997
1006
  */
998
1007
  async clearCookie(cookie = null) {
999
1008
  if (!cookie) {
@@ -1003,25 +1012,26 @@ class Protractor extends Helper {
1003
1012
  }
1004
1013
 
1005
1014
  /**
1006
- * {{> ../webapi/seeCookie}}
1015
+ * {{> seeCookie }}
1007
1016
  */
1008
1017
  async seeCookie(name) {
1009
1018
  return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').assert(res));
1010
1019
  }
1011
1020
 
1012
1021
  /**
1013
- * {{> ../webapi/dontSeeCookie}}
1022
+ * {{> dontSeeCookie }}
1014
1023
  */
1015
1024
  async dontSeeCookie(name) {
1016
1025
  return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').negate(res));
1017
1026
  }
1018
1027
 
1019
1028
  /**
1020
- * {{> ../webapi/grabCookie}}
1029
+ * {{> grabCookie }}
1021
1030
  *
1022
1031
  * Returns cookie in JSON [format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
1023
1032
  */
1024
1033
  async grabCookie(name) {
1034
+ if (!name) return this.browser.manage().getCookies();
1025
1035
  return this.browser.manage().getCookie(name);
1026
1036
  }
1027
1037
 
@@ -1078,7 +1088,7 @@ class Protractor extends Helper {
1078
1088
  }
1079
1089
 
1080
1090
  /**
1081
- * {{> ../webapi/resizeWindow }}
1091
+ * {{> resizeWindow }}
1082
1092
  */
1083
1093
  async resizeWindow(width, height) {
1084
1094
  if (width === 'maximize') {
@@ -1089,7 +1099,7 @@ class Protractor extends Helper {
1089
1099
  }
1090
1100
 
1091
1101
  /**
1092
- * {{> ../webapi/dragAndDrop }}
1102
+ * {{> dragAndDrop }}
1093
1103
  */
1094
1104
  async dragAndDrop(srcElement, destElement) {
1095
1105
  const srcEl = await this._locate(srcElement, true);
@@ -1208,7 +1218,7 @@ class Protractor extends Helper {
1208
1218
  }
1209
1219
 
1210
1220
  /**
1211
- * {{> ../webapi/grabNumberOfOpenTabs }}
1221
+ * {{> grabNumberOfOpenTabs }}
1212
1222
  */
1213
1223
  async grabNumberOfOpenTabs() {
1214
1224
  const pages = await this.browser.getAllWindowHandles();
@@ -1216,7 +1226,7 @@ class Protractor extends Helper {
1216
1226
  }
1217
1227
 
1218
1228
  /**
1219
- * {{> ../webapi/switchTo }}
1229
+ * {{> switchTo }}
1220
1230
  */
1221
1231
  async switchTo(locator) {
1222
1232
  if (Number.isInteger(locator)) {
@@ -1231,7 +1241,7 @@ class Protractor extends Helper {
1231
1241
  }
1232
1242
 
1233
1243
  /**
1234
- * {{> ../webapi/wait }}
1244
+ * {{> wait }}
1235
1245
  */
1236
1246
  wait(sec) {
1237
1247
  return this.browser.sleep(sec * 1000);
@@ -1239,7 +1249,7 @@ class Protractor extends Helper {
1239
1249
 
1240
1250
 
1241
1251
  /**
1242
- * {{> ../webapi/waitForElement }}
1252
+ * {{> waitForElement }}
1243
1253
  */
1244
1254
  async waitForElement(locator, sec = null) {
1245
1255
  const aSec = sec || this.options.waitForTimeout;
@@ -1255,7 +1265,7 @@ class Protractor extends Helper {
1255
1265
  }
1256
1266
 
1257
1267
  /**
1258
- * {{> ../webapi/waitForDetached }}
1268
+ * {{> waitForDetached }}
1259
1269
  */
1260
1270
  async waitForDetached(locator, sec = null) {
1261
1271
  const aSec = sec || this.options.waitForTimeout;
@@ -1281,7 +1291,7 @@ class Protractor extends Helper {
1281
1291
  }
1282
1292
 
1283
1293
  /**
1284
- * {{> ../webapi/waitForVisible }}
1294
+ * {{> waitForVisible }}
1285
1295
  */
1286
1296
  async waitForVisible(locator, sec = null) {
1287
1297
  const aSec = sec || this.options.waitForTimeout;
@@ -1290,14 +1300,14 @@ class Protractor extends Helper {
1290
1300
  }
1291
1301
 
1292
1302
  /**
1293
- * {{> ../webapi/waitToHide }}
1303
+ * {{> waitToHide }}
1294
1304
  */
1295
1305
  async waitToHide(locator, sec = null) {
1296
1306
  return this.waitForInvisible(locator, sec);
1297
1307
  }
1298
1308
 
1299
1309
  /**
1300
- * {{> ../webapi/waitForInvisible }}
1310
+ * {{> waitForInvisible }}
1301
1311
  */
1302
1312
  async waitForInvisible(locator, sec = null) {
1303
1313
  const aSec = sec || this.options.waitForTimeout;
@@ -1313,7 +1323,7 @@ class Protractor extends Helper {
1313
1323
  }
1314
1324
 
1315
1325
  /**
1316
- * {{> ../webapi/waitNumberOfVisibleElements }}
1326
+ * {{> waitNumberOfVisibleElements }}
1317
1327
  */
1318
1328
  async waitNumberOfVisibleElements(locator, num, sec = null) {
1319
1329
  function visibilityCountOf(loc, expectedCount) {
@@ -1335,7 +1345,7 @@ class Protractor extends Helper {
1335
1345
  }
1336
1346
 
1337
1347
  /**
1338
- * {{> ../webapi/waitForEnabled }}
1348
+ * {{> waitForEnabled }}
1339
1349
  */
1340
1350
  async waitForEnabled(locator, sec = null) {
1341
1351
  const aSec = sec || this.options.waitForTimeout;
@@ -1348,7 +1358,7 @@ class Protractor extends Helper {
1348
1358
  }
1349
1359
 
1350
1360
  /**
1351
- * {{> ../webapi/waitForValue }}
1361
+ * {{> waitForValue }}
1352
1362
  */
1353
1363
  async waitForValue(field, value, sec = null) {
1354
1364
  const aSec = sec || this.options.waitForTimeout;
@@ -1372,7 +1382,7 @@ class Protractor extends Helper {
1372
1382
  }
1373
1383
 
1374
1384
  /**
1375
- * {{> ../webapi/waitForFunction }}
1385
+ * {{> waitForFunction }}
1376
1386
  */
1377
1387
  async waitForFunction(fn, argsOrSec = null, sec = null) {
1378
1388
  let args = [];
@@ -1389,7 +1399,7 @@ class Protractor extends Helper {
1389
1399
  }
1390
1400
 
1391
1401
  /**
1392
- * {{> ../webapi/waitUntil }}
1402
+ * {{> waitUntil }}
1393
1403
  */
1394
1404
  async waitUntil(fn, sec = null, timeoutMsg = null) {
1395
1405
  const aSec = sec || this.options.waitForTimeout;
@@ -1397,7 +1407,7 @@ class Protractor extends Helper {
1397
1407
  }
1398
1408
 
1399
1409
  /**
1400
- * {{> ../webapi/waitInUrl }}
1410
+ * {{> waitInUrl }}
1401
1411
  */
1402
1412
  async waitInUrl(urlPart, sec = null) {
1403
1413
  const aSec = sec || this.options.waitForTimeout;
@@ -1415,7 +1425,7 @@ class Protractor extends Helper {
1415
1425
  }
1416
1426
 
1417
1427
  /**
1418
- * {{> ../webapi/waitUrlEquals }}
1428
+ * {{> waitUrlEquals }}
1419
1429
  */
1420
1430
  async waitUrlEquals(urlPart, sec = null) {
1421
1431
  const aSec = sec || this.options.waitForTimeout;
@@ -1437,7 +1447,7 @@ class Protractor extends Helper {
1437
1447
  }
1438
1448
 
1439
1449
  /**
1440
- * {{> ../webapi/waitForText }}
1450
+ * {{> waitForText }}
1441
1451
  */
1442
1452
  async waitForText(text, sec = null, context = null) {
1443
1453
  if (!context) {
@@ -1459,7 +1469,7 @@ class Protractor extends Helper {
1459
1469
 
1460
1470
 
1461
1471
  /**
1462
- * {{> ../webapi/refreshPage }}
1472
+ * {{> refreshPage }}
1463
1473
  */
1464
1474
  refreshPage() {
1465
1475
  return this.browser.refresh();
@@ -1474,7 +1484,7 @@ class Protractor extends Helper {
1474
1484
  }
1475
1485
 
1476
1486
  /**
1477
- * {{> ../webapi/scrollTo }}
1487
+ * {{> scrollTo }}
1478
1488
  */
1479
1489
  async scrollTo(locator, offsetX = 0, offsetY = 0) {
1480
1490
  if (typeof locator === 'number' && typeof offsetX === 'number') {
@@ -1501,14 +1511,14 @@ class Protractor extends Helper {
1501
1511
  }
1502
1512
 
1503
1513
  /**
1504
- * {{> ../webapi/scrollPageToTop }}
1514
+ * {{> scrollPageToTop }}
1505
1515
  */
1506
1516
  async scrollPageToTop() {
1507
1517
  return this.executeScript('window.scrollTo(0, 0);');
1508
1518
  }
1509
1519
 
1510
1520
  /**
1511
- * {{> ../webapi/scrollPageToBottom }}
1521
+ * {{> scrollPageToBottom }}
1512
1522
  */
1513
1523
  async scrollPageToBottom() {
1514
1524
  /* eslint-disable prefer-arrow-callback, comma-dangle */
@@ -1524,7 +1534,7 @@ class Protractor extends Helper {
1524
1534
  }
1525
1535
 
1526
1536
  /**
1527
- * {{> ../webapi/grabPageScrollPosition}}
1537
+ * {{> grabPageScrollPosition }}
1528
1538
  */
1529
1539
  async grabPageScrollPosition() {
1530
1540
  /* eslint-disable comma-dangle */
@@ -1567,7 +1577,7 @@ class Protractor extends Helper {
1567
1577
  }
1568
1578
 
1569
1579
  /**
1570
- * {{> ../webapi/setCookie}}
1580
+ * {{> setCookie }}
1571
1581
  */
1572
1582
  setCookie(cookie) {
1573
1583
  return this.browser.manage().addCookie(cookie);