codeceptjs 3.5.4 → 3.5.6
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/docs/build/Appium.js +40 -1
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +4 -0
- package/docs/build/Playwright.js +59 -41
- package/docs/build/Protractor.js +4 -0
- package/docs/build/Puppeteer.js +21 -10
- package/docs/build/TestCafe.js +2 -0
- package/docs/build/WebDriver.js +8 -4
- package/docs/changelog.md +1 -170
- package/docs/community-helpers.md +4 -8
- package/docs/examples.md +2 -8
- package/docs/helpers/Appium.md +37 -0
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +26 -24
- package/docs/helpers/Playwright.md +1 -1
- package/docs/helpers/Protractor.md +4 -2
- package/docs/helpers/Puppeteer.md +29 -27
- package/docs/helpers/TestCafe.md +16 -15
- package/docs/helpers/WebDriver.md +32 -30
- package/docs/webapi/executeAsyncScript.mustache +2 -0
- package/docs/webapi/executeScript.mustache +2 -0
- package/lib/codecept.js +4 -0
- package/lib/command/info.js +24 -0
- package/lib/command/init.js +40 -4
- package/lib/command/run-workers.js +5 -0
- package/lib/command/run.js +7 -0
- package/lib/data/context.js +14 -6
- package/lib/helper/Appium.js +40 -1
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Playwright.js +58 -40
- package/lib/helper/Puppeteer.js +17 -10
- package/lib/helper/WebDriver.js +4 -4
- package/lib/helper/scripts/highlightElement.js +1 -1
- package/lib/pause.js +1 -2
- package/lib/plugin/autoLogin.js +0 -5
- package/lib/plugin/retryTo.js +0 -2
- package/lib/plugin/tryTo.js +0 -3
- package/lib/session.js +1 -1
- package/package.json +88 -88
- package/translations/fr-FR.js +13 -1
- package/typings/promiseBasedTypes.d.ts +19 -1
- package/typings/types.d.ts +36 -16
package/lib/plugin/tryTo.js
CHANGED
|
@@ -81,10 +81,8 @@ module.exports = function (config) {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
function tryTo(callback) {
|
|
84
|
-
const mode = store.debugMode;
|
|
85
84
|
let result = false;
|
|
86
85
|
return recorder.add('tryTo', () => {
|
|
87
|
-
store.debugMode = true;
|
|
88
86
|
recorder.session.start('tryTo');
|
|
89
87
|
callback();
|
|
90
88
|
recorder.add(() => {
|
|
@@ -100,7 +98,6 @@ function tryTo(callback) {
|
|
|
100
98
|
return result;
|
|
101
99
|
});
|
|
102
100
|
return recorder.add('result', () => {
|
|
103
|
-
store.debugMode = mode;
|
|
104
101
|
return result;
|
|
105
102
|
}, true, false);
|
|
106
103
|
}, false, false);
|
package/lib/session.js
CHANGED
|
@@ -19,7 +19,7 @@ const savedSessions = {};
|
|
|
19
19
|
* @param {CodeceptJS.LocatorOrString} sessionName
|
|
20
20
|
* @param {Function | Object<string, *>} config
|
|
21
21
|
* @param {Function} [fn]
|
|
22
|
-
* @return {
|
|
22
|
+
* @return {any}
|
|
23
23
|
*/
|
|
24
24
|
function session(sessionName, config, fn) {
|
|
25
25
|
if (typeof config === 'function') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.6",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"lint": "eslint bin/ examples/ lib/ test/ translations/ runok.js",
|
|
41
41
|
"lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.js --fix",
|
|
42
42
|
"docs": "./runok.js docs",
|
|
43
|
-
"test:unit": "mocha test/unit --recursive --timeout
|
|
44
|
-
"test:runner": "mocha test/runner --recursive --timeout
|
|
43
|
+
"test:unit": "mocha test/unit --recursive --timeout 10000",
|
|
44
|
+
"test:runner": "mocha test/runner --recursive --timeout 10000",
|
|
45
45
|
"test": "npm run test:unit && npm run test:runner",
|
|
46
46
|
"test:appium-quick": "mocha test/helper/Appium_test.js --grep 'quick'",
|
|
47
47
|
"test:appium-other": "mocha test/helper/Appium_test.js --grep 'second'",
|
|
@@ -59,93 +59,93 @@
|
|
|
59
59
|
"prepare": "husky install"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@codeceptjs/configure": "
|
|
63
|
-
"@codeceptjs/helper": "
|
|
64
|
-
"@cucumber/cucumber-expressions": "
|
|
65
|
-
"@cucumber/gherkin": "
|
|
66
|
-
"@cucumber/messages": "
|
|
67
|
-
"@xmldom/xmldom": "
|
|
68
|
-
"acorn": "
|
|
69
|
-
"arrify": "
|
|
70
|
-
"axios": "
|
|
71
|
-
"chai": "
|
|
72
|
-
"chai-deep-match": "
|
|
73
|
-
"chalk": "
|
|
74
|
-
"commander": "
|
|
75
|
-
"cross-spawn": "
|
|
76
|
-
"css-to-xpath": "
|
|
77
|
-
"envinfo": "
|
|
78
|
-
"escape-string-regexp": "
|
|
79
|
-
"figures": "
|
|
80
|
-
"fn-args": "
|
|
81
|
-
"fs-extra": "
|
|
82
|
-
"glob": "
|
|
83
|
-
"html-minifier": "
|
|
84
|
-
"inquirer": "
|
|
85
|
-
"joi": "
|
|
86
|
-
"js-beautify": "
|
|
87
|
-
"lodash.clonedeep": "
|
|
88
|
-
"lodash.merge": "
|
|
89
|
-
"mkdirp": "
|
|
90
|
-
"mocha": "
|
|
91
|
-
"ms": "
|
|
92
|
-
"openai": "
|
|
93
|
-
"ora-classic": "
|
|
94
|
-
"parse-function": "
|
|
95
|
-
"parse5": "
|
|
96
|
-
"promise-retry": "
|
|
97
|
-
"resq": "
|
|
98
|
-
"sprintf-js": "
|
|
99
|
-
"uuid": "
|
|
62
|
+
"@codeceptjs/configure": "0.10.0",
|
|
63
|
+
"@codeceptjs/helper": "2.0.1",
|
|
64
|
+
"@cucumber/cucumber-expressions": "16",
|
|
65
|
+
"@cucumber/gherkin": "26",
|
|
66
|
+
"@cucumber/messages": "22.0.0",
|
|
67
|
+
"@xmldom/xmldom": "0.8.10",
|
|
68
|
+
"acorn": "8.10.0",
|
|
69
|
+
"arrify": "2.0.1",
|
|
70
|
+
"axios": "1.3.3",
|
|
71
|
+
"chai": "4.3.8",
|
|
72
|
+
"chai-deep-match": "1.2.1",
|
|
73
|
+
"chalk": "4.1.2",
|
|
74
|
+
"commander": "11.0.0",
|
|
75
|
+
"cross-spawn": "7.0.3",
|
|
76
|
+
"css-to-xpath": "0.1.0",
|
|
77
|
+
"envinfo": "7.8.1",
|
|
78
|
+
"escape-string-regexp": "4.0.0",
|
|
79
|
+
"figures": "3.2.0",
|
|
80
|
+
"fn-args": "4.0.0",
|
|
81
|
+
"fs-extra": "8.1.0",
|
|
82
|
+
"glob": "6.0.1",
|
|
83
|
+
"html-minifier": "4.0.0",
|
|
84
|
+
"inquirer": "6.5.2",
|
|
85
|
+
"joi": "17.6.0",
|
|
86
|
+
"js-beautify": "1.14.9",
|
|
87
|
+
"lodash.clonedeep": "4.5.0",
|
|
88
|
+
"lodash.merge": "4.6.2",
|
|
89
|
+
"mkdirp": "1.0.4",
|
|
90
|
+
"mocha": "10.2.0",
|
|
91
|
+
"ms": "2.1.3",
|
|
92
|
+
"openai": "3.2.1",
|
|
93
|
+
"ora-classic": "5.4.2",
|
|
94
|
+
"parse-function": "5.6.4",
|
|
95
|
+
"parse5": "7.1.2",
|
|
96
|
+
"promise-retry": "1.1.1",
|
|
97
|
+
"resq": "1.10.2",
|
|
98
|
+
"sprintf-js": "1.1.1",
|
|
99
|
+
"uuid": "9.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@codeceptjs/detox-helper": "
|
|
103
|
-
"@codeceptjs/mock-request": "
|
|
104
|
-
"@faker-js/faker": "
|
|
105
|
-
"@pollyjs/adapter-puppeteer": "
|
|
106
|
-
"@pollyjs/core": "
|
|
107
|
-
"@types/inquirer": "
|
|
108
|
-
"@types/node": "
|
|
109
|
-
"@wdio/sauce-service": "
|
|
110
|
-
"@wdio/selenium-standalone-service": "
|
|
111
|
-
"@wdio/utils": "
|
|
102
|
+
"@codeceptjs/detox-helper": "1.0.2",
|
|
103
|
+
"@codeceptjs/mock-request": "0.3.1",
|
|
104
|
+
"@faker-js/faker": "7.6.0",
|
|
105
|
+
"@pollyjs/adapter-puppeteer": "6.0.6",
|
|
106
|
+
"@pollyjs/core": "5.1.0",
|
|
107
|
+
"@types/inquirer": "9.0.3",
|
|
108
|
+
"@types/node": "20.4.4",
|
|
109
|
+
"@wdio/sauce-service": "8.3.8",
|
|
110
|
+
"@wdio/selenium-standalone-service": "8.3.2",
|
|
111
|
+
"@wdio/utils": "8.16.22",
|
|
112
112
|
"apollo-server-express": "2.25.3",
|
|
113
|
-
"chai-as-promised": "
|
|
114
|
-
"chai-subset": "
|
|
115
|
-
"contributor-faces": "
|
|
116
|
-
"documentation": "
|
|
117
|
-
"dtslint": "
|
|
118
|
-
"electron": "
|
|
119
|
-
"eslint": "
|
|
120
|
-
"eslint-config-airbnb-base": "
|
|
121
|
-
"eslint-plugin-import": "
|
|
122
|
-
"eslint-plugin-mocha": "
|
|
123
|
-
"expect": "
|
|
124
|
-
"express": "
|
|
125
|
-
"graphql": "
|
|
126
|
-
"husky": "
|
|
127
|
-
"inquirer-test": "
|
|
128
|
-
"jsdoc": "
|
|
129
|
-
"jsdoc-typeof-plugin": "
|
|
130
|
-
"json-server": "
|
|
131
|
-
"playwright": "
|
|
132
|
-
"puppeteer": "
|
|
133
|
-
"qrcode-terminal": "
|
|
134
|
-
"rosie": "
|
|
135
|
-
"runok": "
|
|
136
|
-
"sinon": "
|
|
137
|
-
"sinon-chai": "
|
|
138
|
-
"testcafe": "
|
|
139
|
-
"ts-morph": "
|
|
140
|
-
"ts-node": "
|
|
141
|
-
"tsd-jsdoc": "
|
|
142
|
-
"typedoc": "
|
|
143
|
-
"typedoc-plugin-markdown": "
|
|
144
|
-
"typescript": "
|
|
145
|
-
"wdio-docker-service": "
|
|
146
|
-
"webdriverio": "
|
|
147
|
-
"xml2js": "
|
|
148
|
-
"xmldom": "
|
|
113
|
+
"chai-as-promised": "7.1.1",
|
|
114
|
+
"chai-subset": "1.6.0",
|
|
115
|
+
"contributor-faces": "1.0.3",
|
|
116
|
+
"documentation": "12.3.0",
|
|
117
|
+
"dtslint": "4.1.6",
|
|
118
|
+
"electron": "26.1.0",
|
|
119
|
+
"eslint": "8.50.0",
|
|
120
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
121
|
+
"eslint-plugin-import": "2.25.4",
|
|
122
|
+
"eslint-plugin-mocha": "6.3.0",
|
|
123
|
+
"expect": "29.7.0",
|
|
124
|
+
"express": "4.17.2",
|
|
125
|
+
"graphql": "14.6.0",
|
|
126
|
+
"husky": "8.0.3",
|
|
127
|
+
"inquirer-test": "2.0.1",
|
|
128
|
+
"jsdoc": "3.6.10",
|
|
129
|
+
"jsdoc-typeof-plugin": "1.0.0",
|
|
130
|
+
"json-server": "0.10.1",
|
|
131
|
+
"playwright": "1.38.1",
|
|
132
|
+
"puppeteer": "21.1.1",
|
|
133
|
+
"qrcode-terminal": "0.12.0",
|
|
134
|
+
"rosie": "2.1.0",
|
|
135
|
+
"runok": "0.9.3",
|
|
136
|
+
"sinon": "15.2.0",
|
|
137
|
+
"sinon-chai": "3.7.0",
|
|
138
|
+
"testcafe": "3.0.1",
|
|
139
|
+
"ts-morph": "19.0.0",
|
|
140
|
+
"ts-node": "10.9.1",
|
|
141
|
+
"tsd-jsdoc": "2.5.0",
|
|
142
|
+
"typedoc": "0.24.8",
|
|
143
|
+
"typedoc-plugin-markdown": "3.13.4",
|
|
144
|
+
"typescript": "5.1.6",
|
|
145
|
+
"wdio-docker-service": "1.5.0",
|
|
146
|
+
"webdriverio": "8.3.8",
|
|
147
|
+
"xml2js": "0.6.0",
|
|
148
|
+
"xmldom": "0.6.0",
|
|
149
149
|
"xpath": "0.0.33"
|
|
150
150
|
},
|
|
151
151
|
"engines": {
|
|
@@ -153,4 +153,4 @@
|
|
|
153
153
|
"npm": ">=5.6.0"
|
|
154
154
|
},
|
|
155
155
|
"es6": true
|
|
156
|
-
}
|
|
156
|
+
}
|
package/translations/fr-FR.js
CHANGED
|
@@ -12,11 +12,15 @@ module.exports = {
|
|
|
12
12
|
amOutsideAngularApp: 'suisALExtérieurDeLApplicationAngular',
|
|
13
13
|
amInsideAngularApp: 'suisALIntérieurDeLApplicationAngular',
|
|
14
14
|
waitForElement: 'attendsLElément',
|
|
15
|
-
waitForClickable: '
|
|
15
|
+
waitForClickable: 'attendsDeCliquer',
|
|
16
16
|
waitForVisible: 'attendsPourVoir',
|
|
17
|
+
waitForEnabled: 'attendsLActivationDe',
|
|
18
|
+
waitForInvisible: 'attendsLInvisibilitéDe',
|
|
19
|
+
waitInUrl: 'attendsDansLUrl',
|
|
17
20
|
waitForText: 'attendsLeTexte',
|
|
18
21
|
moveTo: 'vaisSur',
|
|
19
22
|
refresh: 'rafraîchis',
|
|
23
|
+
refreshPage: 'rafraîchisLaPage',
|
|
20
24
|
haveModule: 'ajouteLeModule',
|
|
21
25
|
resetModule: 'réinitialiseLeModule',
|
|
22
26
|
amOnPage: 'suisSurLaPage',
|
|
@@ -59,5 +63,13 @@ module.exports = {
|
|
|
59
63
|
grabCookie: 'prendsLeCookie',
|
|
60
64
|
resizeWindow: 'redimensionneLaFenêtre',
|
|
61
65
|
wait: 'attends',
|
|
66
|
+
clearField: 'effaceLeChamp',
|
|
67
|
+
dontSeeElementInDOM: 'neVoisPasDansLeDOM',
|
|
68
|
+
moveCursorTo: 'bougeLeCurseurSur',
|
|
69
|
+
scrollTo: 'défileVers',
|
|
70
|
+
sendGetRequest: 'envoieLaRequêteGet',
|
|
71
|
+
sendPutRequest: 'envoieLaRequêtePut',
|
|
72
|
+
sendDeleteRequest: 'envoieLaRequêteDelete',
|
|
73
|
+
sendPostRequest: 'envoieLaRequêtePost',
|
|
62
74
|
},
|
|
63
75
|
};
|
|
@@ -1147,7 +1147,7 @@ declare namespace CodeceptJS {
|
|
|
1147
1147
|
*/
|
|
1148
1148
|
amInPath(openPath: string): Promise<any>;
|
|
1149
1149
|
/**
|
|
1150
|
-
* Writes
|
|
1150
|
+
* Writes text to file
|
|
1151
1151
|
*/
|
|
1152
1152
|
writeToFile(name: string, text: string): Promise<any>;
|
|
1153
1153
|
/**
|
|
@@ -2071,6 +2071,8 @@ declare namespace CodeceptJS {
|
|
|
2071
2071
|
* ```
|
|
2072
2072
|
* @param fn - function to be executed in browser context.
|
|
2073
2073
|
* @param args - to be passed to function.
|
|
2074
|
+
* @returns script return value
|
|
2075
|
+
*
|
|
2074
2076
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2075
2077
|
*
|
|
2076
2078
|
*
|
|
@@ -2100,6 +2102,8 @@ declare namespace CodeceptJS {
|
|
|
2100
2102
|
* ```
|
|
2101
2103
|
* @param fn - function to be executed in browser context.
|
|
2102
2104
|
* @param args - to be passed to function.
|
|
2105
|
+
* @returns script return value
|
|
2106
|
+
*
|
|
2103
2107
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2104
2108
|
*
|
|
2105
2109
|
*
|
|
@@ -5564,6 +5568,8 @@ declare namespace CodeceptJS {
|
|
|
5564
5568
|
* ```
|
|
5565
5569
|
* @param fn - function to be executed in browser context.
|
|
5566
5570
|
* @param args - to be passed to function.
|
|
5571
|
+
* @returns script return value
|
|
5572
|
+
*
|
|
5567
5573
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5568
5574
|
*/
|
|
5569
5575
|
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
@@ -5590,6 +5596,8 @@ declare namespace CodeceptJS {
|
|
|
5590
5596
|
* ```
|
|
5591
5597
|
* @param fn - function to be executed in browser context.
|
|
5592
5598
|
* @param args - to be passed to function.
|
|
5599
|
+
* @returns script return value
|
|
5600
|
+
*
|
|
5593
5601
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5594
5602
|
*/
|
|
5595
5603
|
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
@@ -7314,6 +7322,8 @@ declare namespace CodeceptJS {
|
|
|
7314
7322
|
* ```
|
|
7315
7323
|
* @param fn - function to be executed in browser context.
|
|
7316
7324
|
* @param args - to be passed to function.
|
|
7325
|
+
* @returns script return value
|
|
7326
|
+
*
|
|
7317
7327
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7318
7328
|
*
|
|
7319
7329
|
*
|
|
@@ -7343,6 +7353,8 @@ declare namespace CodeceptJS {
|
|
|
7343
7353
|
* ```
|
|
7344
7354
|
* @param fn - function to be executed in browser context.
|
|
7345
7355
|
* @param args - to be passed to function.
|
|
7356
|
+
* @returns script return value
|
|
7357
|
+
*
|
|
7346
7358
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7347
7359
|
*
|
|
7348
7360
|
*
|
|
@@ -8596,6 +8608,8 @@ declare namespace CodeceptJS {
|
|
|
8596
8608
|
* ```
|
|
8597
8609
|
* @param fn - function to be executed in browser context.
|
|
8598
8610
|
* @param args - to be passed to function.
|
|
8611
|
+
* @returns script return value
|
|
8612
|
+
*
|
|
8599
8613
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
8600
8614
|
*
|
|
8601
8615
|
*
|
|
@@ -10076,6 +10090,8 @@ declare namespace CodeceptJS {
|
|
|
10076
10090
|
* ```
|
|
10077
10091
|
* @param fn - function to be executed in browser context.
|
|
10078
10092
|
* @param args - to be passed to function.
|
|
10093
|
+
* @returns script return value
|
|
10094
|
+
*
|
|
10079
10095
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10080
10096
|
*
|
|
10081
10097
|
*
|
|
@@ -10106,6 +10122,8 @@ declare namespace CodeceptJS {
|
|
|
10106
10122
|
* ```
|
|
10107
10123
|
* @param fn - function to be executed in browser context.
|
|
10108
10124
|
* @param args - to be passed to function.
|
|
10125
|
+
* @returns script return value
|
|
10126
|
+
*
|
|
10109
10127
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10110
10128
|
*/
|
|
10111
10129
|
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
package/typings/types.d.ts
CHANGED
|
@@ -1147,7 +1147,7 @@ declare namespace CodeceptJS {
|
|
|
1147
1147
|
*/
|
|
1148
1148
|
amInPath(openPath: string): void;
|
|
1149
1149
|
/**
|
|
1150
|
-
* Writes
|
|
1150
|
+
* Writes text to file
|
|
1151
1151
|
*/
|
|
1152
1152
|
writeToFile(name: string, text: string): void;
|
|
1153
1153
|
/**
|
|
@@ -2075,12 +2075,14 @@ declare namespace CodeceptJS {
|
|
|
2075
2075
|
* ```
|
|
2076
2076
|
* @param fn - function to be executed in browser context.
|
|
2077
2077
|
* @param args - to be passed to function.
|
|
2078
|
+
* @returns script return value
|
|
2079
|
+
*
|
|
2078
2080
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2079
2081
|
*
|
|
2080
2082
|
*
|
|
2081
2083
|
* Wrapper for synchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2)
|
|
2082
2084
|
*/
|
|
2083
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
2085
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
2084
2086
|
/**
|
|
2085
2087
|
* Executes async script on page.
|
|
2086
2088
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -2104,13 +2106,15 @@ declare namespace CodeceptJS {
|
|
|
2104
2106
|
* ```
|
|
2105
2107
|
* @param fn - function to be executed in browser context.
|
|
2106
2108
|
* @param args - to be passed to function.
|
|
2109
|
+
* @returns script return value
|
|
2110
|
+
*
|
|
2107
2111
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2108
2112
|
*
|
|
2109
2113
|
*
|
|
2110
2114
|
* Wrapper for asynchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2).
|
|
2111
2115
|
* Unlike NightmareJS implementation calling `done` will return its first argument.
|
|
2112
2116
|
*/
|
|
2113
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
2117
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
2114
2118
|
/**
|
|
2115
2119
|
* Resize the current window to provided width and height.
|
|
2116
2120
|
* First parameter can be set to `maximize`.
|
|
@@ -2774,7 +2778,7 @@ declare namespace CodeceptJS {
|
|
|
2774
2778
|
* @property [ignoreLog] - An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values](https://playwright.dev/docs/api/class-consolemessage#console-message-type).
|
|
2775
2779
|
* @property [ignoreHTTPSErrors] - Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
2776
2780
|
* @property [bypassCSP] - bypass Content Security Policy or CSP
|
|
2777
|
-
* @property [highlightElement] - highlight the interacting elements. Default: false
|
|
2781
|
+
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
2778
2782
|
*/
|
|
2779
2783
|
type PlaywrightConfig = {
|
|
2780
2784
|
url?: string;
|
|
@@ -5648,9 +5652,11 @@ declare namespace CodeceptJS {
|
|
|
5648
5652
|
* ```
|
|
5649
5653
|
* @param fn - function to be executed in browser context.
|
|
5650
5654
|
* @param args - to be passed to function.
|
|
5655
|
+
* @returns script return value
|
|
5656
|
+
*
|
|
5651
5657
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5652
5658
|
*/
|
|
5653
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
5659
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
5654
5660
|
/**
|
|
5655
5661
|
* Executes async script on page.
|
|
5656
5662
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -5674,9 +5680,11 @@ declare namespace CodeceptJS {
|
|
|
5674
5680
|
* ```
|
|
5675
5681
|
* @param fn - function to be executed in browser context.
|
|
5676
5682
|
* @param args - to be passed to function.
|
|
5683
|
+
* @returns script return value
|
|
5684
|
+
*
|
|
5677
5685
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5678
5686
|
*/
|
|
5679
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
5687
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
5680
5688
|
/**
|
|
5681
5689
|
* Checks that current url contains a provided fragment.
|
|
5682
5690
|
*
|
|
@@ -6196,7 +6204,7 @@ declare namespace CodeceptJS {
|
|
|
6196
6204
|
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
6197
6205
|
* @property [browser = chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
|
|
6198
6206
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6199
|
-
* @property [highlightElement] - highlight the interacting elements. Default: false
|
|
6207
|
+
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6200
6208
|
*/
|
|
6201
6209
|
type PuppeteerConfig = {
|
|
6202
6210
|
url: string;
|
|
@@ -7446,12 +7454,14 @@ declare namespace CodeceptJS {
|
|
|
7446
7454
|
* ```
|
|
7447
7455
|
* @param fn - function to be executed in browser context.
|
|
7448
7456
|
* @param args - to be passed to function.
|
|
7457
|
+
* @returns script return value
|
|
7458
|
+
*
|
|
7449
7459
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7450
7460
|
*
|
|
7451
7461
|
*
|
|
7452
7462
|
* If a function returns a Promise It will wait for it resolution.
|
|
7453
7463
|
*/
|
|
7454
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
7464
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7455
7465
|
/**
|
|
7456
7466
|
* Executes async script on page.
|
|
7457
7467
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -7475,12 +7485,14 @@ declare namespace CodeceptJS {
|
|
|
7475
7485
|
* ```
|
|
7476
7486
|
* @param fn - function to be executed in browser context.
|
|
7477
7487
|
* @param args - to be passed to function.
|
|
7488
|
+
* @returns script return value
|
|
7489
|
+
*
|
|
7478
7490
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7479
7491
|
*
|
|
7480
7492
|
*
|
|
7481
7493
|
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7482
7494
|
*/
|
|
7483
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
7495
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7484
7496
|
/**
|
|
7485
7497
|
* Retrieves all texts from an element located by CSS or XPath and returns it to test.
|
|
7486
7498
|
* Resumes test execution, so **should be used inside async with `await`** operator.
|
|
@@ -8748,12 +8760,14 @@ declare namespace CodeceptJS {
|
|
|
8748
8760
|
* ```
|
|
8749
8761
|
* @param fn - function to be executed in browser context.
|
|
8750
8762
|
* @param args - to be passed to function.
|
|
8763
|
+
* @returns script return value
|
|
8764
|
+
*
|
|
8751
8765
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
8752
8766
|
*
|
|
8753
8767
|
*
|
|
8754
8768
|
* If a function returns a Promise It will wait for its resolution.
|
|
8755
8769
|
*/
|
|
8756
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
8770
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
8757
8771
|
/**
|
|
8758
8772
|
* Retrieves all texts from an element located by CSS or XPath and returns it to test.
|
|
8759
8773
|
* Resumes test execution, so **should be used inside async with `await`** operator.
|
|
@@ -9105,7 +9119,7 @@ declare namespace CodeceptJS {
|
|
|
9105
9119
|
* @property [desiredCapabilities] - Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
|
|
9106
9120
|
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
9107
9121
|
* @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
|
|
9108
|
-
* @property [highlightElement] - highlight the interacting elements. Default: false
|
|
9122
|
+
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
9109
9123
|
*/
|
|
9110
9124
|
type WebDriverConfig = {
|
|
9111
9125
|
url: string;
|
|
@@ -10276,13 +10290,15 @@ declare namespace CodeceptJS {
|
|
|
10276
10290
|
* ```
|
|
10277
10291
|
* @param fn - function to be executed in browser context.
|
|
10278
10292
|
* @param args - to be passed to function.
|
|
10293
|
+
* @returns script return value
|
|
10294
|
+
*
|
|
10279
10295
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10280
10296
|
*
|
|
10281
10297
|
*
|
|
10282
10298
|
*
|
|
10283
10299
|
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
10284
10300
|
*/
|
|
10285
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
10301
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
10286
10302
|
/**
|
|
10287
10303
|
* Executes async script on page.
|
|
10288
10304
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -10306,9 +10322,11 @@ declare namespace CodeceptJS {
|
|
|
10306
10322
|
* ```
|
|
10307
10323
|
* @param fn - function to be executed in browser context.
|
|
10308
10324
|
* @param args - to be passed to function.
|
|
10325
|
+
* @returns script return value
|
|
10326
|
+
*
|
|
10309
10327
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10310
10328
|
*/
|
|
10311
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
10329
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
10312
10330
|
/**
|
|
10313
10331
|
* Scroll element into viewport.
|
|
10314
10332
|
*
|
|
@@ -11075,7 +11093,7 @@ declare namespace CodeceptJS {
|
|
|
11075
11093
|
/**
|
|
11076
11094
|
* Run a specific test or all loaded tests.
|
|
11077
11095
|
*/
|
|
11078
|
-
run(test?: string): void
|
|
11096
|
+
run(test?: string): Promise<void>;
|
|
11079
11097
|
}
|
|
11080
11098
|
/**
|
|
11081
11099
|
* Current configuration
|
|
@@ -11449,7 +11467,9 @@ declare namespace CodeceptJS {
|
|
|
11449
11467
|
/**
|
|
11450
11468
|
* Pauses test execution and starts interactive shell
|
|
11451
11469
|
*/
|
|
11452
|
-
function pause(
|
|
11470
|
+
function pause(passedObject?: {
|
|
11471
|
+
[key: string]: any;
|
|
11472
|
+
}): void;
|
|
11453
11473
|
/**
|
|
11454
11474
|
* Singleton object to record all test steps as promises and run them in chain.
|
|
11455
11475
|
*/
|
|
@@ -11525,7 +11545,7 @@ declare namespace CodeceptJS {
|
|
|
11525
11545
|
}
|
|
11526
11546
|
function session(sessionName: CodeceptJS.LocatorOrString, config: ((...params: any[]) => any) | {
|
|
11527
11547
|
[key: string]: any;
|
|
11528
|
-
}, fn?: (...params: any[]) => any):
|
|
11548
|
+
}, fn?: (...params: any[]) => any): any;
|
|
11529
11549
|
/**
|
|
11530
11550
|
* Each command in test executed through `I.` object is wrapped in Step.
|
|
11531
11551
|
* Step allows logging executed commands and triggers hook before and after step execution.
|