codeceptjs 3.5.8 → 3.5.9-beta.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/README.md +1 -1
- package/docs/build/Appium.js +24 -24
- package/docs/build/Nightmare.js +51 -52
- package/docs/build/Playwright.js +137 -76
- package/docs/build/Protractor.js +64 -65
- package/docs/build/Puppeteer.js +74 -75
- package/docs/build/TestCafe.js +54 -55
- package/docs/build/WebDriver.js +79 -80
- package/docs/changelog.md +1 -571
- package/docs/community-helpers.md +4 -8
- package/docs/examples.md +2 -8
- package/docs/helpers/Appium.md +19 -19
- package/docs/helpers/Nightmare.md +75 -77
- package/docs/helpers/Playwright.md +350 -314
- package/docs/helpers/Protractor.md +153 -155
- package/docs/helpers/Puppeteer.md +146 -148
- package/docs/helpers/TestCafe.md +124 -126
- package/docs/helpers/WebDriver.md +155 -157
- package/docs/internal-api.md +111 -0
- package/docs/plugins.md +4 -2
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -1
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -2
- 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/fillField.mustache +1 -1
- package/docs/webapi/focus.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/command/run-multiple.js +1 -1
- package/lib/command/run-workers.js +30 -4
- package/lib/command/workers/runTests.js +23 -0
- package/lib/event.js +2 -0
- package/lib/helper/Appium.js +10 -10
- package/lib/helper/Playwright.js +78 -7
- package/lib/helper/Puppeteer.js +7 -3
- package/lib/helper/WebDriver.js +6 -2
- package/lib/interfaces/gherkin.js +8 -1
- package/lib/interfaces/scenarioConfig.js +1 -0
- package/lib/locator.js +2 -2
- package/lib/plugin/autoLogin.js +4 -2
- package/lib/plugin/retryFailedStep.js +5 -0
- package/lib/plugin/stepByStepReport.js +2 -2
- package/lib/ui.js +1 -0
- package/lib/workers.js +2 -0
- package/package.json +4 -4
- package/typings/promiseBasedTypes.d.ts +449 -1008
- package/typings/types.d.ts +452 -425
package/docs/build/Playwright.js
CHANGED
|
@@ -94,6 +94,7 @@ const pathSeparator = path.sep;
|
|
|
94
94
|
* @prop {boolean} [ignoreHTTPSErrors] - Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
95
95
|
* @prop {boolean} [bypassCSP] - bypass Content Security Policy or CSP
|
|
96
96
|
* @prop {boolean} [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
97
|
+
* @prop {object} [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
97
98
|
*/
|
|
98
99
|
const config = {};
|
|
99
100
|
|
|
@@ -141,6 +142,21 @@ const config = {};
|
|
|
141
142
|
* * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
|
|
142
143
|
* * `keepTraceForPassedTests`: - save trace for passed tests
|
|
143
144
|
*
|
|
145
|
+
* #### HAR Recording Customization
|
|
146
|
+
*
|
|
147
|
+
* A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
|
|
148
|
+
* It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests.
|
|
149
|
+
* HAR will be saved to `output/har`. More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har.
|
|
150
|
+
*
|
|
151
|
+
* ```
|
|
152
|
+
* ...
|
|
153
|
+
* recordHar: {
|
|
154
|
+
* mode: 'minimal', // possible values: 'minimal'|'full'.
|
|
155
|
+
* content: 'embed' // possible values: "omit"|"embed"|"attach".
|
|
156
|
+
* }
|
|
157
|
+
* ...
|
|
158
|
+
*```
|
|
159
|
+
*
|
|
144
160
|
* #### Example #1: Wait for 0 network connections.
|
|
145
161
|
*
|
|
146
162
|
* ```js
|
|
@@ -455,7 +471,8 @@ class Playwright extends Helper {
|
|
|
455
471
|
}
|
|
456
472
|
}
|
|
457
473
|
|
|
458
|
-
async _before() {
|
|
474
|
+
async _before(test) {
|
|
475
|
+
this.currentRunningTest = test;
|
|
459
476
|
recorder.retry({
|
|
460
477
|
retries: 5,
|
|
461
478
|
when: err => {
|
|
@@ -487,6 +504,15 @@ class Playwright extends Helper {
|
|
|
487
504
|
}
|
|
488
505
|
if (this.options.bypassCSP) contextOptions.bypassCSP = this.options.bypassCSP;
|
|
489
506
|
if (this.options.recordVideo) contextOptions.recordVideo = this.options.recordVideo;
|
|
507
|
+
if (this.options.recordHar) {
|
|
508
|
+
const harExt = this.options.recordHar.content && this.options.recordHar.content === 'attach' ? 'zip' : 'har';
|
|
509
|
+
const fileName = `${`${global.output_dir}${path.sep}har${path.sep}${uuidv4()}_${clearString(this.currentRunningTest.title)}`.slice(0, 245)}.${harExt}`;
|
|
510
|
+
const dir = path.dirname(fileName);
|
|
511
|
+
if (!fileExists(dir)) fs.mkdirSync(dir);
|
|
512
|
+
this.options.recordHar.path = fileName;
|
|
513
|
+
this.currentRunningTest.artifacts.har = fileName;
|
|
514
|
+
contextOptions.recordHar = this.options.recordHar;
|
|
515
|
+
}
|
|
490
516
|
if (this.storageState) contextOptions.storageState = this.storageState;
|
|
491
517
|
if (this.options.userAgent) contextOptions.userAgent = this.options.userAgent;
|
|
492
518
|
if (this.options.locale) contextOptions.locale = this.options.locale;
|
|
@@ -698,7 +724,7 @@ class Playwright extends Helper {
|
|
|
698
724
|
* I.seeInPopup('Popup text');
|
|
699
725
|
* ```
|
|
700
726
|
* @param {string} text value to check.
|
|
701
|
-
* @returns {
|
|
727
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
702
728
|
*
|
|
703
729
|
*/
|
|
704
730
|
async seeInPopup(text) {
|
|
@@ -842,6 +868,7 @@ class Playwright extends Helper {
|
|
|
842
868
|
this.context = null;
|
|
843
869
|
this.frame = null;
|
|
844
870
|
popupStore.clear();
|
|
871
|
+
if (this.options.recordHar) await this.browserContext.close();
|
|
845
872
|
await this.browser.close();
|
|
846
873
|
}
|
|
847
874
|
|
|
@@ -904,7 +931,7 @@ class Playwright extends Helper {
|
|
|
904
931
|
* ```
|
|
905
932
|
*
|
|
906
933
|
* @param {string} url url path or global url.
|
|
907
|
-
* @returns {
|
|
934
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
908
935
|
*
|
|
909
936
|
*/
|
|
910
937
|
async amOnPage(url) {
|
|
@@ -943,7 +970,7 @@ class Playwright extends Helper {
|
|
|
943
970
|
*
|
|
944
971
|
* @param {number} width width in pixels or `maximize`.
|
|
945
972
|
* @param {number} height height in pixels.
|
|
946
|
-
* @returns {
|
|
973
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
947
974
|
*
|
|
948
975
|
*
|
|
949
976
|
* Unlike other drivers Playwright changes the size of a viewport, not the window!
|
|
@@ -997,7 +1024,7 @@ class Playwright extends Helper {
|
|
|
997
1024
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
998
1025
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
999
1026
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
1000
|
-
* @returns {
|
|
1027
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1001
1028
|
*
|
|
1002
1029
|
*
|
|
1003
1030
|
*/
|
|
@@ -1024,7 +1051,7 @@ class Playwright extends Helper {
|
|
|
1024
1051
|
*
|
|
1025
1052
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1026
1053
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
|
|
1027
|
-
* @returns {
|
|
1054
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1028
1055
|
*
|
|
1029
1056
|
*
|
|
1030
1057
|
*/
|
|
@@ -1054,7 +1081,7 @@ class Playwright extends Helper {
|
|
|
1054
1081
|
*
|
|
1055
1082
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1056
1083
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
|
|
1057
|
-
* @returns {
|
|
1084
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1058
1085
|
*
|
|
1059
1086
|
*
|
|
1060
1087
|
*/
|
|
@@ -1107,7 +1134,7 @@ class Playwright extends Helper {
|
|
|
1107
1134
|
*
|
|
1108
1135
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
1109
1136
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
1110
|
-
* @returns {
|
|
1137
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1111
1138
|
*
|
|
1112
1139
|
* @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
|
|
1113
1140
|
*
|
|
@@ -1165,20 +1192,47 @@ class Playwright extends Helper {
|
|
|
1165
1192
|
* ```js
|
|
1166
1193
|
* I.refreshPage();
|
|
1167
1194
|
* ```
|
|
1168
|
-
* @returns {
|
|
1195
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1169
1196
|
*
|
|
1170
1197
|
*/
|
|
1171
1198
|
async refreshPage() {
|
|
1172
1199
|
return this.page.reload({ timeout: this.options.getPageTimeout, waitUntil: this.options.waitForNavigation });
|
|
1173
1200
|
}
|
|
1174
1201
|
|
|
1202
|
+
/**
|
|
1203
|
+
* Replaying from HAR
|
|
1204
|
+
*
|
|
1205
|
+
* ```js
|
|
1206
|
+
* // Replay API requests from HAR.
|
|
1207
|
+
* // Either use a matching response from the HAR,
|
|
1208
|
+
* // or abort the request if nothing matches.
|
|
1209
|
+
* I.replayFromHar('./output/har/something.har', { url: "*\/**\/api/v1/fruits" });
|
|
1210
|
+
* I.amOnPage('https://demo.playwright.dev/api-mocking');
|
|
1211
|
+
* I.see('CodeceptJS');
|
|
1212
|
+
* ```
|
|
1213
|
+
*
|
|
1214
|
+
* @param {string} harFilePath Path to recorded HAR file
|
|
1215
|
+
* @param {object} [opts] [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har)
|
|
1216
|
+
*
|
|
1217
|
+
* @returns Promise<void>
|
|
1218
|
+
*/
|
|
1219
|
+
async replayFromHar(harFilePath, opts) {
|
|
1220
|
+
const file = path.join(global.codecept_dir, harFilePath);
|
|
1221
|
+
|
|
1222
|
+
if (!fileExists(file)) {
|
|
1223
|
+
throw new Error(`File at ${file} cannot be found on local system`);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
await this.page.routeFromHAR(harFilePath, opts);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1175
1229
|
/**
|
|
1176
1230
|
* Scroll page to the top.
|
|
1177
1231
|
*
|
|
1178
1232
|
* ```js
|
|
1179
1233
|
* I.scrollPageToTop();
|
|
1180
1234
|
* ```
|
|
1181
|
-
* @returns {
|
|
1235
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1182
1236
|
*
|
|
1183
1237
|
*/
|
|
1184
1238
|
scrollPageToTop() {
|
|
@@ -1193,7 +1247,7 @@ class Playwright extends Helper {
|
|
|
1193
1247
|
* ```js
|
|
1194
1248
|
* I.scrollPageToBottom();
|
|
1195
1249
|
* ```
|
|
1196
|
-
* @returns {
|
|
1250
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1197
1251
|
*
|
|
1198
1252
|
*/
|
|
1199
1253
|
async scrollPageToBottom() {
|
|
@@ -1222,7 +1276,7 @@ class Playwright extends Helper {
|
|
|
1222
1276
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1223
1277
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
1224
1278
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
1225
|
-
* @returns {
|
|
1279
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1226
1280
|
*
|
|
1227
1281
|
*/
|
|
1228
1282
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -1252,7 +1306,7 @@ class Playwright extends Helper {
|
|
|
1252
1306
|
* ```
|
|
1253
1307
|
*
|
|
1254
1308
|
* @param {string} text text value to check.
|
|
1255
|
-
* @returns {
|
|
1309
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1256
1310
|
*
|
|
1257
1311
|
*/
|
|
1258
1312
|
async seeInTitle(text) {
|
|
@@ -1291,7 +1345,7 @@ class Playwright extends Helper {
|
|
|
1291
1345
|
* ```
|
|
1292
1346
|
*
|
|
1293
1347
|
* @param {string} text value to check.
|
|
1294
|
-
* @returns {
|
|
1348
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1295
1349
|
*
|
|
1296
1350
|
*/
|
|
1297
1351
|
async seeTitleEquals(text) {
|
|
@@ -1307,7 +1361,7 @@ class Playwright extends Helper {
|
|
|
1307
1361
|
* ```
|
|
1308
1362
|
*
|
|
1309
1363
|
* @param {string} text value to check.
|
|
1310
|
-
* @returns {
|
|
1364
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1311
1365
|
*
|
|
1312
1366
|
*/
|
|
1313
1367
|
async dontSeeInTitle(text) {
|
|
@@ -1532,7 +1586,7 @@ class Playwright extends Helper {
|
|
|
1532
1586
|
* I.seeElement('#modal');
|
|
1533
1587
|
* ```
|
|
1534
1588
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1535
|
-
* @returns {
|
|
1589
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1536
1590
|
*
|
|
1537
1591
|
*
|
|
1538
1592
|
*/
|
|
@@ -1550,7 +1604,7 @@ class Playwright extends Helper {
|
|
|
1550
1604
|
* ```
|
|
1551
1605
|
*
|
|
1552
1606
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1553
|
-
* @returns {
|
|
1607
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1554
1608
|
*
|
|
1555
1609
|
*
|
|
1556
1610
|
*/
|
|
@@ -1568,7 +1622,7 @@ class Playwright extends Helper {
|
|
|
1568
1622
|
* I.seeElementInDOM('#modal');
|
|
1569
1623
|
* ```
|
|
1570
1624
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1571
|
-
* @returns {
|
|
1625
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1572
1626
|
*
|
|
1573
1627
|
*/
|
|
1574
1628
|
async seeElementInDOM(locator) {
|
|
@@ -1584,7 +1638,7 @@ class Playwright extends Helper {
|
|
|
1584
1638
|
* ```
|
|
1585
1639
|
*
|
|
1586
1640
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1587
|
-
* @returns {
|
|
1641
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1588
1642
|
*
|
|
1589
1643
|
*/
|
|
1590
1644
|
async dontSeeElementInDOM(locator) {
|
|
@@ -1650,7 +1704,7 @@ class Playwright extends Helper {
|
|
|
1650
1704
|
*
|
|
1651
1705
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1652
1706
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1653
|
-
* @returns {
|
|
1707
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1654
1708
|
*
|
|
1655
1709
|
*
|
|
1656
1710
|
* @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
@@ -1707,7 +1761,7 @@ class Playwright extends Helper {
|
|
|
1707
1761
|
*
|
|
1708
1762
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1709
1763
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1710
|
-
* @returns {
|
|
1764
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1711
1765
|
*
|
|
1712
1766
|
*/
|
|
1713
1767
|
async forceClick(locator, context = null) {
|
|
@@ -1727,7 +1781,7 @@ class Playwright extends Helper {
|
|
|
1727
1781
|
*
|
|
1728
1782
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1729
1783
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1730
|
-
* @returns {
|
|
1784
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1731
1785
|
*
|
|
1732
1786
|
*
|
|
1733
1787
|
*
|
|
@@ -1750,7 +1804,7 @@ class Playwright extends Helper {
|
|
|
1750
1804
|
*
|
|
1751
1805
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1752
1806
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1753
|
-
* @returns {
|
|
1807
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1754
1808
|
*
|
|
1755
1809
|
*
|
|
1756
1810
|
*
|
|
@@ -1772,7 +1826,7 @@ class Playwright extends Helper {
|
|
|
1772
1826
|
* ```
|
|
1773
1827
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1774
1828
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1775
|
-
* @returns {
|
|
1829
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1776
1830
|
*
|
|
1777
1831
|
*
|
|
1778
1832
|
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
|
|
@@ -1804,7 +1858,7 @@ class Playwright extends Helper {
|
|
|
1804
1858
|
* ```
|
|
1805
1859
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1806
1860
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1807
|
-
* @returns {
|
|
1861
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1808
1862
|
*
|
|
1809
1863
|
*
|
|
1810
1864
|
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
|
|
@@ -1833,7 +1887,7 @@ class Playwright extends Helper {
|
|
|
1833
1887
|
* ```
|
|
1834
1888
|
*
|
|
1835
1889
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1836
|
-
* @returns {
|
|
1890
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1837
1891
|
*
|
|
1838
1892
|
*/
|
|
1839
1893
|
async seeCheckboxIsChecked(field) {
|
|
@@ -1850,7 +1904,7 @@ class Playwright extends Helper {
|
|
|
1850
1904
|
* ```
|
|
1851
1905
|
*
|
|
1852
1906
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1853
|
-
* @returns {
|
|
1907
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1854
1908
|
*
|
|
1855
1909
|
*/
|
|
1856
1910
|
async dontSeeCheckboxIsChecked(field) {
|
|
@@ -1869,7 +1923,7 @@ class Playwright extends Helper {
|
|
|
1869
1923
|
* ```
|
|
1870
1924
|
*
|
|
1871
1925
|
* @param {string} key name of key to press down.
|
|
1872
|
-
* @returns {
|
|
1926
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1873
1927
|
*
|
|
1874
1928
|
*/
|
|
1875
1929
|
async pressKeyDown(key) {
|
|
@@ -1890,7 +1944,7 @@ class Playwright extends Helper {
|
|
|
1890
1944
|
* ```
|
|
1891
1945
|
*
|
|
1892
1946
|
* @param {string} key name of key to release.
|
|
1893
|
-
* @returns {
|
|
1947
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1894
1948
|
*
|
|
1895
1949
|
*/
|
|
1896
1950
|
async pressKeyUp(key) {
|
|
@@ -1959,7 +2013,7 @@ class Playwright extends Helper {
|
|
|
1959
2013
|
* - `'Tab'`
|
|
1960
2014
|
*
|
|
1961
2015
|
* @param {string|string[]} key key or array of keys to press.
|
|
1962
|
-
* @returns {
|
|
2016
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
1963
2017
|
*
|
|
1964
2018
|
*
|
|
1965
2019
|
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
@@ -2010,7 +2064,7 @@ class Playwright extends Helper {
|
|
|
2010
2064
|
*
|
|
2011
2065
|
* @param {string|string[]} key or array of keys to type.
|
|
2012
2066
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
2013
|
-
* @returns {
|
|
2067
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2014
2068
|
*
|
|
2015
2069
|
*/
|
|
2016
2070
|
async type(keys, delay = null) {
|
|
@@ -2041,7 +2095,7 @@ class Playwright extends Helper {
|
|
|
2041
2095
|
* ```
|
|
2042
2096
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
2043
2097
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
2044
|
-
* @returns {
|
|
2098
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2045
2099
|
*
|
|
2046
2100
|
*
|
|
2047
2101
|
*/
|
|
@@ -2100,7 +2154,7 @@ class Playwright extends Helper {
|
|
|
2100
2154
|
* ```
|
|
2101
2155
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
2102
2156
|
* @param {string} value text value to append.
|
|
2103
|
-
* @returns {
|
|
2157
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2104
2158
|
*
|
|
2105
2159
|
*
|
|
2106
2160
|
*
|
|
@@ -2126,7 +2180,7 @@ class Playwright extends Helper {
|
|
|
2126
2180
|
* ```
|
|
2127
2181
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
2128
2182
|
* @param {CodeceptJS.StringOrSecret} value value to check.
|
|
2129
|
-
* @returns {
|
|
2183
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2130
2184
|
*
|
|
2131
2185
|
*/
|
|
2132
2186
|
async seeInField(field, value) {
|
|
@@ -2145,7 +2199,7 @@ class Playwright extends Helper {
|
|
|
2145
2199
|
*
|
|
2146
2200
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
2147
2201
|
* @param {CodeceptJS.StringOrSecret} value value to check.
|
|
2148
|
-
* @returns {
|
|
2202
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2149
2203
|
*
|
|
2150
2204
|
*/
|
|
2151
2205
|
async dontSeeInField(field, value) {
|
|
@@ -2165,7 +2219,7 @@ class Playwright extends Helper {
|
|
|
2165
2219
|
*
|
|
2166
2220
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
2167
2221
|
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
2168
|
-
* @returns {
|
|
2222
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2169
2223
|
*
|
|
2170
2224
|
*
|
|
2171
2225
|
*/
|
|
@@ -2202,7 +2256,7 @@ class Playwright extends Helper {
|
|
|
2202
2256
|
* ```
|
|
2203
2257
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
2204
2258
|
* @param {string|Array<*>} option visible text or value of option.
|
|
2205
|
-
* @returns {
|
|
2259
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2206
2260
|
*
|
|
2207
2261
|
*/
|
|
2208
2262
|
async selectOption(select, option) {
|
|
@@ -2244,7 +2298,7 @@ class Playwright extends Helper {
|
|
|
2244
2298
|
* ```
|
|
2245
2299
|
*
|
|
2246
2300
|
* @param {string} url a fragment to check
|
|
2247
|
-
* @returns {
|
|
2301
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2248
2302
|
*
|
|
2249
2303
|
*/
|
|
2250
2304
|
async seeInCurrentUrl(url) {
|
|
@@ -2255,7 +2309,7 @@ class Playwright extends Helper {
|
|
|
2255
2309
|
* Checks that current url does not contain a provided fragment.
|
|
2256
2310
|
*
|
|
2257
2311
|
* @param {string} url value to check.
|
|
2258
|
-
* @returns {
|
|
2312
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2259
2313
|
*
|
|
2260
2314
|
*/
|
|
2261
2315
|
async dontSeeInCurrentUrl(url) {
|
|
@@ -2273,7 +2327,7 @@ class Playwright extends Helper {
|
|
|
2273
2327
|
* ```
|
|
2274
2328
|
*
|
|
2275
2329
|
* @param {string} url value to check.
|
|
2276
|
-
* @returns {
|
|
2330
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2277
2331
|
*
|
|
2278
2332
|
*/
|
|
2279
2333
|
async seeCurrentUrlEquals(url) {
|
|
@@ -2290,7 +2344,7 @@ class Playwright extends Helper {
|
|
|
2290
2344
|
* ```
|
|
2291
2345
|
*
|
|
2292
2346
|
* @param {string} url value to check.
|
|
2293
|
-
* @returns {
|
|
2347
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2294
2348
|
*
|
|
2295
2349
|
*/
|
|
2296
2350
|
async dontSeeCurrentUrlEquals(url) {
|
|
@@ -2308,7 +2362,7 @@ class Playwright extends Helper {
|
|
|
2308
2362
|
* ```
|
|
2309
2363
|
* @param {string} text expected on page.
|
|
2310
2364
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
2311
|
-
* @returns {
|
|
2365
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2312
2366
|
*
|
|
2313
2367
|
*
|
|
2314
2368
|
*
|
|
@@ -2326,7 +2380,7 @@ class Playwright extends Helper {
|
|
|
2326
2380
|
*
|
|
2327
2381
|
* @param {string} text element value to check.
|
|
2328
2382
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
2329
|
-
* @returns {
|
|
2383
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2330
2384
|
*
|
|
2331
2385
|
*/
|
|
2332
2386
|
async seeTextEquals(text, context = null) {
|
|
@@ -2344,7 +2398,7 @@ class Playwright extends Helper {
|
|
|
2344
2398
|
*
|
|
2345
2399
|
* @param {string} text which is not present.
|
|
2346
2400
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
2347
|
-
* @returns {
|
|
2401
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2348
2402
|
*
|
|
2349
2403
|
*
|
|
2350
2404
|
*
|
|
@@ -2406,7 +2460,7 @@ class Playwright extends Helper {
|
|
|
2406
2460
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
2407
2461
|
* ```
|
|
2408
2462
|
* @param {string} text value to check.
|
|
2409
|
-
* @returns {
|
|
2463
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2410
2464
|
*
|
|
2411
2465
|
*/
|
|
2412
2466
|
async seeInSource(text) {
|
|
@@ -2422,7 +2476,7 @@ class Playwright extends Helper {
|
|
|
2422
2476
|
* ```
|
|
2423
2477
|
*
|
|
2424
2478
|
* @param {string} value to check.
|
|
2425
|
-
* @returns {
|
|
2479
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2426
2480
|
*
|
|
2427
2481
|
*/
|
|
2428
2482
|
async dontSeeInSource(text) {
|
|
@@ -2441,7 +2495,7 @@ class Playwright extends Helper {
|
|
|
2441
2495
|
*
|
|
2442
2496
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2443
2497
|
* @param {number} num number of elements.
|
|
2444
|
-
* @returns {
|
|
2498
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2445
2499
|
*
|
|
2446
2500
|
*
|
|
2447
2501
|
*
|
|
@@ -2461,7 +2515,7 @@ class Playwright extends Helper {
|
|
|
2461
2515
|
*
|
|
2462
2516
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2463
2517
|
* @param {number} num number of elements.
|
|
2464
|
-
* @returns {
|
|
2518
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2465
2519
|
*
|
|
2466
2520
|
*
|
|
2467
2521
|
*
|
|
@@ -2487,7 +2541,7 @@ class Playwright extends Helper {
|
|
|
2487
2541
|
* ```
|
|
2488
2542
|
*
|
|
2489
2543
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2490
|
-
* @returns {
|
|
2544
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2491
2545
|
*
|
|
2492
2546
|
*/
|
|
2493
2547
|
async setCookie(cookie) {
|
|
@@ -2505,7 +2559,7 @@ class Playwright extends Helper {
|
|
|
2505
2559
|
* ```
|
|
2506
2560
|
*
|
|
2507
2561
|
* @param {string} name cookie name.
|
|
2508
|
-
* @returns {
|
|
2562
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2509
2563
|
*
|
|
2510
2564
|
*
|
|
2511
2565
|
*/
|
|
@@ -2522,7 +2576,7 @@ class Playwright extends Helper {
|
|
|
2522
2576
|
* ```
|
|
2523
2577
|
*
|
|
2524
2578
|
* @param {string} name cookie name.
|
|
2525
|
-
* @returns {
|
|
2579
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2526
2580
|
*
|
|
2527
2581
|
*/
|
|
2528
2582
|
async dontSeeCookie(name) {
|
|
@@ -2559,16 +2613,15 @@ class Playwright extends Helper {
|
|
|
2559
2613
|
*
|
|
2560
2614
|
* ```js
|
|
2561
2615
|
* I.clearCookie();
|
|
2562
|
-
* I.clearCookie('test');
|
|
2616
|
+
* I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
|
|
2563
2617
|
* ```
|
|
2564
2618
|
*
|
|
2565
2619
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2566
|
-
* @returns {Promise<void>} automatically synchronized promise through #recorder
|
|
2567
2620
|
*
|
|
2568
2621
|
*/
|
|
2569
2622
|
async clearCookie() {
|
|
2570
2623
|
// Playwright currently doesn't support to delete a certain cookie
|
|
2571
|
-
// https://github.com/microsoft/playwright/blob/main/docs/api.md#
|
|
2624
|
+
// https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md#async-method-browsercontextclearcookies
|
|
2572
2625
|
if (!this.browserContext) return;
|
|
2573
2626
|
return this.browserContext.clearCookies();
|
|
2574
2627
|
}
|
|
@@ -2793,7 +2846,7 @@ class Playwright extends Helper {
|
|
|
2793
2846
|
*
|
|
2794
2847
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2795
2848
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
2796
|
-
* @returns {
|
|
2849
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2797
2850
|
*
|
|
2798
2851
|
*
|
|
2799
2852
|
*/
|
|
@@ -2839,7 +2892,7 @@ class Playwright extends Helper {
|
|
|
2839
2892
|
*
|
|
2840
2893
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2841
2894
|
* @param {object} attributes attributes and their values to check.
|
|
2842
|
-
* @returns {
|
|
2895
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2843
2896
|
*
|
|
2844
2897
|
*
|
|
2845
2898
|
*/
|
|
@@ -2879,7 +2932,7 @@ class Playwright extends Helper {
|
|
|
2879
2932
|
*
|
|
2880
2933
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2881
2934
|
* @param {number} offsetX position to drag.
|
|
2882
|
-
* @returns {
|
|
2935
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2883
2936
|
*
|
|
2884
2937
|
*
|
|
2885
2938
|
*/
|
|
@@ -2957,7 +3010,7 @@ class Playwright extends Helper {
|
|
|
2957
3010
|
*
|
|
2958
3011
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2959
3012
|
* @param {string} fileName file name to save.
|
|
2960
|
-
* @returns {
|
|
3013
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2961
3014
|
*
|
|
2962
3015
|
*
|
|
2963
3016
|
*/
|
|
@@ -2983,7 +3036,7 @@ class Playwright extends Helper {
|
|
|
2983
3036
|
*
|
|
2984
3037
|
* @param {string} fileName file name to save.
|
|
2985
3038
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2986
|
-
* @returns {
|
|
3039
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
2987
3040
|
*
|
|
2988
3041
|
*/
|
|
2989
3042
|
async saveScreenshot(fileName, fullPage) {
|
|
@@ -3084,6 +3137,10 @@ class Playwright extends Helper {
|
|
|
3084
3137
|
test.artifacts[`trace_${sessionName}`] = await saveTraceForContext(this.sessionPages[sessionName].context, `${test.title}_${sessionName}.failed`);
|
|
3085
3138
|
}
|
|
3086
3139
|
}
|
|
3140
|
+
|
|
3141
|
+
if (this.options.recordHar) {
|
|
3142
|
+
test.artifacts.har = this.currentRunningTest.artifacts.har;
|
|
3143
|
+
}
|
|
3087
3144
|
}
|
|
3088
3145
|
|
|
3089
3146
|
async _passed(test) {
|
|
@@ -3111,6 +3168,10 @@ class Playwright extends Helper {
|
|
|
3111
3168
|
await this.browserContext.tracing.stop();
|
|
3112
3169
|
}
|
|
3113
3170
|
}
|
|
3171
|
+
|
|
3172
|
+
if (this.options.recordHar) {
|
|
3173
|
+
test.artifacts.har = this.currentRunningTest.artifacts.har;
|
|
3174
|
+
}
|
|
3114
3175
|
}
|
|
3115
3176
|
|
|
3116
3177
|
/**
|
|
@@ -3121,7 +3182,7 @@ class Playwright extends Helper {
|
|
|
3121
3182
|
* ```
|
|
3122
3183
|
*
|
|
3123
3184
|
* @param {number} sec number of second to wait.
|
|
3124
|
-
* @returns {
|
|
3185
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3125
3186
|
*
|
|
3126
3187
|
*/
|
|
3127
3188
|
async wait(sec) {
|
|
@@ -3136,7 +3197,7 @@ class Playwright extends Helper {
|
|
|
3136
3197
|
*
|
|
3137
3198
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3138
3199
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
3139
|
-
* @returns {
|
|
3200
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3140
3201
|
*
|
|
3141
3202
|
*/
|
|
3142
3203
|
async waitForEnabled(locator, sec) {
|
|
@@ -3172,7 +3233,7 @@ class Playwright extends Helper {
|
|
|
3172
3233
|
* @param {LocatorOrString} field input field.
|
|
3173
3234
|
* @param {string }value expected value.
|
|
3174
3235
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3175
|
-
* @returns {
|
|
3236
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3176
3237
|
*
|
|
3177
3238
|
*/
|
|
3178
3239
|
async waitForValue(field, value, sec) {
|
|
@@ -3209,7 +3270,7 @@ class Playwright extends Helper {
|
|
|
3209
3270
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3210
3271
|
* @param {number} num number of elements.
|
|
3211
3272
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3212
|
-
* @returns {
|
|
3273
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3213
3274
|
*
|
|
3214
3275
|
*
|
|
3215
3276
|
*/
|
|
@@ -3251,7 +3312,7 @@ class Playwright extends Helper {
|
|
|
3251
3312
|
*
|
|
3252
3313
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3253
3314
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3254
|
-
* @returns {
|
|
3315
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3255
3316
|
*
|
|
3256
3317
|
*/
|
|
3257
3318
|
async waitForClickable(locator, waitTimeout) {
|
|
@@ -3270,7 +3331,7 @@ class Playwright extends Helper {
|
|
|
3270
3331
|
*
|
|
3271
3332
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3272
3333
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3273
|
-
* @returns {
|
|
3334
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3274
3335
|
*
|
|
3275
3336
|
*
|
|
3276
3337
|
*/
|
|
@@ -3296,7 +3357,7 @@ class Playwright extends Helper {
|
|
|
3296
3357
|
*
|
|
3297
3358
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3298
3359
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3299
|
-
* @returns {
|
|
3360
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3300
3361
|
*
|
|
3301
3362
|
*
|
|
3302
3363
|
* This method accepts [React selectors](https://codecept.io/react).
|
|
@@ -3337,7 +3398,7 @@ class Playwright extends Helper {
|
|
|
3337
3398
|
*
|
|
3338
3399
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3339
3400
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3340
|
-
* @returns {
|
|
3401
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3341
3402
|
*
|
|
3342
3403
|
*/
|
|
3343
3404
|
async waitForInvisible(locator, sec) {
|
|
@@ -3377,7 +3438,7 @@ class Playwright extends Helper {
|
|
|
3377
3438
|
*
|
|
3378
3439
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3379
3440
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3380
|
-
* @returns {
|
|
3441
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3381
3442
|
*
|
|
3382
3443
|
*/
|
|
3383
3444
|
async waitToHide(locator, sec) {
|
|
@@ -3421,7 +3482,7 @@ class Playwright extends Helper {
|
|
|
3421
3482
|
*
|
|
3422
3483
|
* @param {string} urlPart value to check.
|
|
3423
3484
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3424
|
-
* @returns {
|
|
3485
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3425
3486
|
*
|
|
3426
3487
|
*/
|
|
3427
3488
|
async waitInUrl(urlPart, sec = null) {
|
|
@@ -3450,7 +3511,7 @@ class Playwright extends Helper {
|
|
|
3450
3511
|
*
|
|
3451
3512
|
* @param {string} urlPart value to check.
|
|
3452
3513
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3453
|
-
* @returns {
|
|
3514
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3454
3515
|
*
|
|
3455
3516
|
*/
|
|
3456
3517
|
async waitUrlEquals(urlPart, sec = null) {
|
|
@@ -3487,7 +3548,7 @@ class Playwright extends Helper {
|
|
|
3487
3548
|
* @param {string }text to wait for.
|
|
3488
3549
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3489
3550
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3490
|
-
* @returns {
|
|
3551
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3491
3552
|
*
|
|
3492
3553
|
*/
|
|
3493
3554
|
async waitForText(text, sec = null, context = null) {
|
|
@@ -3572,7 +3633,7 @@ class Playwright extends Helper {
|
|
|
3572
3633
|
* ```
|
|
3573
3634
|
*
|
|
3574
3635
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3575
|
-
* @returns {
|
|
3636
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3576
3637
|
*
|
|
3577
3638
|
*/
|
|
3578
3639
|
async switchTo(locator) {
|
|
@@ -3644,7 +3705,7 @@ class Playwright extends Helper {
|
|
|
3644
3705
|
* @param {string|function} fn to be executed in browser context.
|
|
3645
3706
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3646
3707
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3647
|
-
* @returns {
|
|
3708
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3648
3709
|
*
|
|
3649
3710
|
*/
|
|
3650
3711
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
@@ -3713,7 +3774,7 @@ class Playwright extends Helper {
|
|
|
3713
3774
|
*
|
|
3714
3775
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3715
3776
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3716
|
-
* @returns {
|
|
3777
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3717
3778
|
*
|
|
3718
3779
|
*/
|
|
3719
3780
|
async waitForDetached(locator, sec) {
|
|
@@ -3764,7 +3825,7 @@ class Playwright extends Helper {
|
|
|
3764
3825
|
* loadEventEnd: 241
|
|
3765
3826
|
* }
|
|
3766
3827
|
* ```
|
|
3767
|
-
* @returns {
|
|
3828
|
+
* @returns {void} automatically synchronized promise through #recorder
|
|
3768
3829
|
*
|
|
3769
3830
|
*/
|
|
3770
3831
|
async grabDataFromPerformanceTiming() {
|
|
@@ -4465,7 +4526,7 @@ async function proceedSee(assertType, text, context, strict = false) {
|
|
|
4465
4526
|
if (!context) {
|
|
4466
4527
|
const el = await this.context;
|
|
4467
4528
|
|
|
4468
|
-
allText = el.constructor.name ? [await el.locator('body').innerText()] : [await el.innerText()];
|
|
4529
|
+
allText = el.constructor.name !== 'Locator' ? [await el.locator('body').innerText()] : [await el.innerText()];
|
|
4469
4530
|
|
|
4470
4531
|
description = 'web application';
|
|
4471
4532
|
} else {
|