codeceptjs 3.3.1 → 3.3.2
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/CHANGELOG.md +7 -0
- package/README.md +4 -25
- package/docs/build/Appium.js +18 -28
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +74 -99
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +79 -81
- package/docs/changelog.md +7 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +266 -383
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- 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 +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.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/lib/helper/Appium.js +0 -10
- package/lib/helper/Playwright.js +3 -28
- package/lib/helper/REST.js +2 -2
- package/lib/helper/WebDriver.js +0 -2
- package/package.json +1 -1
- package/typings/types.d.ts +988 -517
package/docs/build/Protractor.js
CHANGED
|
@@ -456,7 +456,7 @@ class Protractor extends Helper {
|
|
|
456
456
|
* ```
|
|
457
457
|
*
|
|
458
458
|
* @param {string} url url path or global url.
|
|
459
|
-
* @return {
|
|
459
|
+
* @return {void} automatically synchronized promise with recorder #!
|
|
460
460
|
*/
|
|
461
461
|
async amOnPage(url) {
|
|
462
462
|
if (!(/^\w+\:\/\//.test(url))) {
|
|
@@ -492,7 +492,7 @@ class Protractor extends Helper {
|
|
|
492
492
|
*
|
|
493
493
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
494
494
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
495
|
-
*
|
|
495
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
496
496
|
*
|
|
497
497
|
*/
|
|
498
498
|
async click(locator, context = null) {
|
|
@@ -519,7 +519,7 @@ class Protractor extends Helper {
|
|
|
519
519
|
*
|
|
520
520
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
521
521
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
522
|
-
*
|
|
522
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
523
523
|
*/
|
|
524
524
|
async doubleClick(locator, context = null) {
|
|
525
525
|
let matcher = this.browser;
|
|
@@ -546,7 +546,7 @@ class Protractor extends Helper {
|
|
|
546
546
|
*
|
|
547
547
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
548
548
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
549
|
-
*
|
|
549
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
550
550
|
*/
|
|
551
551
|
async rightClick(locator, context = null) {
|
|
552
552
|
/**
|
|
@@ -579,7 +579,7 @@ class Protractor extends Helper {
|
|
|
579
579
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
580
580
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
581
581
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
582
|
-
*
|
|
582
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
583
583
|
*/
|
|
584
584
|
async moveCursorTo(locator, offsetX = null, offsetY = null) {
|
|
585
585
|
let offset = null;
|
|
@@ -602,7 +602,7 @@ class Protractor extends Helper {
|
|
|
602
602
|
* ```
|
|
603
603
|
* @param {string} text expected on page.
|
|
604
604
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
605
|
-
*
|
|
605
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
606
606
|
*/
|
|
607
607
|
async see(text, context = null) {
|
|
608
608
|
return proceedSee.call(this, 'assert', text, context);
|
|
@@ -617,7 +617,7 @@ class Protractor extends Helper {
|
|
|
617
617
|
*
|
|
618
618
|
* @param {string} text element value to check.
|
|
619
619
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
620
|
-
*
|
|
620
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
621
621
|
*/
|
|
622
622
|
async seeTextEquals(text, context = null) {
|
|
623
623
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -634,7 +634,7 @@ class Protractor extends Helper {
|
|
|
634
634
|
*
|
|
635
635
|
* @param {string} text which is not present.
|
|
636
636
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
637
|
-
*
|
|
637
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
638
638
|
*/
|
|
639
639
|
dontSee(text, context = null) {
|
|
640
640
|
return proceedSee.call(this, 'negate', text, context);
|
|
@@ -692,7 +692,7 @@ class Protractor extends Helper {
|
|
|
692
692
|
* ```
|
|
693
693
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
694
694
|
* @param {string|Array<*>} option visible text or value of option.
|
|
695
|
-
*
|
|
695
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
696
696
|
*/
|
|
697
697
|
async selectOption(select, option) {
|
|
698
698
|
const fields = await findFields(this.browser, select);
|
|
@@ -730,7 +730,7 @@ class Protractor extends Helper {
|
|
|
730
730
|
* ```
|
|
731
731
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
732
732
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
733
|
-
*
|
|
733
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
734
734
|
*/
|
|
735
735
|
async fillField(field, value) {
|
|
736
736
|
const els = await findFields(this.browser, field);
|
|
@@ -750,7 +750,7 @@ class Protractor extends Helper {
|
|
|
750
750
|
* ```
|
|
751
751
|
*
|
|
752
752
|
* @param {string|string[]} key key or array of keys to press.
|
|
753
|
-
*
|
|
753
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
754
754
|
* {{ keys }}
|
|
755
755
|
*/
|
|
756
756
|
async pressKey(key) {
|
|
@@ -784,7 +784,7 @@ class Protractor extends Helper {
|
|
|
784
784
|
*
|
|
785
785
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
786
786
|
* @param {string} pathToFile local file path relative to codecept.json config file.
|
|
787
|
-
*
|
|
787
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
788
788
|
*/
|
|
789
789
|
async attachFile(locator, pathToFile) {
|
|
790
790
|
const file = path.join(global.codecept_dir, pathToFile);
|
|
@@ -812,7 +812,7 @@ class Protractor extends Helper {
|
|
|
812
812
|
* ```
|
|
813
813
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
814
814
|
* @param {string} value value to check.
|
|
815
|
-
*
|
|
815
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
816
816
|
*/
|
|
817
817
|
async seeInField(field, value) {
|
|
818
818
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -829,7 +829,7 @@ class Protractor extends Helper {
|
|
|
829
829
|
*
|
|
830
830
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
831
831
|
* @param {string} value value to check.
|
|
832
|
-
*
|
|
832
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
833
833
|
*/
|
|
834
834
|
async dontSeeInField(field, value) {
|
|
835
835
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -844,7 +844,7 @@ class Protractor extends Helper {
|
|
|
844
844
|
* ```
|
|
845
845
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
846
846
|
* @param {string} value text value to append.
|
|
847
|
-
*
|
|
847
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
848
848
|
*/
|
|
849
849
|
async appendField(field, value) {
|
|
850
850
|
const els = await findFields(this.browser, field);
|
|
@@ -861,7 +861,7 @@ class Protractor extends Helper {
|
|
|
861
861
|
* I.clearField('#email');
|
|
862
862
|
* ```
|
|
863
863
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
864
|
-
*
|
|
864
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
865
865
|
*/
|
|
866
866
|
async clearField(field) {
|
|
867
867
|
const els = await findFields(this.browser, field);
|
|
@@ -882,7 +882,7 @@ class Protractor extends Helper {
|
|
|
882
882
|
* ```
|
|
883
883
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
884
884
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
885
|
-
*
|
|
885
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
886
886
|
*/
|
|
887
887
|
async checkOption(field, context = null) {
|
|
888
888
|
let matcher = this.browser;
|
|
@@ -910,7 +910,7 @@ class Protractor extends Helper {
|
|
|
910
910
|
* ```
|
|
911
911
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
912
912
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
913
|
-
*
|
|
913
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
914
914
|
*/
|
|
915
915
|
async uncheckOption(field, context = null) {
|
|
916
916
|
let matcher = this.browser;
|
|
@@ -935,7 +935,7 @@ class Protractor extends Helper {
|
|
|
935
935
|
* ```
|
|
936
936
|
*
|
|
937
937
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
938
|
-
*
|
|
938
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
939
939
|
*/
|
|
940
940
|
async seeCheckboxIsChecked(field) {
|
|
941
941
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -951,7 +951,7 @@ class Protractor extends Helper {
|
|
|
951
951
|
* ```
|
|
952
952
|
*
|
|
953
953
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
954
|
-
*
|
|
954
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
955
955
|
*/
|
|
956
956
|
async dontSeeCheckboxIsChecked(field) {
|
|
957
957
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1185,7 +1185,7 @@ class Protractor extends Helper {
|
|
|
1185
1185
|
* ```
|
|
1186
1186
|
*
|
|
1187
1187
|
* @param {string} text text value to check.
|
|
1188
|
-
*
|
|
1188
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1189
1189
|
*/
|
|
1190
1190
|
async seeInTitle(text) {
|
|
1191
1191
|
return this.browser.getTitle().then(title => stringIncludes('web page title').assert(text, title));
|
|
@@ -1199,7 +1199,7 @@ class Protractor extends Helper {
|
|
|
1199
1199
|
* ```
|
|
1200
1200
|
*
|
|
1201
1201
|
* @param {string} text value to check.
|
|
1202
|
-
*
|
|
1202
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1203
1203
|
*/
|
|
1204
1204
|
async seeTitleEquals(text) {
|
|
1205
1205
|
const title = await this.browser.getTitle();
|
|
@@ -1214,7 +1214,7 @@ class Protractor extends Helper {
|
|
|
1214
1214
|
* ```
|
|
1215
1215
|
*
|
|
1216
1216
|
* @param {string} text value to check.
|
|
1217
|
-
*
|
|
1217
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1218
1218
|
*/
|
|
1219
1219
|
async dontSeeInTitle(text) {
|
|
1220
1220
|
return this.browser.getTitle().then(title => stringIncludes('web page title').negate(text, title));
|
|
@@ -1245,7 +1245,7 @@ class Protractor extends Helper {
|
|
|
1245
1245
|
* I.seeElement('#modal');
|
|
1246
1246
|
* ```
|
|
1247
1247
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1248
|
-
*
|
|
1248
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1249
1249
|
*/
|
|
1250
1250
|
async seeElement(locator) {
|
|
1251
1251
|
let els = await this._locate(locator, true);
|
|
@@ -1261,7 +1261,7 @@ class Protractor extends Helper {
|
|
|
1261
1261
|
* ```
|
|
1262
1262
|
*
|
|
1263
1263
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1264
|
-
*
|
|
1264
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1265
1265
|
*/
|
|
1266
1266
|
async dontSeeElement(locator) {
|
|
1267
1267
|
let els = await this._locate(locator, false);
|
|
@@ -1277,7 +1277,7 @@ class Protractor extends Helper {
|
|
|
1277
1277
|
* I.seeElementInDOM('#modal');
|
|
1278
1278
|
* ```
|
|
1279
1279
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1280
|
-
*
|
|
1280
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1281
1281
|
*/
|
|
1282
1282
|
async seeElementInDOM(locator) {
|
|
1283
1283
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').negate(els.fill('ELEMENT')));
|
|
@@ -1291,7 +1291,7 @@ class Protractor extends Helper {
|
|
|
1291
1291
|
* ```
|
|
1292
1292
|
*
|
|
1293
1293
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1294
|
-
*
|
|
1294
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1295
1295
|
*/
|
|
1296
1296
|
async dontSeeElementInDOM(locator) {
|
|
1297
1297
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').assert(els.fill('ELEMENT')));
|
|
@@ -1304,7 +1304,7 @@ class Protractor extends Helper {
|
|
|
1304
1304
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1305
1305
|
* ```
|
|
1306
1306
|
* @param {string} text value to check.
|
|
1307
|
-
*
|
|
1307
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1308
1308
|
*/
|
|
1309
1309
|
async seeInSource(text) {
|
|
1310
1310
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').assert(text, source));
|
|
@@ -1332,7 +1332,7 @@ class Protractor extends Helper {
|
|
|
1332
1332
|
* ```
|
|
1333
1333
|
*
|
|
1334
1334
|
* @param {string} value to check.
|
|
1335
|
-
*
|
|
1335
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1336
1336
|
*/
|
|
1337
1337
|
async dontSeeInSource(text) {
|
|
1338
1338
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').negate(text, source));
|
|
@@ -1349,7 +1349,7 @@ class Protractor extends Helper {
|
|
|
1349
1349
|
*
|
|
1350
1350
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1351
1351
|
* @param {number} num number of elements.
|
|
1352
|
-
*
|
|
1352
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1353
1353
|
*/
|
|
1354
1354
|
async seeNumberOfElements(locator, num) {
|
|
1355
1355
|
const elements = await this._locate(locator);
|
|
@@ -1366,7 +1366,7 @@ class Protractor extends Helper {
|
|
|
1366
1366
|
*
|
|
1367
1367
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1368
1368
|
* @param {number} num number of elements.
|
|
1369
|
-
*
|
|
1369
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1370
1370
|
*/
|
|
1371
1371
|
async seeNumberOfVisibleElements(locator, num) {
|
|
1372
1372
|
const res = await this.grabNumberOfVisibleElements(locator);
|
|
@@ -1399,7 +1399,7 @@ class Protractor extends Helper {
|
|
|
1399
1399
|
*
|
|
1400
1400
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1401
1401
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1402
|
-
*
|
|
1402
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1403
1403
|
*/
|
|
1404
1404
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
1405
1405
|
const els = await this._locate(locator);
|
|
@@ -1438,7 +1438,7 @@ class Protractor extends Helper {
|
|
|
1438
1438
|
*
|
|
1439
1439
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1440
1440
|
* @param {object} attributes attributes and their values to check.
|
|
1441
|
-
*
|
|
1441
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1442
1442
|
*/
|
|
1443
1443
|
async seeAttributesOnElements(locator, attributes) {
|
|
1444
1444
|
const els = await this._locate(locator);
|
|
@@ -1490,7 +1490,7 @@ class Protractor extends Helper {
|
|
|
1490
1490
|
*
|
|
1491
1491
|
* @param {string|function} fn function to be executed in browser context.
|
|
1492
1492
|
* @param {...any} args to be passed to function.
|
|
1493
|
-
*
|
|
1493
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1494
1494
|
*
|
|
1495
1495
|
*/
|
|
1496
1496
|
async executeScript() {
|
|
@@ -1521,7 +1521,7 @@ class Protractor extends Helper {
|
|
|
1521
1521
|
*
|
|
1522
1522
|
* @param {string|function} fn function to be executed in browser context.
|
|
1523
1523
|
* @param {...any} args to be passed to function.
|
|
1524
|
-
*
|
|
1524
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1525
1525
|
*
|
|
1526
1526
|
*/
|
|
1527
1527
|
async executeAsyncScript() {
|
|
@@ -1537,7 +1537,7 @@ class Protractor extends Helper {
|
|
|
1537
1537
|
* ```
|
|
1538
1538
|
*
|
|
1539
1539
|
* @param {string} url a fragment to check
|
|
1540
|
-
*
|
|
1540
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1541
1541
|
*/
|
|
1542
1542
|
async seeInCurrentUrl(url) {
|
|
1543
1543
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').assert(url, currentUrl));
|
|
@@ -1547,7 +1547,7 @@ class Protractor extends Helper {
|
|
|
1547
1547
|
* Checks that current url does not contain a provided fragment.
|
|
1548
1548
|
*
|
|
1549
1549
|
* @param {string} url value to check.
|
|
1550
|
-
*
|
|
1550
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1551
1551
|
*/
|
|
1552
1552
|
async dontSeeInCurrentUrl(url) {
|
|
1553
1553
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').negate(url, currentUrl));
|
|
@@ -1564,7 +1564,7 @@ class Protractor extends Helper {
|
|
|
1564
1564
|
* ```
|
|
1565
1565
|
*
|
|
1566
1566
|
* @param {string} url value to check.
|
|
1567
|
-
*
|
|
1567
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1568
1568
|
*/
|
|
1569
1569
|
async seeCurrentUrlEquals(url) {
|
|
1570
1570
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).assert(url, currentUrl));
|
|
@@ -1580,7 +1580,7 @@ class Protractor extends Helper {
|
|
|
1580
1580
|
* ```
|
|
1581
1581
|
*
|
|
1582
1582
|
* @param {string} url value to check.
|
|
1583
|
-
*
|
|
1583
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1584
1584
|
*/
|
|
1585
1585
|
async dontSeeCurrentUrlEquals(url) {
|
|
1586
1586
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).negate(url, currentUrl));
|
|
@@ -1596,7 +1596,7 @@ class Protractor extends Helper {
|
|
|
1596
1596
|
*
|
|
1597
1597
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1598
1598
|
* @param {string} fileName file name to save.
|
|
1599
|
-
*
|
|
1599
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1600
1600
|
*
|
|
1601
1601
|
*/
|
|
1602
1602
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -1631,7 +1631,7 @@ class Protractor extends Helper {
|
|
|
1631
1631
|
*
|
|
1632
1632
|
* @param {string} fileName file name to save.
|
|
1633
1633
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1634
|
-
*
|
|
1634
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1635
1635
|
*/
|
|
1636
1636
|
async saveScreenshot(fileName, fullPage = false) {
|
|
1637
1637
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -1673,7 +1673,7 @@ class Protractor extends Helper {
|
|
|
1673
1673
|
* ```
|
|
1674
1674
|
*
|
|
1675
1675
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
1676
|
-
*
|
|
1676
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1677
1677
|
*/
|
|
1678
1678
|
async clearCookie(cookie = null) {
|
|
1679
1679
|
if (!cookie) {
|
|
@@ -1690,7 +1690,7 @@ class Protractor extends Helper {
|
|
|
1690
1690
|
* ```
|
|
1691
1691
|
*
|
|
1692
1692
|
* @param {string} name cookie name.
|
|
1693
|
-
*
|
|
1693
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1694
1694
|
*/
|
|
1695
1695
|
async seeCookie(name) {
|
|
1696
1696
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').assert(res));
|
|
@@ -1704,7 +1704,7 @@ class Protractor extends Helper {
|
|
|
1704
1704
|
* ```
|
|
1705
1705
|
*
|
|
1706
1706
|
* @param {string} name cookie name.
|
|
1707
|
-
*
|
|
1707
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1708
1708
|
*/
|
|
1709
1709
|
async dontSeeCookie(name) {
|
|
1710
1710
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').negate(res));
|
|
@@ -1755,7 +1755,7 @@ class Protractor extends Helper {
|
|
|
1755
1755
|
* I.seeInPopup('Popup text');
|
|
1756
1756
|
* ```
|
|
1757
1757
|
* @param {string} text value to check.
|
|
1758
|
-
*
|
|
1758
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1759
1759
|
*/
|
|
1760
1760
|
async seeInPopup(text) {
|
|
1761
1761
|
const popupAlert = await this.browser.switchTo().alert();
|
|
@@ -1795,7 +1795,7 @@ class Protractor extends Helper {
|
|
|
1795
1795
|
*
|
|
1796
1796
|
* @param {number} width width in pixels or `maximize`.
|
|
1797
1797
|
* @param {number} height height in pixels.
|
|
1798
|
-
*
|
|
1798
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1799
1799
|
*/
|
|
1800
1800
|
async resizeWindow(width, height) {
|
|
1801
1801
|
if (width === 'maximize') {
|
|
@@ -1814,7 +1814,7 @@ class Protractor extends Helper {
|
|
|
1814
1814
|
*
|
|
1815
1815
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
1816
1816
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
1817
|
-
*
|
|
1817
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1818
1818
|
*/
|
|
1819
1819
|
async dragAndDrop(srcElement, destElement) {
|
|
1820
1820
|
const srcEl = await this._locate(srcElement, true);
|
|
@@ -1957,7 +1957,7 @@ class Protractor extends Helper {
|
|
|
1957
1957
|
* ```
|
|
1958
1958
|
*
|
|
1959
1959
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1960
|
-
*
|
|
1960
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1961
1961
|
*/
|
|
1962
1962
|
async switchTo(locator) {
|
|
1963
1963
|
if (Number.isInteger(locator)) {
|
|
@@ -1980,7 +1980,7 @@ class Protractor extends Helper {
|
|
|
1980
1980
|
* ```
|
|
1981
1981
|
*
|
|
1982
1982
|
* @param {number} sec number of second to wait.
|
|
1983
|
-
*
|
|
1983
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1984
1984
|
*/
|
|
1985
1985
|
wait(sec) {
|
|
1986
1986
|
return this.browser.sleep(sec * 1000);
|
|
@@ -1997,7 +1997,7 @@ class Protractor extends Helper {
|
|
|
1997
1997
|
*
|
|
1998
1998
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1999
1999
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2000
|
-
*
|
|
2000
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2001
2001
|
*/
|
|
2002
2002
|
async waitForElement(locator, sec = null) {
|
|
2003
2003
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2022,7 +2022,7 @@ class Protractor extends Helper {
|
|
|
2022
2022
|
*
|
|
2023
2023
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2024
2024
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2025
|
-
*
|
|
2025
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2026
2026
|
*/
|
|
2027
2027
|
async waitForDetached(locator, sec = null) {
|
|
2028
2028
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2057,7 +2057,7 @@ class Protractor extends Helper {
|
|
|
2057
2057
|
*
|
|
2058
2058
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2059
2059
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2060
|
-
*
|
|
2060
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2061
2061
|
*/
|
|
2062
2062
|
async waitForVisible(locator, sec = null) {
|
|
2063
2063
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2075,7 +2075,7 @@ class Protractor extends Helper {
|
|
|
2075
2075
|
*
|
|
2076
2076
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2077
2077
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2078
|
-
*
|
|
2078
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2079
2079
|
*/
|
|
2080
2080
|
async waitToHide(locator, sec = null) {
|
|
2081
2081
|
return this.waitForInvisible(locator, sec);
|
|
@@ -2091,7 +2091,7 @@ class Protractor extends Helper {
|
|
|
2091
2091
|
*
|
|
2092
2092
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2093
2093
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2094
|
-
*
|
|
2094
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2095
2095
|
*/
|
|
2096
2096
|
async waitForInvisible(locator, sec = null) {
|
|
2097
2097
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2116,7 +2116,7 @@ class Protractor extends Helper {
|
|
|
2116
2116
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2117
2117
|
* @param {number} num number of elements.
|
|
2118
2118
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2119
|
-
*
|
|
2119
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2120
2120
|
*/
|
|
2121
2121
|
async waitNumberOfVisibleElements(locator, num, sec = null) {
|
|
2122
2122
|
function visibilityCountOf(loc, expectedCount) {
|
|
@@ -2143,7 +2143,7 @@ class Protractor extends Helper {
|
|
|
2143
2143
|
*
|
|
2144
2144
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2145
2145
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2146
|
-
*
|
|
2146
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2147
2147
|
*/
|
|
2148
2148
|
async waitForEnabled(locator, sec = null) {
|
|
2149
2149
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2165,7 +2165,7 @@ class Protractor extends Helper {
|
|
|
2165
2165
|
* @param {LocatorOrString} field input field.
|
|
2166
2166
|
* @param {string }value expected value.
|
|
2167
2167
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2168
|
-
*
|
|
2168
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2169
2169
|
*/
|
|
2170
2170
|
async waitForValue(field, value, sec = null) {
|
|
2171
2171
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2205,7 +2205,7 @@ class Protractor extends Helper {
|
|
|
2205
2205
|
* @param {string|function} fn to be executed in browser context.
|
|
2206
2206
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
2207
2207
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2208
|
-
*
|
|
2208
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2209
2209
|
*/
|
|
2210
2210
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
2211
2211
|
let args = [];
|
|
@@ -2230,7 +2230,7 @@ class Protractor extends Helper {
|
|
|
2230
2230
|
*
|
|
2231
2231
|
* @param {string} urlPart value to check.
|
|
2232
2232
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2233
|
-
*
|
|
2233
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2234
2234
|
*/
|
|
2235
2235
|
async waitInUrl(urlPart, sec = null) {
|
|
2236
2236
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2257,7 +2257,7 @@ class Protractor extends Helper {
|
|
|
2257
2257
|
*
|
|
2258
2258
|
* @param {string} urlPart value to check.
|
|
2259
2259
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2260
|
-
*
|
|
2260
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2261
2261
|
*/
|
|
2262
2262
|
async waitUrlEquals(urlPart, sec = null) {
|
|
2263
2263
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2291,7 +2291,7 @@ class Protractor extends Helper {
|
|
|
2291
2291
|
* @param {string }text to wait for.
|
|
2292
2292
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2293
2293
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
2294
|
-
*
|
|
2294
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2295
2295
|
*/
|
|
2296
2296
|
async waitForText(text, sec = null, context = null) {
|
|
2297
2297
|
if (!context) {
|
|
@@ -2317,7 +2317,7 @@ class Protractor extends Helper {
|
|
|
2317
2317
|
* ```js
|
|
2318
2318
|
* I.refreshPage();
|
|
2319
2319
|
* ```
|
|
2320
|
-
*
|
|
2320
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2321
2321
|
*/
|
|
2322
2322
|
refreshPage() {
|
|
2323
2323
|
return this.browser.refresh();
|
|
@@ -2343,7 +2343,7 @@ class Protractor extends Helper {
|
|
|
2343
2343
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2344
2344
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2345
2345
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2346
|
-
*
|
|
2346
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2347
2347
|
*/
|
|
2348
2348
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
2349
2349
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -2375,7 +2375,7 @@ class Protractor extends Helper {
|
|
|
2375
2375
|
* ```js
|
|
2376
2376
|
* I.scrollPageToTop();
|
|
2377
2377
|
* ```
|
|
2378
|
-
*
|
|
2378
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2379
2379
|
*/
|
|
2380
2380
|
async scrollPageToTop() {
|
|
2381
2381
|
return this.executeScript('window.scrollTo(0, 0);');
|
|
@@ -2387,7 +2387,7 @@ class Protractor extends Helper {
|
|
|
2387
2387
|
* ```js
|
|
2388
2388
|
* I.scrollPageToBottom();
|
|
2389
2389
|
* ```
|
|
2390
|
-
*
|
|
2390
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2391
2391
|
*/
|
|
2392
2392
|
async scrollPageToBottom() {
|
|
2393
2393
|
/* eslint-disable prefer-arrow-callback, comma-dangle */
|
|
@@ -2469,7 +2469,7 @@ class Protractor extends Helper {
|
|
|
2469
2469
|
* ```
|
|
2470
2470
|
*
|
|
2471
2471
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2472
|
-
*
|
|
2472
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2473
2473
|
*/
|
|
2474
2474
|
setCookie(cookie) {
|
|
2475
2475
|
return this.browser.manage().addCookie(cookie);
|