codeceptjs 3.6.3-beta.2 → 3.6.3
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/lib/command/gherkin/init.js +17 -7
- package/lib/command/utils.js +15 -4
- package/lib/helper/{Expect.js → ExpectHelper.js} +1 -1
- package/lib/helper/Playwright.js +1 -1
- package/lib/helper/Puppeteer.js +3 -3
- package/lib/plugin/retryTo.js +30 -24
- package/lib/plugin/screenshotOnFail.js +4 -0
- package/lib/plugin/stepByStepReport.js +7 -5
- package/lib/scenario.js +52 -49
- package/package.json +10 -10
- package/typings/promiseBasedTypes.d.ts +159 -3
- package/typings/types.d.ts +159 -3
package/README.md
CHANGED
|
@@ -315,8 +315,8 @@ Thanks all to those who are and will have contributing to this awesome project!
|
|
|
315
315
|
<a href="https://github.com/VikalpP"><img src="https://avatars.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
|
|
316
316
|
<a href="https://github.com/elaichenkov"><img src="https://avatars.githubusercontent.com/u/29764053?v=4" title="elaichenkov" width="80" height="80"></a>
|
|
317
317
|
<a href="https://github.com/BorisOsipov"><img src="https://avatars.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
|
|
318
|
-
<a href="https://github.com/hubidu"><img src="https://avatars.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
|
|
319
318
|
<a href="https://github.com/nitschSB"><img src="https://avatars.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
|
|
319
|
+
<a href="https://github.com/hubidu"><img src="https://avatars.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
|
|
320
320
|
<a href="https://github.com/jploskonka"><img src="https://avatars.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
|
|
321
321
|
<a href="https://github.com/ngraf"><img src="https://avatars.githubusercontent.com/u/7094389?v=4" title="ngraf" width="80" height="80"></a>
|
|
322
322
|
<a href="https://github.com/maojunxyz"><img src="https://avatars.githubusercontent.com/u/28778042?v=4" title="maojunxyz" width="80" height="80"></a>
|
|
@@ -4,7 +4,7 @@ const mkdirp = require('mkdirp');
|
|
|
4
4
|
const output = require('../../output');
|
|
5
5
|
const { fileExists } = require('../../utils');
|
|
6
6
|
const {
|
|
7
|
-
getConfig, getTestRoot, updateConfig, safeFileWrite,
|
|
7
|
+
getConfig, getTestRoot, updateConfig, safeFileWrite, findConfigFile,
|
|
8
8
|
} = require('../utils');
|
|
9
9
|
|
|
10
10
|
const featureFile = `Feature: Business rules
|
|
@@ -26,7 +26,17 @@ Given('I have a defined step', () => {
|
|
|
26
26
|
|
|
27
27
|
module.exports = function (genPath) {
|
|
28
28
|
const testsPath = getTestRoot(genPath);
|
|
29
|
+
const configFile = findConfigFile(testsPath);
|
|
30
|
+
|
|
31
|
+
if (!configFile) {
|
|
32
|
+
output.error(
|
|
33
|
+
"Can't initialize Gherkin. This command must be run in an already initialized project.",
|
|
34
|
+
);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
const config = getConfig(testsPath);
|
|
39
|
+
const extension = path.extname(configFile).substring(1);
|
|
30
40
|
|
|
31
41
|
output.print('Initializing Gherkin (Cucumber BDD) for CodeceptJS');
|
|
32
42
|
output.print('--------------------------');
|
|
@@ -53,18 +63,18 @@ module.exports = function (genPath) {
|
|
|
53
63
|
output.success(`Created ${dir}, place step definitions into it`);
|
|
54
64
|
}
|
|
55
65
|
|
|
56
|
-
if (safeFileWrite(path.join(dir,
|
|
57
|
-
output.success(
|
|
66
|
+
if (safeFileWrite(path.join(dir, `steps.${extension}`), stepsFile)) {
|
|
67
|
+
output.success(
|
|
68
|
+
`Created sample steps file: step_definitions/steps.${extension}`,
|
|
69
|
+
);
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
config.gherkin = {
|
|
61
73
|
features: './features/*.feature',
|
|
62
|
-
steps: [
|
|
63
|
-
'./step_definitions/steps.js',
|
|
64
|
-
],
|
|
74
|
+
steps: [`./step_definitions/steps.${extension}`],
|
|
65
75
|
};
|
|
66
76
|
|
|
67
|
-
updateConfig(testsPath, config);
|
|
77
|
+
updateConfig(testsPath, config, extension);
|
|
68
78
|
|
|
69
79
|
output.success('Gherkin setup is done.');
|
|
70
80
|
output.success('Start writing feature files and implement corresponding steps.');
|
package/lib/command/utils.js
CHANGED
|
@@ -41,15 +41,15 @@ function fail(msg) {
|
|
|
41
41
|
|
|
42
42
|
module.exports.fail = fail;
|
|
43
43
|
|
|
44
|
-
function updateConfig(testsPath, config,
|
|
44
|
+
function updateConfig(testsPath, config, extension) {
|
|
45
45
|
const configFile = path.join(testsPath, `codecept.conf.${extension}`);
|
|
46
46
|
if (!fileExists(configFile)) {
|
|
47
|
-
console.log();
|
|
48
47
|
const msg = `codecept.conf.${extension} config can\'t be updated automatically`;
|
|
48
|
+
console.log();
|
|
49
49
|
console.log(`${output.colors.bold.red(msg)}`);
|
|
50
|
-
console.log('Please update it manually:');
|
|
50
|
+
console.log(`${output.colors.bold.red('Please update it manually:')}`);
|
|
51
51
|
console.log();
|
|
52
|
-
console.log(
|
|
52
|
+
console.log(config);
|
|
53
53
|
console.log();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
@@ -104,3 +104,14 @@ module.exports.createOutputDir = (config, testRoot) => {
|
|
|
104
104
|
mkdirp.sync(outputDir);
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
+
|
|
108
|
+
module.exports.findConfigFile = (testsPath) => {
|
|
109
|
+
const extensions = ['js', 'ts'];
|
|
110
|
+
for (const ext of extensions) {
|
|
111
|
+
const configFile = path.join(testsPath, `codecept.conf.${ext}`);
|
|
112
|
+
if (fileExists(configFile)) {
|
|
113
|
+
return configFile;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
};
|
package/lib/helper/Playwright.js
CHANGED
|
@@ -1981,7 +1981,7 @@ class Playwright extends Helper {
|
|
|
1981
1981
|
*/
|
|
1982
1982
|
async dontSeeCookie(name) {
|
|
1983
1983
|
const cookies = await this.browserContext.cookies();
|
|
1984
|
-
empty(`cookie ${name} to be set`).assert(cookies.filter(c => c.name === name));
|
|
1984
|
+
empty(`cookie ${name} not to be set`).assert(cookies.filter(c => c.name === name));
|
|
1985
1985
|
}
|
|
1986
1986
|
|
|
1987
1987
|
/**
|
package/lib/helper/Puppeteer.js
CHANGED
|
@@ -1627,7 +1627,7 @@ class Puppeteer extends Helper {
|
|
|
1627
1627
|
*/
|
|
1628
1628
|
async dontSeeCookie(name) {
|
|
1629
1629
|
const cookies = await this.page.cookies();
|
|
1630
|
-
empty(`cookie ${name} to be set`).assert(cookies.filter(c => c.name === name));
|
|
1630
|
+
empty(`cookie ${name} not to be set`).assert(cookies.filter(c => c.name === name));
|
|
1631
1631
|
}
|
|
1632
1632
|
|
|
1633
1633
|
/**
|
|
@@ -2472,12 +2472,12 @@ class Puppeteer extends Helper {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
|
|
2474
2474
|
/**
|
|
2475
|
-
* Mocks network request using [`Request Interception`](https://pptr.dev/
|
|
2475
|
+
* Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
|
|
2476
2476
|
*
|
|
2477
2477
|
* ```js
|
|
2478
2478
|
* I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
|
|
2479
2479
|
* ```
|
|
2480
|
-
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/
|
|
2480
|
+
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
|
|
2481
2481
|
*
|
|
2482
2482
|
* @param {string|RegExp} [url] URL, regex or pattern for to match URL
|
|
2483
2483
|
* @param {function} [handler] a function to process request
|
package/lib/plugin/retryTo.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const recorder = require('../recorder');
|
|
2
|
-
const store = require('../store');
|
|
3
2
|
const { debug } = require('../output');
|
|
4
3
|
|
|
5
4
|
const defaultConfig = {
|
|
@@ -73,49 +72,56 @@ const defaultConfig = {
|
|
|
73
72
|
* const retryTo = codeceptjs.container.plugins('retryTo');
|
|
74
73
|
* ```
|
|
75
74
|
*
|
|
76
|
-
*/
|
|
75
|
+
*/
|
|
77
76
|
module.exports = function (config) {
|
|
78
77
|
config = Object.assign(defaultConfig, config);
|
|
78
|
+
function retryTo(callback, maxTries, pollInterval = config.pollInterval) {
|
|
79
|
+
return new Promise((done, reject) => {
|
|
80
|
+
let tries = 1;
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
function handleRetryException(err) {
|
|
83
|
+
recorder.throw(err);
|
|
84
|
+
reject(err);
|
|
85
|
+
}
|
|
84
86
|
|
|
85
|
-
function retryTo(callback, maxTries, pollInterval = undefined) {
|
|
86
|
-
let tries = 1;
|
|
87
|
-
if (!pollInterval) pollInterval = config.pollInterval;
|
|
88
|
-
|
|
89
|
-
let err = null;
|
|
90
|
-
|
|
91
|
-
return new Promise((done) => {
|
|
92
87
|
const tryBlock = async () => {
|
|
88
|
+
tries++;
|
|
93
89
|
recorder.session.start(`retryTo ${tries}`);
|
|
94
|
-
|
|
90
|
+
try {
|
|
91
|
+
await callback(tries);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
handleRetryException(err);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Call done if no errors
|
|
95
97
|
recorder.add(() => {
|
|
96
98
|
recorder.session.restore(`retryTo ${tries}`);
|
|
97
99
|
done(null);
|
|
98
100
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
|
|
102
|
+
// Catch errors and retry
|
|
103
|
+
recorder.session.catch((err) => {
|
|
101
104
|
recorder.session.restore(`retryTo ${tries}`);
|
|
102
|
-
tries++;
|
|
103
105
|
if (tries <= maxTries) {
|
|
104
106
|
debug(`Error ${err}... Retrying`);
|
|
105
|
-
err = null;
|
|
106
|
-
|
|
107
107
|
recorder.add(`retryTo ${tries}`, () => setTimeout(tryBlock, pollInterval));
|
|
108
108
|
} else {
|
|
109
|
-
|
|
109
|
+
// if maxTries reached
|
|
110
|
+
handleRetryException(err);
|
|
110
111
|
}
|
|
111
112
|
});
|
|
112
113
|
};
|
|
113
114
|
|
|
114
|
-
recorder.add('retryTo',
|
|
115
|
-
|
|
115
|
+
recorder.add('retryTo', tryBlock).catch(err => {
|
|
116
|
+
console.error('An error occurred:', err);
|
|
117
|
+
done(null);
|
|
116
118
|
});
|
|
117
|
-
}).then(() => {
|
|
118
|
-
if (err) recorder.throw(err);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
if (config.registerGlobal) {
|
|
123
|
+
global.retryTo = retryTo;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return retryTo;
|
|
121
127
|
};
|
|
@@ -73,6 +73,10 @@ module.exports = function (config) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
event.dispatcher.on(event.test.failed, (test) => {
|
|
76
|
+
if (test.ctx?._runnable.title.includes('hook: ')) {
|
|
77
|
+
output.plugin('screenshotOnFail', 'BeforeSuite/AfterSuite do not have any access to the browser, hence it could not take screenshot.');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
76
80
|
recorder.add('screenshot of failed test', async () => {
|
|
77
81
|
let fileName = clearString(test.title);
|
|
78
82
|
const dataType = 'image/png';
|
|
@@ -99,12 +99,12 @@ module.exports = function (config) {
|
|
|
99
99
|
currentTest = test;
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
event.dispatcher.on(event.step.failed,
|
|
103
|
-
|
|
104
|
-
event.dispatcher.on(event.step.after, (step) => {
|
|
102
|
+
event.dispatcher.on(event.step.failed, (step) => {
|
|
105
103
|
recorder.add('screenshot of failed test', async () => persistStep(step), true);
|
|
106
104
|
});
|
|
107
105
|
|
|
106
|
+
event.dispatcher.on(event.step.after, persistStep);
|
|
107
|
+
|
|
108
108
|
event.dispatcher.on(event.test.passed, (test) => {
|
|
109
109
|
if (!config.deleteSuccessful) return persist(test);
|
|
110
110
|
// cleanup
|
|
@@ -112,8 +112,10 @@ module.exports = function (config) {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
event.dispatcher.on(event.test.failed, (test, err) => {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
if (test.ctx._runnable.title.includes('hook: ')) {
|
|
116
|
+
output.plugin('stepByStepReport', 'BeforeSuite/AfterSuite do not have any access to the browser, hence it could not take screenshot.');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
117
119
|
persist(test, err);
|
|
118
120
|
});
|
|
119
121
|
|
package/lib/scenario.js
CHANGED
|
@@ -18,6 +18,16 @@ const injectHook = function (inject, suite) {
|
|
|
18
18
|
return recorder.promise();
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
function makeDoneCallableOnce(done) {
|
|
22
|
+
let called = false;
|
|
23
|
+
return function (err) {
|
|
24
|
+
if (called) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
called = true;
|
|
28
|
+
return done(err);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
21
31
|
/**
|
|
22
32
|
* Wraps test function, injects support objects from container,
|
|
23
33
|
* starts promise chain with recorder, performs before/after hooks
|
|
@@ -34,15 +44,17 @@ module.exports.test = (test) => {
|
|
|
34
44
|
test.async = true;
|
|
35
45
|
|
|
36
46
|
test.fn = function (done) {
|
|
47
|
+
const doneFn = makeDoneCallableOnce(done);
|
|
37
48
|
recorder.errHandler((err) => {
|
|
38
49
|
recorder.session.start('teardown');
|
|
39
50
|
recorder.cleanAsyncErr();
|
|
40
|
-
if (test.throws) {
|
|
51
|
+
if (test.throws) {
|
|
52
|
+
// check that test should actually fail
|
|
41
53
|
try {
|
|
42
54
|
assertThrown(err, test.throws);
|
|
43
55
|
event.emit(event.test.passed, test);
|
|
44
56
|
event.emit(event.test.finished, test);
|
|
45
|
-
recorder.add(
|
|
57
|
+
recorder.add(doneFn);
|
|
46
58
|
return;
|
|
47
59
|
} catch (newErr) {
|
|
48
60
|
err = newErr;
|
|
@@ -50,40 +62,26 @@ module.exports.test = (test) => {
|
|
|
50
62
|
}
|
|
51
63
|
event.emit(event.test.failed, test, err);
|
|
52
64
|
event.emit(event.test.finished, test);
|
|
53
|
-
recorder.add(() =>
|
|
65
|
+
recorder.add(() => doneFn(err));
|
|
54
66
|
});
|
|
55
67
|
|
|
56
68
|
if (isAsyncFunction(testFn)) {
|
|
57
69
|
event.emit(event.test.started, test);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
testFn
|
|
71
|
+
.call(test, getInjectedArguments(testFn, test))
|
|
72
|
+
.then(() => {
|
|
73
|
+
recorder.add('fire test.passed', () => {
|
|
74
|
+
event.emit(event.test.passed, test);
|
|
75
|
+
event.emit(event.test.finished, test);
|
|
76
|
+
});
|
|
77
|
+
recorder.add('finish test', doneFn);
|
|
78
|
+
})
|
|
79
|
+
.catch((err) => {
|
|
80
|
+
recorder.throw(err);
|
|
81
|
+
})
|
|
82
|
+
.finally(() => {
|
|
83
|
+
recorder.catch();
|
|
68
84
|
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
let injectedArguments;
|
|
72
|
-
try {
|
|
73
|
-
injectedArguments = getInjectedArguments(testFn, test);
|
|
74
|
-
} catch (e) {
|
|
75
|
-
catchError(e);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
testFn.call(test, injectedArguments).then(() => {
|
|
80
|
-
recorder.add('fire test.passed', () => {
|
|
81
|
-
event.emit(event.test.passed, test);
|
|
82
|
-
event.emit(event.test.finished, test);
|
|
83
|
-
});
|
|
84
|
-
recorder.add('finish test', () => done());
|
|
85
|
-
recorder.catch();
|
|
86
|
-
}).catch(catchError);
|
|
87
85
|
return;
|
|
88
86
|
}
|
|
89
87
|
|
|
@@ -97,7 +95,7 @@ module.exports.test = (test) => {
|
|
|
97
95
|
event.emit(event.test.passed, test);
|
|
98
96
|
event.emit(event.test.finished, test);
|
|
99
97
|
});
|
|
100
|
-
recorder.add('finish test',
|
|
98
|
+
recorder.add('finish test', doneFn);
|
|
101
99
|
recorder.catch();
|
|
102
100
|
}
|
|
103
101
|
};
|
|
@@ -109,13 +107,14 @@ module.exports.test = (test) => {
|
|
|
109
107
|
*/
|
|
110
108
|
module.exports.injected = function (fn, suite, hookName) {
|
|
111
109
|
return function (done) {
|
|
110
|
+
const doneFn = makeDoneCallableOnce(done);
|
|
112
111
|
const errHandler = (err) => {
|
|
113
112
|
recorder.session.start('teardown');
|
|
114
113
|
recorder.cleanAsyncErr();
|
|
115
114
|
event.emit(event.test.failed, suite, err);
|
|
116
115
|
if (hookName === 'after') event.emit(event.test.after, suite);
|
|
117
116
|
if (hookName === 'afterSuite') event.emit(event.suite.after, suite);
|
|
118
|
-
recorder.add(() =>
|
|
117
|
+
recorder.add(() => doneFn(err));
|
|
119
118
|
};
|
|
120
119
|
|
|
121
120
|
recorder.errHandler((err) => {
|
|
@@ -137,28 +136,32 @@ module.exports.injected = function (fn, suite, hookName) {
|
|
|
137
136
|
const opts = suite.opts || {};
|
|
138
137
|
const retries = opts[`retry${ucfirst(hookName)}`] || 0;
|
|
139
138
|
|
|
140
|
-
promiseRetry(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
promiseRetry(
|
|
140
|
+
async (retry, number) => {
|
|
141
|
+
try {
|
|
142
|
+
recorder.startUnlessRunning();
|
|
143
|
+
await fn.call(this, getInjectedArguments(fn));
|
|
144
|
+
await recorder.promise().catch((err) => retry(err));
|
|
145
|
+
} catch (err) {
|
|
146
|
+
retry(err);
|
|
147
|
+
} finally {
|
|
148
|
+
if (number < retries) {
|
|
149
|
+
recorder.stop();
|
|
150
|
+
recorder.start();
|
|
151
|
+
}
|
|
151
152
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
153
|
+
},
|
|
154
|
+
{ retries },
|
|
155
|
+
)
|
|
154
156
|
.then(() => {
|
|
155
157
|
recorder.add('fire hook.passed', () => event.emit(event.hook.passed, suite));
|
|
156
|
-
recorder.add(`finish ${hookName} hook`,
|
|
158
|
+
recorder.add(`finish ${hookName} hook`, doneFn);
|
|
157
159
|
recorder.catch();
|
|
158
|
-
})
|
|
160
|
+
})
|
|
161
|
+
.catch((e) => {
|
|
159
162
|
recorder.throw(e);
|
|
160
163
|
recorder.catch((e) => {
|
|
161
|
-
const err =
|
|
164
|
+
const err = recorder.getAsyncErr() === null ? e : recorder.getAsyncErr();
|
|
162
165
|
errHandler(err);
|
|
163
166
|
});
|
|
164
167
|
recorder.add('fire hook.failed', () => event.emit(event.hook.failed, suite, e));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.6.3
|
|
3
|
+
"version": "3.6.3",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@xmldom/xmldom": "0.8.10",
|
|
77
77
|
"acorn": "8.11.3",
|
|
78
78
|
"arrify": "2.0.1",
|
|
79
|
-
"axios": "1.
|
|
79
|
+
"axios": "1.7.2",
|
|
80
80
|
"chai": "5.1.1",
|
|
81
81
|
"chai-deep-match": "1.2.1",
|
|
82
82
|
"chai-exclude": "2.1.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"cross-spawn": "7.0.3",
|
|
90
90
|
"css-to-xpath": "0.1.0",
|
|
91
91
|
"csstoxpath": "1.6.0",
|
|
92
|
-
"devtools": "8.
|
|
92
|
+
"devtools": "8.38.2",
|
|
93
93
|
"envinfo": "7.11.1",
|
|
94
94
|
"escape-string-regexp": "4.0.0",
|
|
95
95
|
"figures": "3.2.0",
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
"chai-subset": "1.6.0",
|
|
136
136
|
"contributor-faces": "1.1.0",
|
|
137
137
|
"documentation": "12.3.0",
|
|
138
|
-
"electron": "30.0
|
|
139
|
-
"eslint": "
|
|
138
|
+
"electron": "30.1.0",
|
|
139
|
+
"eslint": "8.57.0",
|
|
140
140
|
"eslint-config-airbnb-base": "15.0.0",
|
|
141
141
|
"eslint-plugin-import": "2.29.1",
|
|
142
142
|
"eslint-plugin-mocha": "10.4.3",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"jsdoc": "4.0.3",
|
|
149
149
|
"jsdoc-typeof-plugin": "1.0.0",
|
|
150
150
|
"json-server": "0.10.1",
|
|
151
|
-
"playwright": "1.44.
|
|
151
|
+
"playwright": "1.44.1",
|
|
152
152
|
"puppeteer": "22.10.0",
|
|
153
153
|
"qrcode-terminal": "0.12.0",
|
|
154
154
|
"rosie": "2.1.1",
|
|
@@ -161,10 +161,10 @@
|
|
|
161
161
|
"tsd": "^0.31.0",
|
|
162
162
|
"tsd-jsdoc": "2.5.0",
|
|
163
163
|
"typedoc": "0.25.13",
|
|
164
|
-
"typedoc-plugin-markdown": "
|
|
165
|
-
"typescript": "5.
|
|
164
|
+
"typedoc-plugin-markdown": "4.0.3",
|
|
165
|
+
"typescript": "5.4.5",
|
|
166
166
|
"wdio-docker-service": "1.5.0",
|
|
167
|
-
"webdriverio": "8.
|
|
167
|
+
"webdriverio": "8.38.2",
|
|
168
168
|
"xml2js": "0.6.2",
|
|
169
169
|
"xpath": "0.0.34"
|
|
170
170
|
},
|
|
@@ -179,4 +179,4 @@
|
|
|
179
179
|
"strict": false
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
}
|
|
182
|
+
}
|
|
@@ -1147,7 +1147,7 @@ declare namespace CodeceptJS {
|
|
|
1147
1147
|
* {
|
|
1148
1148
|
* helpers: {
|
|
1149
1149
|
* Playwright: {...},
|
|
1150
|
-
*
|
|
1150
|
+
* ExpectHelper: {},
|
|
1151
1151
|
* }
|
|
1152
1152
|
* }
|
|
1153
1153
|
* ```
|
|
@@ -1200,6 +1200,162 @@ declare namespace CodeceptJS {
|
|
|
1200
1200
|
* expects a JSON object matches a provided pattern
|
|
1201
1201
|
*/
|
|
1202
1202
|
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1203
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1204
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1205
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1206
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1207
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1208
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1209
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1210
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1211
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1212
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1213
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1214
|
+
/**
|
|
1215
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1216
|
+
*/
|
|
1217
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1218
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1219
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1220
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1221
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1222
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1223
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1224
|
+
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1225
|
+
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1226
|
+
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1227
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1228
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1229
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1230
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1231
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1232
|
+
/**
|
|
1233
|
+
* expects members of two arrays are deeply equal
|
|
1234
|
+
*/
|
|
1235
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1236
|
+
/**
|
|
1237
|
+
* expects an array to be a superset of another array
|
|
1238
|
+
*/
|
|
1239
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1240
|
+
/**
|
|
1241
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1242
|
+
*/
|
|
1243
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1244
|
+
/**
|
|
1245
|
+
* expects a JSON object matches a provided pattern
|
|
1246
|
+
*/
|
|
1247
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* This helper allows performing assertions based on Chai.
|
|
1251
|
+
*
|
|
1252
|
+
* ### Examples
|
|
1253
|
+
*
|
|
1254
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1255
|
+
*
|
|
1256
|
+
* ```js
|
|
1257
|
+
* // inside codecept.conf.js
|
|
1258
|
+
* {
|
|
1259
|
+
* helpers: {
|
|
1260
|
+
* Playwright: {...},
|
|
1261
|
+
* ExpectHelper: {},
|
|
1262
|
+
* }
|
|
1263
|
+
* }
|
|
1264
|
+
* ```
|
|
1265
|
+
*
|
|
1266
|
+
* ## Methods
|
|
1267
|
+
*/
|
|
1268
|
+
class ExpectHelper {
|
|
1269
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1270
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1271
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1272
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1273
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1274
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1275
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1276
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1277
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1278
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1279
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1280
|
+
/**
|
|
1281
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1282
|
+
*/
|
|
1283
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1284
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1285
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1286
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1287
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1288
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1289
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1290
|
+
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1291
|
+
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1292
|
+
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1293
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1294
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1295
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1296
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1297
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1298
|
+
/**
|
|
1299
|
+
* expects members of two arrays are deeply equal
|
|
1300
|
+
*/
|
|
1301
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1302
|
+
/**
|
|
1303
|
+
* expects an array to be a superset of another array
|
|
1304
|
+
*/
|
|
1305
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1306
|
+
/**
|
|
1307
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1308
|
+
*/
|
|
1309
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1310
|
+
/**
|
|
1311
|
+
* expects a JSON object matches a provided pattern
|
|
1312
|
+
*/
|
|
1313
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1314
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1315
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1316
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1317
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1318
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1319
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1320
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1321
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1322
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1323
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1324
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1325
|
+
/**
|
|
1326
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1327
|
+
*/
|
|
1328
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1329
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1330
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1331
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1332
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1333
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1334
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1335
|
+
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1336
|
+
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1337
|
+
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1338
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1339
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1340
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1341
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1342
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1343
|
+
/**
|
|
1344
|
+
* expects members of two arrays are deeply equal
|
|
1345
|
+
*/
|
|
1346
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1347
|
+
/**
|
|
1348
|
+
* expects an array to be a superset of another array
|
|
1349
|
+
*/
|
|
1350
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1351
|
+
/**
|
|
1352
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1353
|
+
*/
|
|
1354
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1355
|
+
/**
|
|
1356
|
+
* expects a JSON object matches a provided pattern
|
|
1357
|
+
*/
|
|
1358
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1203
1359
|
}
|
|
1204
1360
|
/**
|
|
1205
1361
|
* Helper for testing filesystem.
|
|
@@ -7866,12 +8022,12 @@ declare namespace CodeceptJS {
|
|
|
7866
8022
|
*/
|
|
7867
8023
|
grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
|
|
7868
8024
|
/**
|
|
7869
|
-
* Mocks network request using [`Request Interception`](https://pptr.dev/
|
|
8025
|
+
* Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
|
|
7870
8026
|
*
|
|
7871
8027
|
* ```js
|
|
7872
8028
|
* I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
|
|
7873
8029
|
* ```
|
|
7874
|
-
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/
|
|
8030
|
+
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
|
|
7875
8031
|
* @param [url] - URL, regex or pattern for to match URL
|
|
7876
8032
|
* @param [handler] - a function to process request
|
|
7877
8033
|
*/
|
package/typings/types.d.ts
CHANGED
|
@@ -1171,7 +1171,7 @@ declare namespace CodeceptJS {
|
|
|
1171
1171
|
* {
|
|
1172
1172
|
* helpers: {
|
|
1173
1173
|
* Playwright: {...},
|
|
1174
|
-
*
|
|
1174
|
+
* ExpectHelper: {},
|
|
1175
1175
|
* }
|
|
1176
1176
|
* }
|
|
1177
1177
|
* ```
|
|
@@ -1224,6 +1224,162 @@ declare namespace CodeceptJS {
|
|
|
1224
1224
|
* expects a JSON object matches a provided pattern
|
|
1225
1225
|
*/
|
|
1226
1226
|
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1227
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1228
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1229
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1230
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1231
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1232
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1233
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1234
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1235
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1236
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1237
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1238
|
+
/**
|
|
1239
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1240
|
+
*/
|
|
1241
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1242
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1243
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1244
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1245
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1246
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1247
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1248
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1249
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1250
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1251
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1252
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1253
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1254
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1255
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1256
|
+
/**
|
|
1257
|
+
* expects members of two arrays are deeply equal
|
|
1258
|
+
*/
|
|
1259
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1260
|
+
/**
|
|
1261
|
+
* expects an array to be a superset of another array
|
|
1262
|
+
*/
|
|
1263
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1264
|
+
/**
|
|
1265
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1266
|
+
*/
|
|
1267
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1268
|
+
/**
|
|
1269
|
+
* expects a JSON object matches a provided pattern
|
|
1270
|
+
*/
|
|
1271
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* This helper allows performing assertions based on Chai.
|
|
1275
|
+
*
|
|
1276
|
+
* ### Examples
|
|
1277
|
+
*
|
|
1278
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1279
|
+
*
|
|
1280
|
+
* ```js
|
|
1281
|
+
* // inside codecept.conf.js
|
|
1282
|
+
* {
|
|
1283
|
+
* helpers: {
|
|
1284
|
+
* Playwright: {...},
|
|
1285
|
+
* ExpectHelper: {},
|
|
1286
|
+
* }
|
|
1287
|
+
* }
|
|
1288
|
+
* ```
|
|
1289
|
+
*
|
|
1290
|
+
* ## Methods
|
|
1291
|
+
*/
|
|
1292
|
+
class ExpectHelper {
|
|
1293
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1294
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1295
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1296
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1297
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1298
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1299
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1300
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1301
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1302
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1303
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1304
|
+
/**
|
|
1305
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1306
|
+
*/
|
|
1307
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1308
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1309
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1310
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1311
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1312
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1313
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1314
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1315
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1316
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1317
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1318
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1319
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1320
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1321
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1322
|
+
/**
|
|
1323
|
+
* expects members of two arrays are deeply equal
|
|
1324
|
+
*/
|
|
1325
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1326
|
+
/**
|
|
1327
|
+
* expects an array to be a superset of another array
|
|
1328
|
+
*/
|
|
1329
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1330
|
+
/**
|
|
1331
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1332
|
+
*/
|
|
1333
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1334
|
+
/**
|
|
1335
|
+
* expects a JSON object matches a provided pattern
|
|
1336
|
+
*/
|
|
1337
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1338
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1339
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1340
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1341
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1342
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1343
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1344
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1345
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1346
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1347
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1348
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1349
|
+
/**
|
|
1350
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1351
|
+
*/
|
|
1352
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1353
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1354
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1355
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1356
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1357
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1358
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1359
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1360
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1361
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1362
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1363
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1364
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1365
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1366
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1367
|
+
/**
|
|
1368
|
+
* expects members of two arrays are deeply equal
|
|
1369
|
+
*/
|
|
1370
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1371
|
+
/**
|
|
1372
|
+
* expects an array to be a superset of another array
|
|
1373
|
+
*/
|
|
1374
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1375
|
+
/**
|
|
1376
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1377
|
+
*/
|
|
1378
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1379
|
+
/**
|
|
1380
|
+
* expects a JSON object matches a provided pattern
|
|
1381
|
+
*/
|
|
1382
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1227
1383
|
}
|
|
1228
1384
|
/**
|
|
1229
1385
|
* Helper for testing filesystem.
|
|
@@ -8372,12 +8528,12 @@ declare namespace CodeceptJS {
|
|
|
8372
8528
|
*/
|
|
8373
8529
|
grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
|
|
8374
8530
|
/**
|
|
8375
|
-
* Mocks network request using [`Request Interception`](https://pptr.dev/
|
|
8531
|
+
* Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
|
|
8376
8532
|
*
|
|
8377
8533
|
* ```js
|
|
8378
8534
|
* I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
|
|
8379
8535
|
* ```
|
|
8380
|
-
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/
|
|
8536
|
+
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
|
|
8381
8537
|
* @param [url] - URL, regex or pattern for to match URL
|
|
8382
8538
|
* @param [handler] - a function to process request
|
|
8383
8539
|
*/
|