codeceptjs 3.5.4-beta.1 → 3.5.4
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 +0 -2
- package/docs/build/Appium.js +8 -6
- package/docs/build/GraphQL.js +25 -0
- package/docs/build/Nightmare.js +11 -6
- package/docs/build/Playwright.js +425 -193
- package/docs/build/Protractor.js +13 -8
- package/docs/build/Puppeteer.js +20 -14
- package/docs/build/TestCafe.js +17 -10
- package/docs/build/WebDriver.js +41 -37
- package/docs/changelog.md +220 -0
- package/docs/community-helpers.md +8 -4
- package/docs/examples.md +8 -2
- package/docs/helpers/Appium.md +2 -2
- package/docs/helpers/GraphQL.md +21 -0
- package/docs/helpers/Nightmare.md +1258 -0
- package/docs/helpers/Playwright.md +223 -119
- package/docs/helpers/Protractor.md +1709 -0
- package/docs/helpers/Puppeteer.md +3 -3
- package/docs/helpers/TestCafe.md +2 -2
- package/docs/helpers/WebDriver.md +3 -3
- package/docs/playwright.md +24 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/wiki/Books-&-Posts.md +0 -0
- package/docs/wiki/Community-Helpers-&-Plugins.md +8 -4
- package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +46 -14
- package/docs/wiki/Examples.md +8 -2
- package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -0
- package/docs/wiki/Home.md +0 -0
- package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +83 -0
- package/docs/wiki/Release-Process.md +0 -0
- package/docs/wiki/Roadmap.md +0 -0
- package/docs/wiki/Tests.md +0 -0
- package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -0
- package/docs/wiki/Videos.md +0 -0
- package/lib/command/definitions.js +2 -7
- package/lib/command/run-multiple/collection.js +17 -5
- package/lib/helper/Appium.js +6 -4
- package/lib/helper/GraphQL.js +25 -0
- package/lib/helper/Nightmare.js +1415 -0
- package/lib/helper/Playwright.js +321 -54
- package/lib/helper/Protractor.js +1837 -0
- package/lib/helper/Puppeteer.js +18 -12
- package/lib/helper/TestCafe.js +15 -8
- package/lib/helper/WebDriver.js +39 -35
- package/lib/helper/clientscripts/nightmare.js +213 -0
- package/lib/helper/errors/ElementNotFound.js +2 -1
- package/lib/helper/scripts/highlightElement.js +1 -1
- package/lib/interfaces/bdd.js +1 -1
- package/lib/mochaFactory.js +2 -1
- package/lib/pause.js +5 -4
- package/lib/plugin/heal.js +2 -3
- package/lib/plugin/selenoid.js +6 -1
- package/lib/step.js +27 -10
- package/lib/utils.js +4 -0
- package/lib/workers.js +3 -1
- package/package.json +13 -13
- package/typings/promiseBasedTypes.d.ts +145 -126
- package/typings/types.d.ts +152 -133
- package/CHANGELOG.md +0 -2519
- package/docs/build/Polly.js +0 -42
- package/docs/build/SeleniumWebdriver.js +0 -76
package/lib/step.js
CHANGED
|
@@ -138,13 +138,7 @@ class Step {
|
|
|
138
138
|
|
|
139
139
|
/** @return {string} */
|
|
140
140
|
humanize() {
|
|
141
|
-
return this.name
|
|
142
|
-
// insert a space before all caps
|
|
143
|
-
.replace(/([A-Z])/g, ' $1')
|
|
144
|
-
// _ chars to spaces
|
|
145
|
-
.replace('_', ' ')
|
|
146
|
-
// uppercase the first character
|
|
147
|
-
.replace(/^(.)|\s(.)/g, $1 => $1.toLowerCase());
|
|
141
|
+
return humanizeString(this.name);
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
/** @return {string} */
|
|
@@ -247,12 +241,21 @@ class MetaStep extends Step {
|
|
|
247
241
|
}
|
|
248
242
|
|
|
249
243
|
toString() {
|
|
250
|
-
const actorText =
|
|
251
|
-
|
|
244
|
+
const actorText = this.actor;
|
|
245
|
+
|
|
246
|
+
if (this.isBDD() || this.isWithin()) {
|
|
247
|
+
return `${this.prefix}${actorText} ${this.name} "${this.humanizeArgs()}${this.suffix}"`;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (actorText === 'I') {
|
|
251
|
+
return `${this.prefix}${actorText} ${this.humanize()} ${this.humanizeArgs()}${this.suffix}`;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return `On ${this.prefix}${actorText}: ${this.humanize()} ${this.humanizeArgs()}${this.suffix}`;
|
|
252
255
|
}
|
|
253
256
|
|
|
254
257
|
humanize() {
|
|
255
|
-
return this.name;
|
|
258
|
+
return humanizeString(this.name);
|
|
256
259
|
}
|
|
257
260
|
|
|
258
261
|
setTrace() {
|
|
@@ -316,3 +319,17 @@ function dryRunResolver() {
|
|
|
316
319
|
},
|
|
317
320
|
};
|
|
318
321
|
}
|
|
322
|
+
|
|
323
|
+
function humanizeString(string) {
|
|
324
|
+
// split strings by words, then make them all lowercase
|
|
325
|
+
const _result = string.replace(/([a-z](?=[A-Z]))/g, '$1 ')
|
|
326
|
+
.split(' ')
|
|
327
|
+
.map(word => word.toLowerCase());
|
|
328
|
+
|
|
329
|
+
_result[0] = _result[0] === 'i' ? capitalizeFLetter(_result[0]) : _result[0];
|
|
330
|
+
return _result.join(' ').trim();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function capitalizeFLetter(string) {
|
|
334
|
+
return (string[0].toUpperCase() + string.slice(1));
|
|
335
|
+
}
|
package/lib/utils.js
CHANGED
package/lib/workers.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.5.4
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"def": "./runok.js def",
|
|
55
55
|
"dev:graphql": "node test/data/graphql/index.js",
|
|
56
56
|
"publish:site": "./runok.js publish:site",
|
|
57
|
-
"update-contributor-faces": "contributor
|
|
57
|
+
"update-contributor-faces": "./runok.js contributor:faces",
|
|
58
58
|
"dtslint": "dtslint typings --localTs './node_modules/typescript/lib'",
|
|
59
59
|
"prepare": "husky install"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@codeceptjs/configure": "^0.10.0",
|
|
63
|
-
"@codeceptjs/helper": "^
|
|
63
|
+
"@codeceptjs/helper": "^2.0.1",
|
|
64
64
|
"@cucumber/cucumber-expressions": "^16",
|
|
65
65
|
"@cucumber/gherkin": "^26",
|
|
66
|
-
"@cucumber/messages": "^
|
|
67
|
-
"@xmldom/xmldom": "^0.
|
|
66
|
+
"@cucumber/messages": "^22.0.0",
|
|
67
|
+
"@xmldom/xmldom": "^0.8.10",
|
|
68
68
|
"acorn": "^8.10.0",
|
|
69
69
|
"arrify": "^2.0.1",
|
|
70
70
|
"axios": "^1.3.3",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"@faker-js/faker": "^7.6.0",
|
|
105
105
|
"@pollyjs/adapter-puppeteer": "^6.0.5",
|
|
106
106
|
"@pollyjs/core": "^5.1.0",
|
|
107
|
-
"@types/inquirer": "^
|
|
108
|
-
"@types/node": "^
|
|
107
|
+
"@types/inquirer": "^9.0.3",
|
|
108
|
+
"@types/node": "^20.4.4",
|
|
109
109
|
"@wdio/sauce-service": "^8.3.8",
|
|
110
110
|
"@wdio/selenium-standalone-service": "^8.3.2",
|
|
111
111
|
"@wdio/utils": "^8.3.0",
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"contributor-faces": "^1.0.3",
|
|
116
116
|
"documentation": "^12.3.0",
|
|
117
117
|
"dtslint": "^4.1.6",
|
|
118
|
-
"electron": "^
|
|
118
|
+
"electron": "^26.1.0",
|
|
119
119
|
"eslint": "^8.45.0",
|
|
120
120
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
121
121
|
"eslint-plugin-import": "^2.25.4",
|
|
122
122
|
"eslint-plugin-mocha": "^6.3.0",
|
|
123
|
-
"expect": "^
|
|
123
|
+
"expect": "^29.6.2",
|
|
124
124
|
"express": "^4.17.2",
|
|
125
125
|
"graphql": "^14.6.0",
|
|
126
126
|
"husky": "^8.0.1",
|
|
@@ -135,18 +135,18 @@
|
|
|
135
135
|
"runok": "^0.9.2",
|
|
136
136
|
"sinon": "^15.2.0",
|
|
137
137
|
"sinon-chai": "^3.7.0",
|
|
138
|
-
"testcafe": "^
|
|
138
|
+
"testcafe": "^3.0.1",
|
|
139
139
|
"ts-morph": "^3.1.3",
|
|
140
140
|
"ts-node": "^10.9.1",
|
|
141
141
|
"tsd-jsdoc": "^2.5.0",
|
|
142
|
-
"typedoc": "^0.
|
|
142
|
+
"typedoc": "^0.24.8",
|
|
143
143
|
"typedoc-plugin-markdown": "^3.13.4",
|
|
144
|
-
"typescript": "^
|
|
144
|
+
"typescript": "^5.1.6",
|
|
145
145
|
"wdio-docker-service": "^1.5.0",
|
|
146
146
|
"webdriverio": "^8.3.8",
|
|
147
147
|
"xml2js": "^0.6.0",
|
|
148
148
|
"xmldom": "^0.6.0",
|
|
149
|
-
"xpath": "0.0.
|
|
149
|
+
"xpath": "0.0.33"
|
|
150
150
|
},
|
|
151
151
|
"engines": {
|
|
152
152
|
"node": ">=16.0",
|
|
@@ -841,7 +841,7 @@ declare namespace CodeceptJS {
|
|
|
841
841
|
* @param value - value to check.
|
|
842
842
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
843
843
|
*/
|
|
844
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
844
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
845
845
|
/**
|
|
846
846
|
* Opposite to `see`. Checks that a text is not present on a page.
|
|
847
847
|
* Use context parameter to narrow down the search.
|
|
@@ -1022,7 +1022,7 @@ declare namespace CodeceptJS {
|
|
|
1022
1022
|
* @param value - value to check.
|
|
1023
1023
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1024
1024
|
*/
|
|
1025
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
1025
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
1026
1026
|
/**
|
|
1027
1027
|
* Checks that a page contains a visible text.
|
|
1028
1028
|
* Use context parameter to narrow down the search.
|
|
@@ -1295,6 +1295,21 @@ declare namespace CodeceptJS {
|
|
|
1295
1295
|
* @param [options] - are additional query options
|
|
1296
1296
|
*/
|
|
1297
1297
|
sendMutation(mutation: string, variables?: any, options?: any, headers?: any): Promise<any>;
|
|
1298
|
+
/**
|
|
1299
|
+
* Sets request headers for all requests of this test
|
|
1300
|
+
* @param headers - headers list
|
|
1301
|
+
*/
|
|
1302
|
+
haveRequestHeaders(headers: any): Promise<any>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Adds a header for Bearer authentication
|
|
1305
|
+
*
|
|
1306
|
+
* ```js
|
|
1307
|
+
* // we use secret function to hide token from logs
|
|
1308
|
+
* I.amBearerAuthenticated(secret('heregoestoken'))
|
|
1309
|
+
* ```
|
|
1310
|
+
* @param accessToken - Bearer access token
|
|
1311
|
+
*/
|
|
1312
|
+
amBearerAuthenticated(accessToken: string | CodeceptJS.Secret): Promise<any>;
|
|
1298
1313
|
}
|
|
1299
1314
|
/**
|
|
1300
1315
|
* Helper for managing remote data using GraphQL queries.
|
|
@@ -2191,7 +2206,7 @@ declare namespace CodeceptJS {
|
|
|
2191
2206
|
* @param value - value to check.
|
|
2192
2207
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2193
2208
|
*/
|
|
2194
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
2209
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
2195
2210
|
/**
|
|
2196
2211
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
2197
2212
|
* Opposite to `seeInField`.
|
|
@@ -2204,7 +2219,7 @@ declare namespace CodeceptJS {
|
|
|
2204
2219
|
* @param value - value to check.
|
|
2205
2220
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2206
2221
|
*/
|
|
2207
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
2222
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
2208
2223
|
/**
|
|
2209
2224
|
* Sends [input event](http://electron.atom.io/docs/api/web-contents/#webcontentssendinputeventevent) on a page.
|
|
2210
2225
|
* Can submit special keys like 'Enter', 'Backspace', etc
|
|
@@ -2825,6 +2840,7 @@ declare namespace CodeceptJS {
|
|
|
2825
2840
|
* url: "http://localhost",
|
|
2826
2841
|
* show: true // headless mode not supported for extensions
|
|
2827
2842
|
* chromium: {
|
|
2843
|
+
* // Note: due to this would launch persistent context, so to avoid the error when running tests with run-workers a timestamp would be appended to the defined folder name. For instance: playwright-tmp_1692715649511
|
|
2828
2844
|
* userDataDir: '/tmp/playwright-tmp', // necessary to launch the browser in normal mode instead of incognito,
|
|
2829
2845
|
* args: [
|
|
2830
2846
|
* `--disable-extensions-except=${pathToExtension}`,
|
|
@@ -3226,7 +3242,16 @@ declare namespace CodeceptJS {
|
|
|
3226
3242
|
*/
|
|
3227
3243
|
_locate(): Promise<any>;
|
|
3228
3244
|
/**
|
|
3229
|
-
*
|
|
3245
|
+
* Get the first element by different locator types, including strict locator
|
|
3246
|
+
* Should be used in custom helpers:
|
|
3247
|
+
*
|
|
3248
|
+
* ```js
|
|
3249
|
+
* const element = await this.helpers['Playwright']._locateElement({name: 'password'});
|
|
3250
|
+
* ```
|
|
3251
|
+
*/
|
|
3252
|
+
_locateElement(): Promise<any>;
|
|
3253
|
+
/**
|
|
3254
|
+
* Find a checkbox by providing human-readable text:
|
|
3230
3255
|
* NOTE: Assumes the checkable element exists
|
|
3231
3256
|
*
|
|
3232
3257
|
* ```js
|
|
@@ -3235,7 +3260,7 @@ declare namespace CodeceptJS {
|
|
|
3235
3260
|
*/
|
|
3236
3261
|
_locateCheckable(): Promise<any>;
|
|
3237
3262
|
/**
|
|
3238
|
-
* Find a clickable element by providing human
|
|
3263
|
+
* Find a clickable element by providing human-readable text:
|
|
3239
3264
|
*
|
|
3240
3265
|
* ```js
|
|
3241
3266
|
* this.helpers['Playwright']._locateClickable('Next page').then // ...
|
|
@@ -3243,7 +3268,7 @@ declare namespace CodeceptJS {
|
|
|
3243
3268
|
*/
|
|
3244
3269
|
_locateClickable(): Promise<any>;
|
|
3245
3270
|
/**
|
|
3246
|
-
* Find field elements by providing human
|
|
3271
|
+
* Find field elements by providing human-readable text:
|
|
3247
3272
|
*
|
|
3248
3273
|
* ```js
|
|
3249
3274
|
* this.helpers['Playwright']._locateFields('Your email').then // ...
|
|
@@ -3728,7 +3753,7 @@ declare namespace CodeceptJS {
|
|
|
3728
3753
|
* @param value - value to check.
|
|
3729
3754
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3730
3755
|
*/
|
|
3731
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
3756
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
3732
3757
|
/**
|
|
3733
3758
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
3734
3759
|
* Opposite to `seeInField`.
|
|
@@ -3741,7 +3766,7 @@ declare namespace CodeceptJS {
|
|
|
3741
3766
|
* @param value - value to check.
|
|
3742
3767
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3743
3768
|
*/
|
|
3744
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
3769
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
3745
3770
|
/**
|
|
3746
3771
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
3747
3772
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
@@ -4433,11 +4458,18 @@ declare namespace CodeceptJS {
|
|
|
4433
4458
|
*/
|
|
4434
4459
|
waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
|
|
4435
4460
|
/**
|
|
4436
|
-
* Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
4461
|
+
* Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.
|
|
4437
4462
|
*
|
|
4438
4463
|
* See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
|
|
4439
4464
|
*/
|
|
4440
4465
|
waitForNavigation(options: any): Promise<any>;
|
|
4466
|
+
/**
|
|
4467
|
+
* Waits for page navigates to a new URL or reloads. By default, it takes configured `waitForNavigation` option.
|
|
4468
|
+
*
|
|
4469
|
+
* See [Playwright's reference](https://playwright.dev/docs/api/class-page#page-wait-for-url)
|
|
4470
|
+
* @param url - A glob pattern, regex pattern or predicate receiving URL to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
|
|
4471
|
+
*/
|
|
4472
|
+
waitForURL(url: string | RegExp, options: any): Promise<any>;
|
|
4441
4473
|
/**
|
|
4442
4474
|
* Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
4443
4475
|
* Element can be located by CSS or XPath.
|
|
@@ -4520,20 +4552,27 @@ declare namespace CodeceptJS {
|
|
|
4520
4552
|
*/
|
|
4521
4553
|
stopMockingRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
|
|
4522
4554
|
/**
|
|
4523
|
-
* Starts recording
|
|
4555
|
+
* Starts recording the network traffics.
|
|
4524
4556
|
* This also resets recorded network requests.
|
|
4525
4557
|
*
|
|
4526
4558
|
* ```js
|
|
4527
4559
|
* I.startRecordingTraffic();
|
|
4528
4560
|
* ```
|
|
4529
4561
|
*/
|
|
4530
|
-
startRecordingTraffic(): Promise<
|
|
4562
|
+
startRecordingTraffic(): Promise<any>;
|
|
4531
4563
|
/**
|
|
4532
4564
|
* Grab the recording network traffics
|
|
4565
|
+
*
|
|
4566
|
+
* ```js
|
|
4567
|
+
* const traffics = await I.grabRecordedNetworkTraffics();
|
|
4568
|
+
* expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
|
|
4569
|
+
* expect(traffics[0].response.status).to.equal(200);
|
|
4570
|
+
* expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
|
|
4571
|
+
* ```
|
|
4533
4572
|
*/
|
|
4534
|
-
grabRecordedNetworkTraffics(): Promise<any>;
|
|
4573
|
+
grabRecordedNetworkTraffics(): Promise<any[]>;
|
|
4535
4574
|
/**
|
|
4536
|
-
* Blocks traffic
|
|
4575
|
+
* Blocks traffic of a given URL or a list of URLs.
|
|
4537
4576
|
*
|
|
4538
4577
|
* Examples:
|
|
4539
4578
|
*
|
|
@@ -4543,9 +4582,13 @@ declare namespace CodeceptJS {
|
|
|
4543
4582
|
* I.blockTraffic('http://example.com/**');
|
|
4544
4583
|
* I.blockTraffic(/\.css$/);
|
|
4545
4584
|
* ```
|
|
4546
|
-
*
|
|
4585
|
+
*
|
|
4586
|
+
* ```js
|
|
4587
|
+
* I.blockTraffic(['http://example.com/css/style.css', 'http://example.com/css/*.css']);
|
|
4588
|
+
* ```
|
|
4589
|
+
* @param urls - URL or a list of URLs to block . URL can contain * for wildcards. Example: https://www.example.com** to block all traffic for that domain. Regexp are also supported.
|
|
4547
4590
|
*/
|
|
4548
|
-
blockTraffic(
|
|
4591
|
+
blockTraffic(urls: string | any[] | RegExp): Promise<any>;
|
|
4549
4592
|
/**
|
|
4550
4593
|
* Mocks traffic for URL(s).
|
|
4551
4594
|
* This is a powerful feature to manipulate network traffic. Can be used e.g. to stabilize your tests, speed up your tests or as a last resort to make some test scenarios even possible.
|
|
@@ -4646,42 +4689,84 @@ declare namespace CodeceptJS {
|
|
|
4646
4689
|
name: string;
|
|
4647
4690
|
url: string | RegExp;
|
|
4648
4691
|
}): Promise<any>;
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4692
|
+
/**
|
|
4693
|
+
* Starts recording of websocket messages.
|
|
4694
|
+
* This also resets recorded websocket messages.
|
|
4695
|
+
*
|
|
4696
|
+
* ```js
|
|
4697
|
+
* await I.startRecordingWebSocketMessages();
|
|
4698
|
+
* ```
|
|
4699
|
+
*/
|
|
4700
|
+
startRecordingWebSocketMessages(): Promise<any>;
|
|
4701
|
+
/**
|
|
4702
|
+
* Stops recording WS messages. Recorded WS messages is not flashed.
|
|
4703
|
+
*
|
|
4704
|
+
* ```js
|
|
4705
|
+
* await I.stopRecordingWebSocketMessages();
|
|
4706
|
+
* ```
|
|
4707
|
+
*/
|
|
4708
|
+
stopRecordingWebSocketMessages(): Promise<any>;
|
|
4709
|
+
/**
|
|
4710
|
+
* Grab the recording WS messages
|
|
4711
|
+
*/
|
|
4712
|
+
grabWebSocketMessages(): Promise<any>;
|
|
4713
|
+
/**
|
|
4714
|
+
* Resets all recorded WS messages.
|
|
4715
|
+
*/
|
|
4716
|
+
flushWebSocketMessages(): Promise<any>;
|
|
4717
|
+
/**
|
|
4718
|
+
* Return a performance metric from the chrome cdp session.
|
|
4719
|
+
* Note: Chrome-only
|
|
4720
|
+
*
|
|
4721
|
+
* Examples:
|
|
4722
|
+
*
|
|
4723
|
+
* ```js
|
|
4724
|
+
* const metrics = await I.grabMetrics();
|
|
4725
|
+
*
|
|
4726
|
+
* // returned metrics
|
|
4727
|
+
*
|
|
4728
|
+
* [
|
|
4729
|
+
* { name: 'Timestamp', value: 1584904.203473 },
|
|
4730
|
+
* { name: 'AudioHandlers', value: 0 },
|
|
4731
|
+
* { name: 'AudioWorkletProcessors', value: 0 },
|
|
4732
|
+
* { name: 'Documents', value: 22 },
|
|
4733
|
+
* { name: 'Frames', value: 10 },
|
|
4734
|
+
* { name: 'JSEventListeners', value: 366 },
|
|
4735
|
+
* { name: 'LayoutObjects', value: 1240 },
|
|
4736
|
+
* { name: 'MediaKeySessions', value: 0 },
|
|
4737
|
+
* { name: 'MediaKeys', value: 0 },
|
|
4738
|
+
* { name: 'Nodes', value: 4505 },
|
|
4739
|
+
* { name: 'Resources', value: 141 },
|
|
4740
|
+
* { name: 'ContextLifecycleStateObservers', value: 34 },
|
|
4741
|
+
* { name: 'V8PerContextDatas', value: 4 },
|
|
4742
|
+
* { name: 'WorkerGlobalScopes', value: 0 },
|
|
4743
|
+
* { name: 'UACSSResources', value: 0 },
|
|
4744
|
+
* { name: 'RTCPeerConnections', value: 0 },
|
|
4745
|
+
* { name: 'ResourceFetchers', value: 22 },
|
|
4746
|
+
* { name: 'AdSubframes', value: 0 },
|
|
4747
|
+
* { name: 'DetachedScriptStates', value: 2 },
|
|
4748
|
+
* { name: 'ArrayBufferContents', value: 1 },
|
|
4749
|
+
* { name: 'LayoutCount', value: 0 },
|
|
4750
|
+
* { name: 'RecalcStyleCount', value: 0 },
|
|
4751
|
+
* { name: 'LayoutDuration', value: 0 },
|
|
4752
|
+
* { name: 'RecalcStyleDuration', value: 0 },
|
|
4753
|
+
* { name: 'DevToolsCommandDuration', value: 0.000013 },
|
|
4754
|
+
* { name: 'ScriptDuration', value: 0 },
|
|
4755
|
+
* { name: 'V8CompileDuration', value: 0 },
|
|
4756
|
+
* { name: 'TaskDuration', value: 0.000014 },
|
|
4757
|
+
* { name: 'TaskOtherDuration', value: 0.000001 },
|
|
4758
|
+
* { name: 'ThreadTime', value: 0.000046 },
|
|
4759
|
+
* { name: 'ProcessTime', value: 0.616852 },
|
|
4760
|
+
* { name: 'JSHeapUsedSize', value: 19004908 },
|
|
4761
|
+
* { name: 'JSHeapTotalSize', value: 26820608 },
|
|
4762
|
+
* { name: 'FirstMeaningfulPaint', value: 0 },
|
|
4763
|
+
* { name: 'DomContentLoaded', value: 1584903.690491 },
|
|
4764
|
+
* { name: 'NavigationStart', value: 1584902.841845 }
|
|
4765
|
+
* ]
|
|
4766
|
+
*
|
|
4767
|
+
* ```
|
|
4768
|
+
*/
|
|
4769
|
+
grabMetrics(): Promise<object[]>;
|
|
4685
4770
|
}
|
|
4686
4771
|
/**
|
|
4687
4772
|
* Protractor helper is based on [Protractor library](http://www.protractortest.org) and used for testing web applications.
|
|
@@ -5069,7 +5154,7 @@ declare namespace CodeceptJS {
|
|
|
5069
5154
|
* @param value - value to check.
|
|
5070
5155
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5071
5156
|
*/
|
|
5072
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
5157
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
5073
5158
|
/**
|
|
5074
5159
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
5075
5160
|
* Opposite to `seeInField`.
|
|
@@ -5082,7 +5167,7 @@ declare namespace CodeceptJS {
|
|
|
5082
5167
|
* @param value - value to check.
|
|
5083
5168
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5084
5169
|
*/
|
|
5085
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
5170
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
5086
5171
|
/**
|
|
5087
5172
|
* Appends text to a input field or textarea.
|
|
5088
5173
|
* Field is located by name, label, CSS or XPath
|
|
@@ -6905,7 +6990,7 @@ declare namespace CodeceptJS {
|
|
|
6905
6990
|
* @param value - value to check.
|
|
6906
6991
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
6907
6992
|
*/
|
|
6908
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
6993
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
6909
6994
|
/**
|
|
6910
6995
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
6911
6996
|
* Opposite to `seeInField`.
|
|
@@ -6918,7 +7003,7 @@ declare namespace CodeceptJS {
|
|
|
6918
7003
|
* @param value - value to check.
|
|
6919
7004
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
6920
7005
|
*/
|
|
6921
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
7006
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
6922
7007
|
/**
|
|
6923
7008
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
6924
7009
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
@@ -7861,72 +7946,6 @@ declare namespace CodeceptJS {
|
|
|
7861
7946
|
*/
|
|
7862
7947
|
sendDeleteRequest(url: any, headers?: any): Promise<any>;
|
|
7863
7948
|
}
|
|
7864
|
-
/**
|
|
7865
|
-
* SeleniumWebdriver helper is based on the official [Selenium Webdriver JS](https://www.npmjs.com/package/selenium-webdriver)
|
|
7866
|
-
* library. It implements common web api methods (amOnPage, click, see).
|
|
7867
|
-
*
|
|
7868
|
-
* ## Backends
|
|
7869
|
-
*
|
|
7870
|
-
* ### Selenium Installation
|
|
7871
|
-
*
|
|
7872
|
-
* 1. Download [Selenium Server](http://docs.seleniumhq.org/download/)
|
|
7873
|
-
* 2. For Chrome browser install [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/getting-started), for Firefox browser install [GeckoDriver](https://github.com/mozilla/geckodriver).
|
|
7874
|
-
* 3. Launch the server: `java -jar selenium-server-standalone-3.xx.xxx.jar`. To locate Chromedriver binary use `-Dwebdriver.chrome.driver=./chromedriver` option. For Geckodriver use `-Dwebdriver.gecko.driver=`.
|
|
7875
|
-
*
|
|
7876
|
-
*
|
|
7877
|
-
* ### PhantomJS Installation
|
|
7878
|
-
*
|
|
7879
|
-
* PhantomJS is a headless alternative to Selenium Server that implements [the WebDriver protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol).
|
|
7880
|
-
* It allows you to run Selenium tests on a server without a GUI installed.
|
|
7881
|
-
*
|
|
7882
|
-
* 1. Download [PhantomJS](http://phantomjs.org/download.html)
|
|
7883
|
-
* 2. Run PhantomJS in WebDriver mode: `phantomjs --webdriver=4444`
|
|
7884
|
-
*
|
|
7885
|
-
* ## Configuration
|
|
7886
|
-
*
|
|
7887
|
-
* This helper should be configured in codecept.json or codecept.conf.js
|
|
7888
|
-
*
|
|
7889
|
-
* * `url` - base url of website to be tested
|
|
7890
|
-
* * `browser` - browser in which perform testing
|
|
7891
|
-
* * `driver` - which protractor driver to use (local, direct, session, hosted, sauce, browserstack). By default set to 'hosted' which requires selenium server to be started.
|
|
7892
|
-
* * `restart` - restart browser between tests (default: true).
|
|
7893
|
-
* * `smartWait`: (optional) **enables SmartWait**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000
|
|
7894
|
-
* * `disableScreenshots` (optional, default: false) - don't save screenshot on failure
|
|
7895
|
-
* * `uniqueScreenshotNames` (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites
|
|
7896
|
-
* * `keepBrowserState` (optional, default: false) - keep browser state between tests when `restart` set to false.
|
|
7897
|
-
* * `keepCookies` (optional, default: false) - keep cookies between tests when `restart` set to false.*
|
|
7898
|
-
* * `seleniumAddress` - Selenium address to connect (default: http://localhost:4444/wd/hub)
|
|
7899
|
-
* * `waitForTimeout`: (optional) sets default wait time in _ms_ for all `wait*` functions. 1000 by default;
|
|
7900
|
-
* * `scriptTimeout`: (optional) sets default timeout for scripts in `executeAsync`. 1000 by default.
|
|
7901
|
-
* * `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
7902
|
-
* * `manualStart` (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriverIO"]._startBrowser()`
|
|
7903
|
-
* * `capabilities`: {} - list of [Desired Capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)
|
|
7904
|
-
*
|
|
7905
|
-
* Example:
|
|
7906
|
-
*
|
|
7907
|
-
* ```json
|
|
7908
|
-
* {
|
|
7909
|
-
* "helpers": {
|
|
7910
|
-
* "SeleniumWebdriver" : {
|
|
7911
|
-
* "url": "http://localhost",
|
|
7912
|
-
* "browser": "chrome",
|
|
7913
|
-
* "smartWait": 5000,
|
|
7914
|
-
* "restart": false
|
|
7915
|
-
* }
|
|
7916
|
-
* }
|
|
7917
|
-
* }
|
|
7918
|
-
* ```
|
|
7919
|
-
*
|
|
7920
|
-
* ## Access From Helpers
|
|
7921
|
-
*
|
|
7922
|
-
* Receive a WebDriverIO client from a custom helper by accessing `browser` property:
|
|
7923
|
-
*
|
|
7924
|
-
* ```js
|
|
7925
|
-
* this.helpers['SeleniumWebdriver'].browser
|
|
7926
|
-
* ```
|
|
7927
|
-
*/
|
|
7928
|
-
class SeleniumWebdriverTs {
|
|
7929
|
-
}
|
|
7930
7949
|
/**
|
|
7931
7950
|
* Client Functions
|
|
7932
7951
|
*/
|
|
@@ -8474,7 +8493,7 @@ declare namespace CodeceptJS {
|
|
|
8474
8493
|
* @param value - value to check.
|
|
8475
8494
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
8476
8495
|
*/
|
|
8477
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
8496
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
8478
8497
|
/**
|
|
8479
8498
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
8480
8499
|
* Opposite to `seeInField`.
|
|
@@ -8487,7 +8506,7 @@ declare namespace CodeceptJS {
|
|
|
8487
8506
|
* @param value - value to check.
|
|
8488
8507
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
8489
8508
|
*/
|
|
8490
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
8509
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
8491
8510
|
/**
|
|
8492
8511
|
* Checks that text is equal to provided one.
|
|
8493
8512
|
*
|
|
@@ -9789,7 +9808,7 @@ declare namespace CodeceptJS {
|
|
|
9789
9808
|
* @param value - value to check.
|
|
9790
9809
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
9791
9810
|
*/
|
|
9792
|
-
seeInField(field: CodeceptJS.LocatorOrString, value:
|
|
9811
|
+
seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
9793
9812
|
/**
|
|
9794
9813
|
* Checks that value of input field or textarea doesn't equal to given value
|
|
9795
9814
|
* Opposite to `seeInField`.
|
|
@@ -9802,7 +9821,7 @@ declare namespace CodeceptJS {
|
|
|
9802
9821
|
* @param value - value to check.
|
|
9803
9822
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
9804
9823
|
*/
|
|
9805
|
-
dontSeeInField(field: CodeceptJS.LocatorOrString, value:
|
|
9824
|
+
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
9806
9825
|
/**
|
|
9807
9826
|
* Verifies that the specified checkbox is checked.
|
|
9808
9827
|
*
|