codeceptjs 3.6.5 → 3.6.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/helper/Playwright.js +6 -7
- package/lib/locator.js +43 -0
- package/lib/template/heal.js +1 -0
- package/package.json +13 -12
- package/typings/promiseBasedTypes.d.ts +300 -0
- package/typings/types.d.ts +321 -0
package/lib/helper/Playwright.js
CHANGED
|
@@ -2396,9 +2396,9 @@ class Playwright extends Helper {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
|
|
2398
2398
|
if (this.options.recordVideo && this.page && this.page.video()) {
|
|
2399
|
-
test.artifacts.video =
|
|
2399
|
+
test.artifacts.video = saveVideoForPage(this.page, `${test.title}.failed`)
|
|
2400
2400
|
for (const sessionName in this.sessionPages) {
|
|
2401
|
-
test.artifacts[`video_${sessionName}`] =
|
|
2401
|
+
test.artifacts[`video_${sessionName}`] = saveVideoForPage(
|
|
2402
2402
|
this.sessionPages[sessionName],
|
|
2403
2403
|
`${test.title}_${sessionName}.failed`,
|
|
2404
2404
|
)
|
|
@@ -2424,9 +2424,9 @@ class Playwright extends Helper {
|
|
|
2424
2424
|
async _passed(test) {
|
|
2425
2425
|
if (this.options.recordVideo && this.page && this.page.video()) {
|
|
2426
2426
|
if (this.options.keepVideoForPassedTests) {
|
|
2427
|
-
test.artifacts.video =
|
|
2427
|
+
test.artifacts.video = saveVideoForPage(this.page, `${test.title}.passed`)
|
|
2428
2428
|
for (const sessionName of Object.keys(this.sessionPages)) {
|
|
2429
|
-
test.artifacts[`video_${sessionName}`] =
|
|
2429
|
+
test.artifacts[`video_${sessionName}`] = saveVideoForPage(
|
|
2430
2430
|
this.sessionPages[sessionName],
|
|
2431
2431
|
`${test.title}_${sessionName}.passed`,
|
|
2432
2432
|
)
|
|
@@ -3917,7 +3917,7 @@ async function refreshContextSession() {
|
|
|
3917
3917
|
}
|
|
3918
3918
|
}
|
|
3919
3919
|
|
|
3920
|
-
|
|
3920
|
+
function saveVideoForPage(page, name) {
|
|
3921
3921
|
if (!page.video()) return null
|
|
3922
3922
|
const fileName = `${`${global.output_dir}${pathSeparator}videos${pathSeparator}${uuidv4()}_${clearString(name)}`.slice(0, 245)}.webm`
|
|
3923
3923
|
page
|
|
@@ -3928,11 +3928,10 @@ async function saveVideoForPage(page, name) {
|
|
|
3928
3928
|
page
|
|
3929
3929
|
.video()
|
|
3930
3930
|
.delete()
|
|
3931
|
-
.catch((
|
|
3931
|
+
.catch(() => {})
|
|
3932
3932
|
})
|
|
3933
3933
|
return fileName
|
|
3934
3934
|
}
|
|
3935
|
-
|
|
3936
3935
|
async function saveTraceForContext(context, name) {
|
|
3937
3936
|
if (!context) return
|
|
3938
3937
|
if (!context.tracing) return
|
package/lib/locator.js
CHANGED
|
@@ -299,6 +299,49 @@ class Locator {
|
|
|
299
299
|
return new Locator({ xpath });
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
+
/**
|
|
303
|
+
* Adds condition: attribute value starts with text
|
|
304
|
+
* (analog of XPATH: [starts-with(@attr,'startValue')] or CSS [attr^='startValue']
|
|
305
|
+
* Example: I.click(locate('a').withAttrStartsWith('href', 'https://')));
|
|
306
|
+
* Works with any attribute: class, href etc.
|
|
307
|
+
* @param {string} attrName
|
|
308
|
+
* @param {string} startsWith
|
|
309
|
+
* @returns {Locator}
|
|
310
|
+
*/
|
|
311
|
+
withAttrStartsWith(attrName, startsWith) {
|
|
312
|
+
const xpath = sprintf('%s[%s]', this.toXPath(), `starts-with(@${attrName}, "${startsWith}")`);
|
|
313
|
+
return new Locator({ xpath });
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Adds condition: attribute value ends with text
|
|
318
|
+
* (analog of XPATH: [ends-with(@attr,'endValue')] or CSS [attr$='endValue']
|
|
319
|
+
* Example: I.click(locate('a').withAttrEndsWith('href', '.com')));
|
|
320
|
+
* Works with any attribute: class, href etc.
|
|
321
|
+
* @param {string} attrName
|
|
322
|
+
* @param {string} endsWith
|
|
323
|
+
* @returns {Locator}
|
|
324
|
+
*/
|
|
325
|
+
withAttrEndsWith(attrName, endsWith) {
|
|
326
|
+
const xpath = sprintf('%s[%s]', this.toXPath(), `substring(@${attrName}, string-length(@${attrName}) - string-length("${endsWith}") + 1) = "${endsWith}"`,
|
|
327
|
+
);
|
|
328
|
+
return new Locator({ xpath });
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Adds condition: attribute value contains text
|
|
333
|
+
* (analog of XPATH: [contains(@attr,'partOfAttribute')] or CSS [attr*='partOfAttribute']
|
|
334
|
+
* Example: I.click(locate('a').withAttrContains('href', 'google')));
|
|
335
|
+
* Works with any attribute: class, href etc.
|
|
336
|
+
* @param {string} attrName
|
|
337
|
+
* @param {string} partOfAttrValue
|
|
338
|
+
* @returns {Locator}
|
|
339
|
+
*/
|
|
340
|
+
withAttrContains(attrName, partOfAttrValue) {
|
|
341
|
+
const xpath = sprintf('%s[%s]', this.toXPath(), `contains(@${attrName}, "${partOfAttrValue}")`);
|
|
342
|
+
return new Locator({ xpath });
|
|
343
|
+
}
|
|
344
|
+
|
|
302
345
|
/**
|
|
303
346
|
* @param {String} text
|
|
304
347
|
* @returns {Locator}
|
package/lib/template/heal.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.6-beta.2",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@xmldom/xmldom": "0.8.10",
|
|
78
78
|
"acorn": "8.12.1",
|
|
79
79
|
"arrify": "2.0.1",
|
|
80
|
-
"axios": "1.7.
|
|
80
|
+
"axios": "1.7.3",
|
|
81
81
|
"chai": "5.1.1",
|
|
82
82
|
"chai-deep-match": "1.2.1",
|
|
83
83
|
"chai-exclude": "2.1.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"cross-spawn": "7.0.3",
|
|
91
91
|
"css-to-xpath": "0.1.0",
|
|
92
92
|
"csstoxpath": "1.6.0",
|
|
93
|
-
"devtools": "8.
|
|
93
|
+
"devtools": "8.40.2",
|
|
94
94
|
"envinfo": "7.11.1",
|
|
95
95
|
"escape-string-regexp": "4.0.0",
|
|
96
96
|
"figures": "3.2.0",
|
|
@@ -105,16 +105,16 @@
|
|
|
105
105
|
"lodash.merge": "4.6.2",
|
|
106
106
|
"mkdirp": "1.0.4",
|
|
107
107
|
"mocha": "10.6.0",
|
|
108
|
-
"monocart-coverage-reports": "2.10.
|
|
108
|
+
"monocart-coverage-reports": "2.10.3",
|
|
109
109
|
"ms": "2.1.3",
|
|
110
110
|
"ora-classic": "5.4.2",
|
|
111
|
-
"pactum": "3.
|
|
111
|
+
"pactum": "3.7.1",
|
|
112
112
|
"parse-function": "5.6.10",
|
|
113
113
|
"parse5": "7.1.2",
|
|
114
114
|
"promise-retry": "1.1.1",
|
|
115
115
|
"resq": "1.11.0",
|
|
116
116
|
"sprintf-js": "1.1.1",
|
|
117
|
-
"uuid": "
|
|
117
|
+
"uuid": "10.0"
|
|
118
118
|
},
|
|
119
119
|
"optionalDependencies": {
|
|
120
120
|
"@codeceptjs/detox-helper": "1.0.8"
|
|
@@ -127,24 +127,24 @@
|
|
|
127
127
|
"@types/chai": "4.3.16",
|
|
128
128
|
"@types/inquirer": "9.0.3",
|
|
129
129
|
"@types/node": "20.11.30",
|
|
130
|
-
"@wdio/sauce-service": "
|
|
130
|
+
"@wdio/sauce-service": "9.0.4",
|
|
131
131
|
"@wdio/selenium-standalone-service": "8.3.2",
|
|
132
|
-
"@wdio/utils": "
|
|
132
|
+
"@wdio/utils": "9.0.6",
|
|
133
133
|
"@xmldom/xmldom": "0.8.10",
|
|
134
134
|
"apollo-server-express": "2.25.3",
|
|
135
135
|
"chai-as-promised": "7.1.2",
|
|
136
136
|
"chai-subset": "1.6.0",
|
|
137
137
|
"contributor-faces": "1.1.0",
|
|
138
138
|
"documentation": "12.3.0",
|
|
139
|
-
"electron": "31.3.
|
|
139
|
+
"electron": "31.3.1",
|
|
140
140
|
"eslint": "8.57.0",
|
|
141
141
|
"eslint-config-airbnb-base": "15.0.0",
|
|
142
142
|
"eslint-plugin-import": "2.29.1",
|
|
143
|
-
"eslint-plugin-mocha": "10.
|
|
143
|
+
"eslint-plugin-mocha": "10.5.0",
|
|
144
144
|
"expect": "29.7.0",
|
|
145
145
|
"express": "4.19.2",
|
|
146
146
|
"graphql": "16.9.0",
|
|
147
|
-
"husky": "9.1.
|
|
147
|
+
"husky": "9.1.4",
|
|
148
148
|
"inquirer-test": "2.0.1",
|
|
149
149
|
"jsdoc": "4.0.3",
|
|
150
150
|
"jsdoc-typeof-plugin": "1.0.0",
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"qrcode-terminal": "0.12.0",
|
|
156
156
|
"rosie": "2.1.1",
|
|
157
157
|
"runok": "0.9.3",
|
|
158
|
+
"semver": "^7.6.3",
|
|
158
159
|
"sinon": "18.0.0",
|
|
159
160
|
"sinon-chai": "3.7.0",
|
|
160
161
|
"testcafe": "3.5.0",
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
"tsd": "^0.31.0",
|
|
164
165
|
"tsd-jsdoc": "2.5.0",
|
|
165
166
|
"typedoc": "0.26.5",
|
|
166
|
-
"typedoc-plugin-markdown": "4.2.
|
|
167
|
+
"typedoc-plugin-markdown": "4.2.6",
|
|
167
168
|
"typescript": "5.5.3",
|
|
168
169
|
"wdio-docker-service": "1.5.0",
|
|
169
170
|
"webdriverio": "8.39.1",
|
|
@@ -1180,6 +1180,13 @@ declare namespace CodeceptJS {
|
|
|
1180
1180
|
*
|
|
1181
1181
|
* ## Methods
|
|
1182
1182
|
*/
|
|
1183
|
+
// @ts-ignore
|
|
1184
|
+
// @ts-ignore
|
|
1185
|
+
// @ts-ignore
|
|
1186
|
+
// @ts-ignore
|
|
1187
|
+
// @ts-ignore
|
|
1188
|
+
// @ts-ignore
|
|
1189
|
+
// @ts-ignore
|
|
1183
1190
|
class ExpectHelper {
|
|
1184
1191
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1185
1192
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1291,6 +1298,13 @@ declare namespace CodeceptJS {
|
|
|
1291
1298
|
*
|
|
1292
1299
|
* ## Methods
|
|
1293
1300
|
*/
|
|
1301
|
+
// @ts-ignore
|
|
1302
|
+
// @ts-ignore
|
|
1303
|
+
// @ts-ignore
|
|
1304
|
+
// @ts-ignore
|
|
1305
|
+
// @ts-ignore
|
|
1306
|
+
// @ts-ignore
|
|
1307
|
+
// @ts-ignore
|
|
1294
1308
|
class ExpectHelper {
|
|
1295
1309
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1296
1310
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1962,6 +1976,13 @@ declare namespace CodeceptJS {
|
|
|
1962
1976
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
1963
1977
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1964
1978
|
*/
|
|
1979
|
+
// @ts-ignore
|
|
1980
|
+
// @ts-ignore
|
|
1981
|
+
// @ts-ignore
|
|
1982
|
+
// @ts-ignore
|
|
1983
|
+
// @ts-ignore
|
|
1984
|
+
// @ts-ignore
|
|
1985
|
+
// @ts-ignore
|
|
1965
1986
|
type MockServerConfig = {
|
|
1966
1987
|
port?: number;
|
|
1967
1988
|
host?: string;
|
|
@@ -2086,6 +2107,13 @@ declare namespace CodeceptJS {
|
|
|
2086
2107
|
*
|
|
2087
2108
|
* ## Methods
|
|
2088
2109
|
*/
|
|
2110
|
+
// @ts-ignore
|
|
2111
|
+
// @ts-ignore
|
|
2112
|
+
// @ts-ignore
|
|
2113
|
+
// @ts-ignore
|
|
2114
|
+
// @ts-ignore
|
|
2115
|
+
// @ts-ignore
|
|
2116
|
+
// @ts-ignore
|
|
2089
2117
|
class MockServer {
|
|
2090
2118
|
/**
|
|
2091
2119
|
* Start the mock server
|
|
@@ -3159,6 +3187,13 @@ declare namespace CodeceptJS {
|
|
|
3159
3187
|
* @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
3160
3188
|
* @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
|
|
3161
3189
|
*/
|
|
3190
|
+
// @ts-ignore
|
|
3191
|
+
// @ts-ignore
|
|
3192
|
+
// @ts-ignore
|
|
3193
|
+
// @ts-ignore
|
|
3194
|
+
// @ts-ignore
|
|
3195
|
+
// @ts-ignore
|
|
3196
|
+
// @ts-ignore
|
|
3162
3197
|
type PlaywrightConfig = {
|
|
3163
3198
|
url?: string;
|
|
3164
3199
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6535,6 +6570,13 @@ declare namespace CodeceptJS {
|
|
|
6535
6570
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6536
6571
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6537
6572
|
*/
|
|
6573
|
+
// @ts-ignore
|
|
6574
|
+
// @ts-ignore
|
|
6575
|
+
// @ts-ignore
|
|
6576
|
+
// @ts-ignore
|
|
6577
|
+
// @ts-ignore
|
|
6578
|
+
// @ts-ignore
|
|
6579
|
+
// @ts-ignore
|
|
6538
6580
|
type PuppeteerConfig = {
|
|
6539
6581
|
url: string;
|
|
6540
6582
|
basicAuth?: any;
|
|
@@ -8341,6 +8383,13 @@ declare namespace CodeceptJS {
|
|
|
8341
8383
|
* @property [onResponse] - an async function which can update response object.
|
|
8342
8384
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8343
8385
|
*/
|
|
8386
|
+
// @ts-ignore
|
|
8387
|
+
// @ts-ignore
|
|
8388
|
+
// @ts-ignore
|
|
8389
|
+
// @ts-ignore
|
|
8390
|
+
// @ts-ignore
|
|
8391
|
+
// @ts-ignore
|
|
8392
|
+
// @ts-ignore
|
|
8344
8393
|
type RESTConfig = {
|
|
8345
8394
|
endpoint?: string;
|
|
8346
8395
|
prettyPrintJson?: boolean;
|
|
@@ -8506,6 +8555,250 @@ declare namespace CodeceptJS {
|
|
|
8506
8555
|
*/
|
|
8507
8556
|
sendDeleteRequest(url: any, headers?: any): Promise<any>;
|
|
8508
8557
|
}
|
|
8558
|
+
/**
|
|
8559
|
+
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8560
|
+
* Unlike traditional assertions that stop the execution on failure,
|
|
8561
|
+
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8562
|
+
*
|
|
8563
|
+
* ### Examples
|
|
8564
|
+
*
|
|
8565
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8566
|
+
*
|
|
8567
|
+
* ```js
|
|
8568
|
+
* // inside codecept.conf.js
|
|
8569
|
+
* {
|
|
8570
|
+
* helpers: {
|
|
8571
|
+
* Playwright: {...},
|
|
8572
|
+
* SoftExpectHelper: {},
|
|
8573
|
+
* }
|
|
8574
|
+
* }
|
|
8575
|
+
* ```
|
|
8576
|
+
*
|
|
8577
|
+
* ```js
|
|
8578
|
+
* // in scenario
|
|
8579
|
+
* I.softExpectEqual('a', 'b')
|
|
8580
|
+
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8581
|
+
* ```
|
|
8582
|
+
*
|
|
8583
|
+
* ## Methods
|
|
8584
|
+
*/
|
|
8585
|
+
class SoftAssertHelperTs {
|
|
8586
|
+
/**
|
|
8587
|
+
* Performs a soft assertion by executing the provided assertion function.
|
|
8588
|
+
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8589
|
+
* @param assertionFn - The assertion function to execute.
|
|
8590
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8591
|
+
*/
|
|
8592
|
+
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
|
|
8593
|
+
/**
|
|
8594
|
+
* Throws an error if any soft assertions have failed.
|
|
8595
|
+
* The error message contains all the accumulated failures.
|
|
8596
|
+
*/
|
|
8597
|
+
flushSoftAssertions(): Promise<any>;
|
|
8598
|
+
/**
|
|
8599
|
+
* Softly asserts that two values are equal.
|
|
8600
|
+
* @param actualValue - The actual value.
|
|
8601
|
+
* @param expectedValue - The expected value.
|
|
8602
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8603
|
+
*/
|
|
8604
|
+
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8605
|
+
/**
|
|
8606
|
+
* Softly asserts that two values are not equal.
|
|
8607
|
+
* @param actualValue - The actual value.
|
|
8608
|
+
* @param expectedValue - The expected value.
|
|
8609
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8610
|
+
*/
|
|
8611
|
+
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8612
|
+
/**
|
|
8613
|
+
* Softly asserts that two values are deeply equal.
|
|
8614
|
+
* @param actualValue - The actual value.
|
|
8615
|
+
* @param expectedValue - The expected value.
|
|
8616
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8617
|
+
*/
|
|
8618
|
+
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8619
|
+
/**
|
|
8620
|
+
* Softly asserts that two values are not deeply equal.
|
|
8621
|
+
* @param actualValue - The actual value.
|
|
8622
|
+
* @param expectedValue - The expected value.
|
|
8623
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8624
|
+
*/
|
|
8625
|
+
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8626
|
+
/**
|
|
8627
|
+
* Softly asserts that a value contains the expected value.
|
|
8628
|
+
* @param actualValue - The actual value.
|
|
8629
|
+
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
8630
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8631
|
+
*/
|
|
8632
|
+
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
|
|
8633
|
+
/**
|
|
8634
|
+
* Softly asserts that a value does not contain the expected value.
|
|
8635
|
+
* @param actualValue - The actual value.
|
|
8636
|
+
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
8637
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8638
|
+
*/
|
|
8639
|
+
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
|
|
8640
|
+
/**
|
|
8641
|
+
* Softly asserts that a value starts with the expected value.
|
|
8642
|
+
* @param actualValue - The actual value.
|
|
8643
|
+
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
8644
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8645
|
+
*/
|
|
8646
|
+
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8647
|
+
/**
|
|
8648
|
+
* Softly asserts that a value does not start with the expected value.
|
|
8649
|
+
* @param actualValue - The actual value.
|
|
8650
|
+
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
8651
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8652
|
+
*/
|
|
8653
|
+
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8654
|
+
/**
|
|
8655
|
+
* Softly asserts that a value ends with the expected value.
|
|
8656
|
+
* @param actualValue - The actual value.
|
|
8657
|
+
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
8658
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8659
|
+
*/
|
|
8660
|
+
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8661
|
+
/**
|
|
8662
|
+
* Softly asserts that a value does not end with the expected value.
|
|
8663
|
+
* @param actualValue - The actual value.
|
|
8664
|
+
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
8665
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8666
|
+
*/
|
|
8667
|
+
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8668
|
+
/**
|
|
8669
|
+
* Softly asserts that the target data matches the given JSON schema.
|
|
8670
|
+
* @param targetData - The data to validate.
|
|
8671
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
8672
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8673
|
+
*/
|
|
8674
|
+
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
|
|
8675
|
+
/**
|
|
8676
|
+
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
8677
|
+
* @param targetData - The data to validate.
|
|
8678
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
8679
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8680
|
+
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
8681
|
+
*/
|
|
8682
|
+
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
|
|
8683
|
+
/**
|
|
8684
|
+
* Softly asserts that the target data has the specified property.
|
|
8685
|
+
* @param targetData - The data to check.
|
|
8686
|
+
* @param propertyName - The property name to check for.
|
|
8687
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
8688
|
+
* fails.
|
|
8689
|
+
*/
|
|
8690
|
+
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8691
|
+
/**
|
|
8692
|
+
* Softly asserts that the target data has a property with the specified name.
|
|
8693
|
+
* @param targetData - The data to check.
|
|
8694
|
+
* @param propertyName - The property name to check for.
|
|
8695
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8696
|
+
*/
|
|
8697
|
+
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8698
|
+
/**
|
|
8699
|
+
* Softly asserts that the target data is of a specific type.
|
|
8700
|
+
* @param targetData - The data to check.
|
|
8701
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
8702
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8703
|
+
*/
|
|
8704
|
+
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8705
|
+
/**
|
|
8706
|
+
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
8707
|
+
* @param targetData - The data to check.
|
|
8708
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
8709
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8710
|
+
*/
|
|
8711
|
+
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8712
|
+
/**
|
|
8713
|
+
* Softly asserts that the target data has a specified length.
|
|
8714
|
+
* @param targetData - The data to check.
|
|
8715
|
+
* @param length - The expected length.
|
|
8716
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8717
|
+
*/
|
|
8718
|
+
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
|
|
8719
|
+
/**
|
|
8720
|
+
* Softly asserts that the target data is empty.
|
|
8721
|
+
* @param targetData - The data to check.
|
|
8722
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8723
|
+
*/
|
|
8724
|
+
softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8725
|
+
/**
|
|
8726
|
+
* Softly asserts that the target data is true.
|
|
8727
|
+
* @param targetData - The data to check.
|
|
8728
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8729
|
+
*/
|
|
8730
|
+
softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8731
|
+
/**
|
|
8732
|
+
* Softly asserts that the target data is false.
|
|
8733
|
+
* @param targetData - The data to check.
|
|
8734
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8735
|
+
*/
|
|
8736
|
+
softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8737
|
+
/**
|
|
8738
|
+
* Softly asserts that the target data is above a specified value.
|
|
8739
|
+
* @param targetData - The data to check.
|
|
8740
|
+
* @param aboveThan - The value that the target data should be above.
|
|
8741
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8742
|
+
*/
|
|
8743
|
+
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
|
|
8744
|
+
/**
|
|
8745
|
+
* Softly asserts that the target data is below a specified value.
|
|
8746
|
+
* @param targetData - The data to check.
|
|
8747
|
+
* @param belowThan - The value that the target data should be below.
|
|
8748
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8749
|
+
*/
|
|
8750
|
+
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
|
|
8751
|
+
/**
|
|
8752
|
+
* Softly asserts that the length of the target data is above a specified value.
|
|
8753
|
+
* @param targetData - The data to check.
|
|
8754
|
+
* @param lengthAboveThan - The length that the target data should be above.
|
|
8755
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8756
|
+
*/
|
|
8757
|
+
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
|
|
8758
|
+
/**
|
|
8759
|
+
* Softly asserts that the length of the target data is below a specified value.
|
|
8760
|
+
* @param targetData - The data to check.
|
|
8761
|
+
* @param lengthBelowThan - The length that the target data should be below.
|
|
8762
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8763
|
+
*/
|
|
8764
|
+
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
|
|
8765
|
+
/**
|
|
8766
|
+
* Softly asserts that two values are equal, ignoring case.
|
|
8767
|
+
* @param actualValue - The actual string value.
|
|
8768
|
+
* @param expectedValue - The expected string value.
|
|
8769
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8770
|
+
*/
|
|
8771
|
+
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
|
|
8772
|
+
/**
|
|
8773
|
+
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
8774
|
+
* @param actualValue - The actual array.
|
|
8775
|
+
* @param expectedValue - The expected array.
|
|
8776
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8777
|
+
*/
|
|
8778
|
+
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
|
|
8779
|
+
/**
|
|
8780
|
+
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
8781
|
+
* @param superset - The array that should contain the expected members.
|
|
8782
|
+
* @param set - The array with members that should be included.
|
|
8783
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8784
|
+
*/
|
|
8785
|
+
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
|
|
8786
|
+
/**
|
|
8787
|
+
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
8788
|
+
* @param actualValue - The actual object.
|
|
8789
|
+
* @param expectedValue - The expected object.
|
|
8790
|
+
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
8791
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8792
|
+
*/
|
|
8793
|
+
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
|
|
8794
|
+
/**
|
|
8795
|
+
* Softly asserts that a value matches the expected pattern.
|
|
8796
|
+
* @param actualValue - The actual value.
|
|
8797
|
+
* @param expectedPattern - The pattern the value should match.
|
|
8798
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8799
|
+
*/
|
|
8800
|
+
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
|
|
8801
|
+
}
|
|
8509
8802
|
/**
|
|
8510
8803
|
* Client Functions
|
|
8511
8804
|
*/
|
|
@@ -9459,6 +9752,13 @@ declare namespace CodeceptJS {
|
|
|
9459
9752
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9460
9753
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9461
9754
|
*/
|
|
9755
|
+
// @ts-ignore
|
|
9756
|
+
// @ts-ignore
|
|
9757
|
+
// @ts-ignore
|
|
9758
|
+
// @ts-ignore
|
|
9759
|
+
// @ts-ignore
|
|
9760
|
+
// @ts-ignore
|
|
9761
|
+
// @ts-ignore
|
|
9462
9762
|
type WebDriverConfig = {
|
|
9463
9763
|
url: string;
|
|
9464
9764
|
browser: string;
|
package/typings/types.d.ts
CHANGED
|
@@ -1204,6 +1204,13 @@ declare namespace CodeceptJS {
|
|
|
1204
1204
|
*
|
|
1205
1205
|
* ## Methods
|
|
1206
1206
|
*/
|
|
1207
|
+
// @ts-ignore
|
|
1208
|
+
// @ts-ignore
|
|
1209
|
+
// @ts-ignore
|
|
1210
|
+
// @ts-ignore
|
|
1211
|
+
// @ts-ignore
|
|
1212
|
+
// @ts-ignore
|
|
1213
|
+
// @ts-ignore
|
|
1207
1214
|
class ExpectHelper {
|
|
1208
1215
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1209
1216
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -1315,6 +1322,13 @@ declare namespace CodeceptJS {
|
|
|
1315
1322
|
*
|
|
1316
1323
|
* ## Methods
|
|
1317
1324
|
*/
|
|
1325
|
+
// @ts-ignore
|
|
1326
|
+
// @ts-ignore
|
|
1327
|
+
// @ts-ignore
|
|
1328
|
+
// @ts-ignore
|
|
1329
|
+
// @ts-ignore
|
|
1330
|
+
// @ts-ignore
|
|
1331
|
+
// @ts-ignore
|
|
1318
1332
|
class ExpectHelper {
|
|
1319
1333
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1320
1334
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -1989,6 +2003,13 @@ declare namespace CodeceptJS {
|
|
|
1989
2003
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
1990
2004
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1991
2005
|
*/
|
|
2006
|
+
// @ts-ignore
|
|
2007
|
+
// @ts-ignore
|
|
2008
|
+
// @ts-ignore
|
|
2009
|
+
// @ts-ignore
|
|
2010
|
+
// @ts-ignore
|
|
2011
|
+
// @ts-ignore
|
|
2012
|
+
// @ts-ignore
|
|
1992
2013
|
type MockServerConfig = {
|
|
1993
2014
|
port?: number;
|
|
1994
2015
|
host?: string;
|
|
@@ -2113,6 +2134,13 @@ declare namespace CodeceptJS {
|
|
|
2113
2134
|
*
|
|
2114
2135
|
* ## Methods
|
|
2115
2136
|
*/
|
|
2137
|
+
// @ts-ignore
|
|
2138
|
+
// @ts-ignore
|
|
2139
|
+
// @ts-ignore
|
|
2140
|
+
// @ts-ignore
|
|
2141
|
+
// @ts-ignore
|
|
2142
|
+
// @ts-ignore
|
|
2143
|
+
// @ts-ignore
|
|
2116
2144
|
class MockServer {
|
|
2117
2145
|
/**
|
|
2118
2146
|
* Start the mock server
|
|
@@ -3252,6 +3280,13 @@ declare namespace CodeceptJS {
|
|
|
3252
3280
|
* @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
3253
3281
|
* @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
|
|
3254
3282
|
*/
|
|
3283
|
+
// @ts-ignore
|
|
3284
|
+
// @ts-ignore
|
|
3285
|
+
// @ts-ignore
|
|
3286
|
+
// @ts-ignore
|
|
3287
|
+
// @ts-ignore
|
|
3288
|
+
// @ts-ignore
|
|
3289
|
+
// @ts-ignore
|
|
3255
3290
|
type PlaywrightConfig = {
|
|
3256
3291
|
url?: string;
|
|
3257
3292
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6779,6 +6814,13 @@ declare namespace CodeceptJS {
|
|
|
6779
6814
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6780
6815
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6781
6816
|
*/
|
|
6817
|
+
// @ts-ignore
|
|
6818
|
+
// @ts-ignore
|
|
6819
|
+
// @ts-ignore
|
|
6820
|
+
// @ts-ignore
|
|
6821
|
+
// @ts-ignore
|
|
6822
|
+
// @ts-ignore
|
|
6823
|
+
// @ts-ignore
|
|
6782
6824
|
type PuppeteerConfig = {
|
|
6783
6825
|
url: string;
|
|
6784
6826
|
basicAuth?: any;
|
|
@@ -8721,6 +8763,13 @@ declare namespace CodeceptJS {
|
|
|
8721
8763
|
* @property [onResponse] - an async function which can update response object.
|
|
8722
8764
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8723
8765
|
*/
|
|
8766
|
+
// @ts-ignore
|
|
8767
|
+
// @ts-ignore
|
|
8768
|
+
// @ts-ignore
|
|
8769
|
+
// @ts-ignore
|
|
8770
|
+
// @ts-ignore
|
|
8771
|
+
// @ts-ignore
|
|
8772
|
+
// @ts-ignore
|
|
8724
8773
|
type RESTConfig = {
|
|
8725
8774
|
endpoint?: string;
|
|
8726
8775
|
prettyPrintJson?: boolean;
|
|
@@ -8886,6 +8935,250 @@ declare namespace CodeceptJS {
|
|
|
8886
8935
|
*/
|
|
8887
8936
|
sendDeleteRequest(url: any, headers?: any): Promise<any>;
|
|
8888
8937
|
}
|
|
8938
|
+
/**
|
|
8939
|
+
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8940
|
+
* Unlike traditional assertions that stop the execution on failure,
|
|
8941
|
+
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8942
|
+
*
|
|
8943
|
+
* ### Examples
|
|
8944
|
+
*
|
|
8945
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8946
|
+
*
|
|
8947
|
+
* ```js
|
|
8948
|
+
* // inside codecept.conf.js
|
|
8949
|
+
* {
|
|
8950
|
+
* helpers: {
|
|
8951
|
+
* Playwright: {...},
|
|
8952
|
+
* SoftExpectHelper: {},
|
|
8953
|
+
* }
|
|
8954
|
+
* }
|
|
8955
|
+
* ```
|
|
8956
|
+
*
|
|
8957
|
+
* ```js
|
|
8958
|
+
* // in scenario
|
|
8959
|
+
* I.softExpectEqual('a', 'b')
|
|
8960
|
+
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8961
|
+
* ```
|
|
8962
|
+
*
|
|
8963
|
+
* ## Methods
|
|
8964
|
+
*/
|
|
8965
|
+
class SoftAssertHelper {
|
|
8966
|
+
/**
|
|
8967
|
+
* Performs a soft assertion by executing the provided assertion function.
|
|
8968
|
+
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8969
|
+
* @param assertionFn - The assertion function to execute.
|
|
8970
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8971
|
+
*/
|
|
8972
|
+
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): void;
|
|
8973
|
+
/**
|
|
8974
|
+
* Throws an error if any soft assertions have failed.
|
|
8975
|
+
* The error message contains all the accumulated failures.
|
|
8976
|
+
*/
|
|
8977
|
+
flushSoftAssertions(): void;
|
|
8978
|
+
/**
|
|
8979
|
+
* Softly asserts that two values are equal.
|
|
8980
|
+
* @param actualValue - The actual value.
|
|
8981
|
+
* @param expectedValue - The expected value.
|
|
8982
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8983
|
+
*/
|
|
8984
|
+
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8985
|
+
/**
|
|
8986
|
+
* Softly asserts that two values are not equal.
|
|
8987
|
+
* @param actualValue - The actual value.
|
|
8988
|
+
* @param expectedValue - The expected value.
|
|
8989
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8990
|
+
*/
|
|
8991
|
+
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8992
|
+
/**
|
|
8993
|
+
* Softly asserts that two values are deeply equal.
|
|
8994
|
+
* @param actualValue - The actual value.
|
|
8995
|
+
* @param expectedValue - The expected value.
|
|
8996
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8997
|
+
*/
|
|
8998
|
+
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8999
|
+
/**
|
|
9000
|
+
* Softly asserts that two values are not deeply equal.
|
|
9001
|
+
* @param actualValue - The actual value.
|
|
9002
|
+
* @param expectedValue - The expected value.
|
|
9003
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9004
|
+
*/
|
|
9005
|
+
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9006
|
+
/**
|
|
9007
|
+
* Softly asserts that a value contains the expected value.
|
|
9008
|
+
* @param actualValue - The actual value.
|
|
9009
|
+
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
9010
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9011
|
+
*/
|
|
9012
|
+
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): void;
|
|
9013
|
+
/**
|
|
9014
|
+
* Softly asserts that a value does not contain the expected value.
|
|
9015
|
+
* @param actualValue - The actual value.
|
|
9016
|
+
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
9017
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9018
|
+
*/
|
|
9019
|
+
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): void;
|
|
9020
|
+
/**
|
|
9021
|
+
* Softly asserts that a value starts with the expected value.
|
|
9022
|
+
* @param actualValue - The actual value.
|
|
9023
|
+
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
9024
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9025
|
+
*/
|
|
9026
|
+
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): void;
|
|
9027
|
+
/**
|
|
9028
|
+
* Softly asserts that a value does not start with the expected value.
|
|
9029
|
+
* @param actualValue - The actual value.
|
|
9030
|
+
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
9031
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9032
|
+
*/
|
|
9033
|
+
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): void;
|
|
9034
|
+
/**
|
|
9035
|
+
* Softly asserts that a value ends with the expected value.
|
|
9036
|
+
* @param actualValue - The actual value.
|
|
9037
|
+
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
9038
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9039
|
+
*/
|
|
9040
|
+
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): void;
|
|
9041
|
+
/**
|
|
9042
|
+
* Softly asserts that a value does not end with the expected value.
|
|
9043
|
+
* @param actualValue - The actual value.
|
|
9044
|
+
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
9045
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9046
|
+
*/
|
|
9047
|
+
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): void;
|
|
9048
|
+
/**
|
|
9049
|
+
* Softly asserts that the target data matches the given JSON schema.
|
|
9050
|
+
* @param targetData - The data to validate.
|
|
9051
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
9052
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9053
|
+
*/
|
|
9054
|
+
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): void;
|
|
9055
|
+
/**
|
|
9056
|
+
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
9057
|
+
* @param targetData - The data to validate.
|
|
9058
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
9059
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9060
|
+
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
9061
|
+
*/
|
|
9062
|
+
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): void;
|
|
9063
|
+
/**
|
|
9064
|
+
* Softly asserts that the target data has the specified property.
|
|
9065
|
+
* @param targetData - The data to check.
|
|
9066
|
+
* @param propertyName - The property name to check for.
|
|
9067
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
9068
|
+
* fails.
|
|
9069
|
+
*/
|
|
9070
|
+
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9071
|
+
/**
|
|
9072
|
+
* Softly asserts that the target data has a property with the specified name.
|
|
9073
|
+
* @param targetData - The data to check.
|
|
9074
|
+
* @param propertyName - The property name to check for.
|
|
9075
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9076
|
+
*/
|
|
9077
|
+
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9078
|
+
/**
|
|
9079
|
+
* Softly asserts that the target data is of a specific type.
|
|
9080
|
+
* @param targetData - The data to check.
|
|
9081
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
9082
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9083
|
+
*/
|
|
9084
|
+
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9085
|
+
/**
|
|
9086
|
+
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
9087
|
+
* @param targetData - The data to check.
|
|
9088
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
9089
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9090
|
+
*/
|
|
9091
|
+
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9092
|
+
/**
|
|
9093
|
+
* Softly asserts that the target data has a specified length.
|
|
9094
|
+
* @param targetData - The data to check.
|
|
9095
|
+
* @param length - The expected length.
|
|
9096
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9097
|
+
*/
|
|
9098
|
+
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): void;
|
|
9099
|
+
/**
|
|
9100
|
+
* Softly asserts that the target data is empty.
|
|
9101
|
+
* @param targetData - The data to check.
|
|
9102
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9103
|
+
*/
|
|
9104
|
+
softExpectEmpty(targetData: any, customErrorMsg?: string): void;
|
|
9105
|
+
/**
|
|
9106
|
+
* Softly asserts that the target data is true.
|
|
9107
|
+
* @param targetData - The data to check.
|
|
9108
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9109
|
+
*/
|
|
9110
|
+
softExpectTrue(targetData: any, customErrorMsg?: string): void;
|
|
9111
|
+
/**
|
|
9112
|
+
* Softly asserts that the target data is false.
|
|
9113
|
+
* @param targetData - The data to check.
|
|
9114
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9115
|
+
*/
|
|
9116
|
+
softExpectFalse(targetData: any, customErrorMsg?: string): void;
|
|
9117
|
+
/**
|
|
9118
|
+
* Softly asserts that the target data is above a specified value.
|
|
9119
|
+
* @param targetData - The data to check.
|
|
9120
|
+
* @param aboveThan - The value that the target data should be above.
|
|
9121
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9122
|
+
*/
|
|
9123
|
+
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): void;
|
|
9124
|
+
/**
|
|
9125
|
+
* Softly asserts that the target data is below a specified value.
|
|
9126
|
+
* @param targetData - The data to check.
|
|
9127
|
+
* @param belowThan - The value that the target data should be below.
|
|
9128
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9129
|
+
*/
|
|
9130
|
+
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): void;
|
|
9131
|
+
/**
|
|
9132
|
+
* Softly asserts that the length of the target data is above a specified value.
|
|
9133
|
+
* @param targetData - The data to check.
|
|
9134
|
+
* @param lengthAboveThan - The length that the target data should be above.
|
|
9135
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9136
|
+
*/
|
|
9137
|
+
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): void;
|
|
9138
|
+
/**
|
|
9139
|
+
* Softly asserts that the length of the target data is below a specified value.
|
|
9140
|
+
* @param targetData - The data to check.
|
|
9141
|
+
* @param lengthBelowThan - The length that the target data should be below.
|
|
9142
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9143
|
+
*/
|
|
9144
|
+
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): void;
|
|
9145
|
+
/**
|
|
9146
|
+
* Softly asserts that two values are equal, ignoring case.
|
|
9147
|
+
* @param actualValue - The actual string value.
|
|
9148
|
+
* @param expectedValue - The expected string value.
|
|
9149
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9150
|
+
*/
|
|
9151
|
+
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): void;
|
|
9152
|
+
/**
|
|
9153
|
+
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
9154
|
+
* @param actualValue - The actual array.
|
|
9155
|
+
* @param expectedValue - The expected array.
|
|
9156
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9157
|
+
*/
|
|
9158
|
+
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): void;
|
|
9159
|
+
/**
|
|
9160
|
+
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
9161
|
+
* @param superset - The array that should contain the expected members.
|
|
9162
|
+
* @param set - The array with members that should be included.
|
|
9163
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9164
|
+
*/
|
|
9165
|
+
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void;
|
|
9166
|
+
/**
|
|
9167
|
+
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
9168
|
+
* @param actualValue - The actual object.
|
|
9169
|
+
* @param expectedValue - The expected object.
|
|
9170
|
+
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
9171
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9172
|
+
*/
|
|
9173
|
+
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): void;
|
|
9174
|
+
/**
|
|
9175
|
+
* Softly asserts that a value matches the expected pattern.
|
|
9176
|
+
* @param actualValue - The actual value.
|
|
9177
|
+
* @param expectedPattern - The pattern the value should match.
|
|
9178
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9179
|
+
*/
|
|
9180
|
+
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): void;
|
|
9181
|
+
}
|
|
8889
9182
|
/**
|
|
8890
9183
|
* Client Functions
|
|
8891
9184
|
*/
|
|
@@ -9899,6 +10192,13 @@ declare namespace CodeceptJS {
|
|
|
9899
10192
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9900
10193
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9901
10194
|
*/
|
|
10195
|
+
// @ts-ignore
|
|
10196
|
+
// @ts-ignore
|
|
10197
|
+
// @ts-ignore
|
|
10198
|
+
// @ts-ignore
|
|
10199
|
+
// @ts-ignore
|
|
10200
|
+
// @ts-ignore
|
|
10201
|
+
// @ts-ignore
|
|
9902
10202
|
type WebDriverConfig = {
|
|
9903
10203
|
url: string;
|
|
9904
10204
|
browser: string;
|
|
@@ -12368,6 +12668,27 @@ declare namespace CodeceptJS {
|
|
|
12368
12668
|
withAttr(attributes: {
|
|
12369
12669
|
[key: string]: string;
|
|
12370
12670
|
}): Locator;
|
|
12671
|
+
/**
|
|
12672
|
+
* Adds condition: attribute value starts with text
|
|
12673
|
+
* (analog of XPATH: [starts-with(@attr,'startValue')] or CSS [attr^='startValue']
|
|
12674
|
+
* Example: I.click(locate('a').withAttrStartsWith('href', 'https://')));
|
|
12675
|
+
* Works with any attribute: class, href etc.
|
|
12676
|
+
*/
|
|
12677
|
+
withAttrStartsWith(attrName: string, startsWith: string): Locator;
|
|
12678
|
+
/**
|
|
12679
|
+
* Adds condition: attribute value ends with text
|
|
12680
|
+
* (analog of XPATH: [ends-with(@attr,'endValue')] or CSS [attr$='endValue']
|
|
12681
|
+
* Example: I.click(locate('a').withAttrEndsWith('href', '.com')));
|
|
12682
|
+
* Works with any attribute: class, href etc.
|
|
12683
|
+
*/
|
|
12684
|
+
withAttrEndsWith(attrName: string, endsWith: string): Locator;
|
|
12685
|
+
/**
|
|
12686
|
+
* Adds condition: attribute value contains text
|
|
12687
|
+
* (analog of XPATH: [contains(@attr,'partOfAttribute')] or CSS [attr*='partOfAttribute']
|
|
12688
|
+
* Example: I.click(locate('a').withAttrContains('href', 'google')));
|
|
12689
|
+
* Works with any attribute: class, href etc.
|
|
12690
|
+
*/
|
|
12691
|
+
withAttrContains(attrName: string, partOfAttrValue: string): Locator;
|
|
12371
12692
|
withClassAttr(text: string): Locator;
|
|
12372
12693
|
as(output: string): Locator;
|
|
12373
12694
|
inside(locator: CodeceptJS.LocatorOrString): Locator;
|