codeceptjs 3.6.6-beta.5 → 3.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command/run-rerun.js +0 -4
- package/lib/command/workers/runTests.js +1 -1
- package/lib/helper/AI.js +2 -2
- package/lib/helper/REST.js +22 -2
- package/lib/helper/SoftExpectHelper.js +381 -0
- package/lib/rerun.js +1 -0
- package/package.json +12 -12
- package/typings/promiseBasedTypes.d.ts +16 -72
- package/typings/types.d.ts +17 -72
package/lib/command/run-rerun.js
CHANGED
|
@@ -17,10 +17,6 @@ module.exports = async function (test, options) {
|
|
|
17
17
|
const testRoot = getTestRoot(configFile)
|
|
18
18
|
createOutputDir(config, testRoot)
|
|
19
19
|
|
|
20
|
-
function processError(err) {
|
|
21
|
-
printError(err)
|
|
22
|
-
process.exit(1)
|
|
23
|
-
}
|
|
24
20
|
const codecept = new Codecept(config, options)
|
|
25
21
|
|
|
26
22
|
try {
|
package/lib/helper/AI.js
CHANGED
|
@@ -74,7 +74,7 @@ class AI extends Helper {
|
|
|
74
74
|
for (const chunk of htmlChunks) {
|
|
75
75
|
const messages = [
|
|
76
76
|
{ role: gtpRole.user, content: prompt },
|
|
77
|
-
{ role: gtpRole.user, content: `Within this HTML: ${minifyHtml(chunk)}` },
|
|
77
|
+
{ role: gtpRole.user, content: `Within this HTML: ${await minifyHtml(chunk)}` },
|
|
78
78
|
]
|
|
79
79
|
|
|
80
80
|
if (htmlChunks.length > 1)
|
|
@@ -110,7 +110,7 @@ class AI extends Helper {
|
|
|
110
110
|
|
|
111
111
|
const messages = [
|
|
112
112
|
{ role: gtpRole.user, content: prompt },
|
|
113
|
-
{ role: gtpRole.user, content: `Within this HTML: ${minifyHtml(html)}` },
|
|
113
|
+
{ role: gtpRole.user, content: `Within this HTML: ${await minifyHtml(html)}` },
|
|
114
114
|
]
|
|
115
115
|
|
|
116
116
|
const response = await this._processAIRequest(messages)
|
package/lib/helper/REST.js
CHANGED
|
@@ -63,6 +63,22 @@ const config = {}
|
|
|
63
63
|
* }
|
|
64
64
|
* ```
|
|
65
65
|
*
|
|
66
|
+
* ```js
|
|
67
|
+
* {
|
|
68
|
+
* helpers: {
|
|
69
|
+
* REST: {
|
|
70
|
+
* endpoint: 'http://site.com/api',
|
|
71
|
+
* prettyPrintJson: true,
|
|
72
|
+
* httpAgent: {
|
|
73
|
+
* ca: fs.readFileSync(__dirname + '/path/to/ca.pem'),
|
|
74
|
+
* rejectUnauthorized: false,
|
|
75
|
+
* keepAlive: true
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
66
82
|
* ## Access From Helpers
|
|
67
83
|
*
|
|
68
84
|
* Send REST requests by accessing `_executeRequest` method:
|
|
@@ -101,9 +117,13 @@ class REST extends Helper {
|
|
|
101
117
|
|
|
102
118
|
// Create an agent with SSL certificate
|
|
103
119
|
if (this.options.httpAgent) {
|
|
104
|
-
if
|
|
120
|
+
// if one of those keys is there, all good to go
|
|
121
|
+
if (this.options.httpAgent.ca || this.options.httpAgent.key || this.options.httpAgent.cert) {
|
|
122
|
+
this.httpsAgent = new Agent(this.options.httpAgent)
|
|
123
|
+
} else {
|
|
124
|
+
// otherwise, throws an error of httpAgent config
|
|
105
125
|
throw Error('Please recheck your httpAgent config!')
|
|
106
|
-
|
|
126
|
+
}
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
this.axios = this.httpsAgent ? axios.create({ httpsAgent: this.httpsAgent }) : axios.create()
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
const ExpectHelper = require('./ExpectHelper')
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
5
|
+
* Unlike traditional assertions that stop the execution on failure,
|
|
6
|
+
* soft assertions allow the execution to continue and report all failures at the end.
|
|
7
|
+
*
|
|
8
|
+
* ### Examples
|
|
9
|
+
*
|
|
10
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* // inside codecept.conf.js
|
|
14
|
+
* {
|
|
15
|
+
* helpers: {
|
|
16
|
+
* Playwright: {...},
|
|
17
|
+
* SoftExpectHelper: {},
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* ```js
|
|
23
|
+
* // in scenario
|
|
24
|
+
* I.softExpectEqual('a', 'b')
|
|
25
|
+
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ## Methods
|
|
29
|
+
*/
|
|
30
|
+
class SoftAssertHelper extends ExpectHelper {
|
|
31
|
+
constructor() {
|
|
32
|
+
super()
|
|
33
|
+
this.errors = []
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Performs a soft assertion by executing the provided assertion function.
|
|
38
|
+
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
39
|
+
*
|
|
40
|
+
* @param {Function} assertionFn - The assertion function to execute.
|
|
41
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
42
|
+
*/
|
|
43
|
+
softAssert(assertionFn, customErrorMsg = '') {
|
|
44
|
+
try {
|
|
45
|
+
assertionFn()
|
|
46
|
+
} catch (error) {
|
|
47
|
+
this.errors.push({ customErrorMsg, error })
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Throws an error if any soft assertions have failed.
|
|
53
|
+
* The error message contains all the accumulated failures.
|
|
54
|
+
*
|
|
55
|
+
* @throws {Error} If there are any soft assertion failures.
|
|
56
|
+
*/
|
|
57
|
+
flushSoftAssertions() {
|
|
58
|
+
if (this.errors.length > 0) {
|
|
59
|
+
let errorMessage = 'Soft assertions failed:\n'
|
|
60
|
+
this.errors.forEach((err, index) => {
|
|
61
|
+
errorMessage += `\n[${index + 1}] ${err.customErrorMsg}\n${err.error.message}\n`
|
|
62
|
+
})
|
|
63
|
+
this.errors = []
|
|
64
|
+
throw new Error(errorMessage)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Softly asserts that two values are equal.
|
|
70
|
+
*
|
|
71
|
+
* @param {*} actualValue - The actual value.
|
|
72
|
+
* @param {*} expectedValue - The expected value.
|
|
73
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
74
|
+
*/
|
|
75
|
+
softExpectEqual(actualValue, expectedValue, customErrorMsg = '') {
|
|
76
|
+
this.softAssert(() => this.expectEqual(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Softly asserts that two values are not equal.
|
|
81
|
+
*
|
|
82
|
+
* @param {*} actualValue - The actual value.
|
|
83
|
+
* @param {*} expectedValue - The expected value.
|
|
84
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
85
|
+
*/
|
|
86
|
+
softExpectNotEqual(actualValue, expectedValue, customErrorMsg = '') {
|
|
87
|
+
this.softAssert(() => this.expectNotEqual(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Softly asserts that two values are deeply equal.
|
|
92
|
+
*
|
|
93
|
+
* @param {*} actualValue - The actual value.
|
|
94
|
+
* @param {*} expectedValue - The expected value.
|
|
95
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
96
|
+
*/
|
|
97
|
+
softExpectDeepEqual(actualValue, expectedValue, customErrorMsg = '') {
|
|
98
|
+
this.softAssert(() => this.expectDeepEqual(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Softly asserts that two values are not deeply equal.
|
|
103
|
+
*
|
|
104
|
+
* @param {*} actualValue - The actual value.
|
|
105
|
+
* @param {*} expectedValue - The expected value.
|
|
106
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
107
|
+
*/
|
|
108
|
+
softExpectNotDeepEqual(actualValue, expectedValue, customErrorMsg = '') {
|
|
109
|
+
this.softAssert(() => this.expectNotDeepEqual(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Softly asserts that a value contains the expected value.
|
|
114
|
+
*
|
|
115
|
+
* @param {*} actualValue - The actual value.
|
|
116
|
+
* @param {*} expectedValueToContain - The value that should be contained within the actual value.
|
|
117
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
118
|
+
*/
|
|
119
|
+
softExpectContain(actualValue, expectedValueToContain, customErrorMsg = '') {
|
|
120
|
+
this.softAssert(() => this.expectContain(actualValue, expectedValueToContain, customErrorMsg), customErrorMsg)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Softly asserts that a value does not contain the expected value.
|
|
125
|
+
*
|
|
126
|
+
* @param {*} actualValue - The actual value.
|
|
127
|
+
* @param {*} expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
128
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
129
|
+
*/
|
|
130
|
+
softExpectNotContain(actualValue, expectedValueToNotContain, customErrorMsg = '') {
|
|
131
|
+
this.softAssert(() => this.expectNotContain(actualValue, expectedValueToNotContain, customErrorMsg), customErrorMsg)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Softly asserts that a value starts with the expected value.
|
|
136
|
+
*
|
|
137
|
+
* @param {*} actualValue - The actual value.
|
|
138
|
+
* @param {*} expectedValueToStartWith - The value that the actual value should start with.
|
|
139
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
140
|
+
*/
|
|
141
|
+
softExpectStartsWith(actualValue, expectedValueToStartWith, customErrorMsg = '') {
|
|
142
|
+
this.softAssert(() => this.expectStartsWith(actualValue, expectedValueToStartWith, customErrorMsg), customErrorMsg)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Softly asserts that a value does not start with the expected value.
|
|
147
|
+
*
|
|
148
|
+
* @param {*} actualValue - The actual value.
|
|
149
|
+
* @param {*} expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
150
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
151
|
+
*/
|
|
152
|
+
softExpectNotStartsWith(actualValue, expectedValueToNotStartWith, customErrorMsg = '') {
|
|
153
|
+
this.softAssert(
|
|
154
|
+
() => this.expectNotStartsWith(actualValue, expectedValueToNotStartWith, customErrorMsg),
|
|
155
|
+
customErrorMsg,
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Softly asserts that a value ends with the expected value.
|
|
161
|
+
*
|
|
162
|
+
* @param {*} actualValue - The actual value.
|
|
163
|
+
* @param {*} expectedValueToEndWith - The value that the actual value should end with.
|
|
164
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
165
|
+
*/
|
|
166
|
+
softExpectEndsWith(actualValue, expectedValueToEndWith, customErrorMsg = '') {
|
|
167
|
+
this.softAssert(() => this.expectEndsWith(actualValue, expectedValueToEndWith, customErrorMsg), customErrorMsg)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Softly asserts that a value does not end with the expected value.
|
|
172
|
+
*
|
|
173
|
+
* @param {*} actualValue - The actual value.
|
|
174
|
+
* @param {*} expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
175
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
176
|
+
*/
|
|
177
|
+
softExpectNotEndsWith(actualValue, expectedValueToNotEndWith, customErrorMsg = '') {
|
|
178
|
+
this.softAssert(
|
|
179
|
+
() => this.expectNotEndsWith(actualValue, expectedValueToNotEndWith, customErrorMsg),
|
|
180
|
+
customErrorMsg,
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Softly asserts that the target data matches the given JSON schema.
|
|
186
|
+
*
|
|
187
|
+
* @param {*} targetData - The data to validate.
|
|
188
|
+
* @param {Object} jsonSchema - The JSON schema to validate against.
|
|
189
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
190
|
+
*/
|
|
191
|
+
softExpectJsonSchema(targetData, jsonSchema, customErrorMsg = '') {
|
|
192
|
+
this.softAssert(() => this.expectJsonSchema(targetData, jsonSchema, customErrorMsg), customErrorMsg)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
197
|
+
*
|
|
198
|
+
* @param {*} targetData - The data to validate.
|
|
199
|
+
* @param {Object} jsonSchema - The JSON schema to validate against.
|
|
200
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
201
|
+
* @param {Object} [ajvOptions={ allErrors: true }] - Options to pass to AJV.
|
|
202
|
+
*/
|
|
203
|
+
softExpectJsonSchemaUsingAJV(targetData, jsonSchema, customErrorMsg = '', ajvOptions = { allErrors: true }) {
|
|
204
|
+
this.softAssert(
|
|
205
|
+
() => this.expectJsonSchemaUsingAJV(targetData, jsonSchema, customErrorMsg, ajvOptions),
|
|
206
|
+
customErrorMsg,
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Softly asserts that the target data has the specified property.
|
|
212
|
+
*
|
|
213
|
+
* @param {*} targetData - The data to check.
|
|
214
|
+
* @param {string} propertyName - The property name to check for.
|
|
215
|
+
* @param {string} [customErrorMsg=''] - A custom error message to display if the assertion
|
|
216
|
+
fails. */ softExpectHasProperty(targetData, propertyName, customErrorMsg = '') {
|
|
217
|
+
this.softAssert(() => this.expectHasProperty(targetData, propertyName, customErrorMsg), customErrorMsg)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
Softly asserts that the target data has a property with the specified name.
|
|
222
|
+
@param {*} targetData - The data to check.
|
|
223
|
+
@param {string} propertyName - The property name to check for.
|
|
224
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails.
|
|
225
|
+
*/
|
|
226
|
+
softExpectHasAProperty(targetData, propertyName, customErrorMsg = '') {
|
|
227
|
+
this.softAssert(() => this.expectHasAProperty(targetData, propertyName, customErrorMsg), customErrorMsg)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
Softly asserts that the target data is of a specific type.
|
|
232
|
+
@param {*} targetData - The data to check.
|
|
233
|
+
@param {string} type - The expected type (e.g., 'string', 'number').
|
|
234
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
235
|
+
softExpectToBeA(targetData, type, customErrorMsg = '') {
|
|
236
|
+
this.softAssert(() => this.expectToBeA(targetData, type, customErrorMsg), customErrorMsg)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
Softly asserts that the target data is of a specific type (alternative for articles).
|
|
241
|
+
@param {*} targetData - The data to check.
|
|
242
|
+
@param {string} type - The expected type (e.g., 'string', 'number').
|
|
243
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
244
|
+
softExpectToBeAn(targetData, type, customErrorMsg = '') {
|
|
245
|
+
this.softAssert(() => this.expectToBeAn(targetData, type, customErrorMsg), customErrorMsg)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/*
|
|
249
|
+
Softly asserts that the target data matches the specified regular expression.
|
|
250
|
+
@param {*} targetData - The data to check.
|
|
251
|
+
@param {RegExp} regex - The regular expression to match.
|
|
252
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
253
|
+
softExpectMatchRegex(targetData, regex, customErrorMsg = '') {
|
|
254
|
+
this.softAssert(() => this.expectMatchRegex(targetData, regex, customErrorMsg), customErrorMsg)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
Softly asserts that the target data has a specified length.
|
|
259
|
+
@param {*} targetData - The data to check.
|
|
260
|
+
@param {number} length - The expected length.
|
|
261
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
262
|
+
softExpectLengthOf(targetData, length, customErrorMsg = '') {
|
|
263
|
+
this.softAssert(() => this.expectLengthOf(targetData, length, customErrorMsg), customErrorMsg)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
|
|
268
|
+
Softly asserts that the target data is empty.
|
|
269
|
+
@param {*} targetData - The data to check.
|
|
270
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
271
|
+
softExpectEmpty(targetData, customErrorMsg = '') {
|
|
272
|
+
this.softAssert(() => this.expectEmpty(targetData, customErrorMsg), customErrorMsg)
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
|
|
277
|
+
Softly asserts that the target data is true.
|
|
278
|
+
@param {*} targetData - The data to check.
|
|
279
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
280
|
+
softExpectTrue(targetData, customErrorMsg = '') {
|
|
281
|
+
this.softAssert(() => this.expectTrue(targetData, customErrorMsg), customErrorMsg)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
|
|
286
|
+
Softly asserts that the target data is false.
|
|
287
|
+
@param {*} targetData - The data to check.
|
|
288
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
289
|
+
softExpectFalse(targetData, customErrorMsg = '') {
|
|
290
|
+
this.softAssert(() => this.expectFalse(targetData, customErrorMsg), customErrorMsg)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
|
|
295
|
+
Softly asserts that the target data is above a specified value.
|
|
296
|
+
@param {*} targetData - The data to check.
|
|
297
|
+
@param {*} aboveThan - The value that the target data should be above.
|
|
298
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
299
|
+
softExpectAbove(targetData, aboveThan, customErrorMsg = '') {
|
|
300
|
+
this.softAssert(() => this.expectAbove(targetData, aboveThan, customErrorMsg), customErrorMsg)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
|
|
305
|
+
Softly asserts that the target data is below a specified value.
|
|
306
|
+
@param {*} targetData - The data to check.
|
|
307
|
+
@param {*} belowThan - The value that the target data should be below.
|
|
308
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
309
|
+
softExpectBelow(targetData, belowThan, customErrorMsg = '') {
|
|
310
|
+
this.softAssert(() => this.expectBelow(targetData, belowThan, customErrorMsg), customErrorMsg)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
|
|
315
|
+
Softly asserts that the length of the target data is above a specified value.
|
|
316
|
+
@param {*} targetData - The data to check.
|
|
317
|
+
@param {number} lengthAboveThan - The length that the target data should be above.
|
|
318
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
319
|
+
softExpectLengthAboveThan(targetData, lengthAboveThan, customErrorMsg = '') {
|
|
320
|
+
this.softAssert(() => this.expectLengthAboveThan(targetData, lengthAboveThan, customErrorMsg), customErrorMsg)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
Softly asserts that the length of the target data is below a specified value.
|
|
325
|
+
@param {*} targetData - The data to check.
|
|
326
|
+
@param {number} lengthBelowThan - The length that the target data should be below.
|
|
327
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
328
|
+
softExpectLengthBelowThan(targetData, lengthBelowThan, customErrorMsg = '') {
|
|
329
|
+
this.softAssert(() => this.expectLengthBelowThan(targetData, lengthBelowThan, customErrorMsg), customErrorMsg)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
Softly asserts that two values are equal, ignoring case.
|
|
334
|
+
@param {string} actualValue - The actual string value.
|
|
335
|
+
@param {string} expectedValue - The expected string value.
|
|
336
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
337
|
+
softExpectEqualIgnoreCase(actualValue, expectedValue, customErrorMsg = '') {
|
|
338
|
+
this.softAssert(() => this.expectEqualIgnoreCase(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
Softly asserts that two arrays have deep equality, considering members in any order.
|
|
343
|
+
@param {Array} actualValue - The actual array.
|
|
344
|
+
@param {Array} expectedValue - The expected array.
|
|
345
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
346
|
+
softExpectDeepMembers(actualValue, expectedValue, customErrorMsg = '') {
|
|
347
|
+
this.softAssert(() => this.expectDeepMembers(actualValue, expectedValue, customErrorMsg), customErrorMsg)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
352
|
+
@param {Array} superset - The array that should contain the expected members.
|
|
353
|
+
@param {Array} set - The array with members that should be included.
|
|
354
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
355
|
+
softExpectDeepIncludeMembers(superset, set, customErrorMsg = '') {
|
|
356
|
+
this.softAssert(() => this.expectDeepIncludeMembers(superset, set, customErrorMsg), customErrorMsg)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
361
|
+
@param {Object} actualValue - The actual object.
|
|
362
|
+
@param {Object} expectedValue - The expected object.
|
|
363
|
+
@param {Array<string>} fieldsToExclude - The fields to exclude from the comparison.
|
|
364
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
365
|
+
softExpectDeepEqualExcluding(actualValue, expectedValue, fieldsToExclude, customErrorMsg = '') {
|
|
366
|
+
this.softAssert(
|
|
367
|
+
() => this.expectDeepEqualExcluding(actualValue, expectedValue, fieldsToExclude, customErrorMsg),
|
|
368
|
+
customErrorMsg,
|
|
369
|
+
)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
Softly asserts that a value matches the expected pattern.
|
|
374
|
+
@param {*} actualValue - The actual value.
|
|
375
|
+
@param {*} expectedPattern - The pattern the value should match.
|
|
376
|
+
@param {string} [customErrorMsg=''] - A custom error message to display if the assertion fails. */
|
|
377
|
+
softExpectMatchesPattern(actualValue, expectedPattern, customErrorMsg = '') {
|
|
378
|
+
this.softAssert(() => this.expectMatchesPattern(actualValue, expectedPattern, customErrorMsg), customErrorMsg)
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
module.exports = SoftAssertHelper
|
package/lib/rerun.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.6.6
|
|
3
|
+
"version": "3.6.6",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@xmldom/xmldom": "0.8.10",
|
|
79
79
|
"acorn": "8.12.1",
|
|
80
80
|
"arrify": "2.0.1",
|
|
81
|
-
"axios": "1.7.
|
|
81
|
+
"axios": "1.7.7",
|
|
82
82
|
"chai": "5.1.1",
|
|
83
83
|
"chai-deep-match": "1.2.1",
|
|
84
84
|
"chai-exclude": "2.1.1",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"lodash.clonedeep": "4.5.0",
|
|
106
106
|
"lodash.merge": "4.6.2",
|
|
107
107
|
"mkdirp": "1.0.4",
|
|
108
|
-
"mocha": "10.
|
|
108
|
+
"mocha": "10.7.3",
|
|
109
109
|
"monocart-coverage-reports": "2.10.3",
|
|
110
110
|
"ms": "2.1.3",
|
|
111
111
|
"ora-classic": "5.4.2",
|
|
@@ -118,16 +118,16 @@
|
|
|
118
118
|
"uuid": "10.0"
|
|
119
119
|
},
|
|
120
120
|
"optionalDependencies": {
|
|
121
|
-
"@codeceptjs/detox-helper": "1.
|
|
121
|
+
"@codeceptjs/detox-helper": "1.1.2"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@codeceptjs/mock-request": "0.3.1",
|
|
125
125
|
"@faker-js/faker": "7.6.0",
|
|
126
126
|
"@pollyjs/adapter-puppeteer": "6.0.6",
|
|
127
127
|
"@pollyjs/core": "5.1.0",
|
|
128
|
-
"@types/chai": "4.3.
|
|
128
|
+
"@types/chai": "4.3.19",
|
|
129
129
|
"@types/inquirer": "9.0.3",
|
|
130
|
-
"@types/node": "
|
|
130
|
+
"@types/node": "22.5.5",
|
|
131
131
|
"@wdio/sauce-service": "9.0.4",
|
|
132
132
|
"@wdio/selenium-standalone-service": "8.3.2",
|
|
133
133
|
"@wdio/utils": "9.0.6",
|
|
@@ -140,19 +140,19 @@
|
|
|
140
140
|
"electron": "31.3.1",
|
|
141
141
|
"eslint": "8.57.0",
|
|
142
142
|
"eslint-config-airbnb-base": "15.0.0",
|
|
143
|
-
"eslint-plugin-import": "2.
|
|
143
|
+
"eslint-plugin-import": "2.30.0",
|
|
144
144
|
"eslint-plugin-mocha": "10.5.0",
|
|
145
145
|
"expect": "29.7.0",
|
|
146
146
|
"express": "4.19.2",
|
|
147
147
|
"graphql": "16.9.0",
|
|
148
|
-
"husky": "9.1.
|
|
148
|
+
"husky": "9.1.5",
|
|
149
149
|
"inquirer-test": "2.0.1",
|
|
150
150
|
"jsdoc": "4.0.3",
|
|
151
151
|
"jsdoc-typeof-plugin": "1.0.0",
|
|
152
152
|
"json-server": "0.10.1",
|
|
153
153
|
"playwright": "1.45.3",
|
|
154
154
|
"prettier": "^3.3.2",
|
|
155
|
-
"puppeteer": "
|
|
155
|
+
"puppeteer": "23.3.0",
|
|
156
156
|
"qrcode-terminal": "0.12.0",
|
|
157
157
|
"rosie": "2.1.1",
|
|
158
158
|
"runok": "0.9.3",
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
"ts-node": "10.9.2",
|
|
165
165
|
"tsd": "^0.31.0",
|
|
166
166
|
"tsd-jsdoc": "2.5.0",
|
|
167
|
-
"typedoc": "0.26.
|
|
167
|
+
"typedoc": "0.26.7",
|
|
168
168
|
"typedoc-plugin-markdown": "4.2.6",
|
|
169
|
-
"typescript": "5.
|
|
169
|
+
"typescript": "5.6.2",
|
|
170
170
|
"wdio-docker-service": "1.5.0",
|
|
171
171
|
"webdriverio": "8.39.1",
|
|
172
172
|
"xml2js": "0.6.2",
|
|
@@ -183,4 +183,4 @@
|
|
|
183
183
|
"strict": false
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
}
|
|
186
|
+
}
|
|
@@ -1180,15 +1180,6 @@ 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
|
|
1190
|
-
// @ts-ignore
|
|
1191
|
-
// @ts-ignore
|
|
1192
1183
|
class ExpectHelper {
|
|
1193
1184
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1194
1185
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1300,15 +1291,6 @@ declare namespace CodeceptJS {
|
|
|
1300
1291
|
*
|
|
1301
1292
|
* ## Methods
|
|
1302
1293
|
*/
|
|
1303
|
-
// @ts-ignore
|
|
1304
|
-
// @ts-ignore
|
|
1305
|
-
// @ts-ignore
|
|
1306
|
-
// @ts-ignore
|
|
1307
|
-
// @ts-ignore
|
|
1308
|
-
// @ts-ignore
|
|
1309
|
-
// @ts-ignore
|
|
1310
|
-
// @ts-ignore
|
|
1311
|
-
// @ts-ignore
|
|
1312
1294
|
class ExpectHelper {
|
|
1313
1295
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1314
1296
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1980,15 +1962,6 @@ declare namespace CodeceptJS {
|
|
|
1980
1962
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
1981
1963
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1982
1964
|
*/
|
|
1983
|
-
// @ts-ignore
|
|
1984
|
-
// @ts-ignore
|
|
1985
|
-
// @ts-ignore
|
|
1986
|
-
// @ts-ignore
|
|
1987
|
-
// @ts-ignore
|
|
1988
|
-
// @ts-ignore
|
|
1989
|
-
// @ts-ignore
|
|
1990
|
-
// @ts-ignore
|
|
1991
|
-
// @ts-ignore
|
|
1992
1965
|
type MockServerConfig = {
|
|
1993
1966
|
port?: number;
|
|
1994
1967
|
host?: string;
|
|
@@ -2113,15 +2086,6 @@ declare namespace CodeceptJS {
|
|
|
2113
2086
|
*
|
|
2114
2087
|
* ## Methods
|
|
2115
2088
|
*/
|
|
2116
|
-
// @ts-ignore
|
|
2117
|
-
// @ts-ignore
|
|
2118
|
-
// @ts-ignore
|
|
2119
|
-
// @ts-ignore
|
|
2120
|
-
// @ts-ignore
|
|
2121
|
-
// @ts-ignore
|
|
2122
|
-
// @ts-ignore
|
|
2123
|
-
// @ts-ignore
|
|
2124
|
-
// @ts-ignore
|
|
2125
2089
|
class MockServer {
|
|
2126
2090
|
/**
|
|
2127
2091
|
* Start the mock server
|
|
@@ -3195,15 +3159,6 @@ declare namespace CodeceptJS {
|
|
|
3195
3159
|
* @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).
|
|
3196
3160
|
* @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).
|
|
3197
3161
|
*/
|
|
3198
|
-
// @ts-ignore
|
|
3199
|
-
// @ts-ignore
|
|
3200
|
-
// @ts-ignore
|
|
3201
|
-
// @ts-ignore
|
|
3202
|
-
// @ts-ignore
|
|
3203
|
-
// @ts-ignore
|
|
3204
|
-
// @ts-ignore
|
|
3205
|
-
// @ts-ignore
|
|
3206
|
-
// @ts-ignore
|
|
3207
3162
|
type PlaywrightConfig = {
|
|
3208
3163
|
url?: string;
|
|
3209
3164
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6580,15 +6535,6 @@ declare namespace CodeceptJS {
|
|
|
6580
6535
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6581
6536
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6582
6537
|
*/
|
|
6583
|
-
// @ts-ignore
|
|
6584
|
-
// @ts-ignore
|
|
6585
|
-
// @ts-ignore
|
|
6586
|
-
// @ts-ignore
|
|
6587
|
-
// @ts-ignore
|
|
6588
|
-
// @ts-ignore
|
|
6589
|
-
// @ts-ignore
|
|
6590
|
-
// @ts-ignore
|
|
6591
|
-
// @ts-ignore
|
|
6592
6538
|
type PuppeteerConfig = {
|
|
6593
6539
|
url: string;
|
|
6594
6540
|
basicAuth?: any;
|
|
@@ -8395,15 +8341,6 @@ declare namespace CodeceptJS {
|
|
|
8395
8341
|
* @property [onResponse] - an async function which can update response object.
|
|
8396
8342
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8397
8343
|
*/
|
|
8398
|
-
// @ts-ignore
|
|
8399
|
-
// @ts-ignore
|
|
8400
|
-
// @ts-ignore
|
|
8401
|
-
// @ts-ignore
|
|
8402
|
-
// @ts-ignore
|
|
8403
|
-
// @ts-ignore
|
|
8404
|
-
// @ts-ignore
|
|
8405
|
-
// @ts-ignore
|
|
8406
|
-
// @ts-ignore
|
|
8407
8344
|
type RESTConfig = {
|
|
8408
8345
|
endpoint?: string;
|
|
8409
8346
|
prettyPrintJson?: boolean;
|
|
@@ -8456,6 +8393,22 @@ declare namespace CodeceptJS {
|
|
|
8456
8393
|
* }
|
|
8457
8394
|
* ```
|
|
8458
8395
|
*
|
|
8396
|
+
* ```js
|
|
8397
|
+
* {
|
|
8398
|
+
* helpers: {
|
|
8399
|
+
* REST: {
|
|
8400
|
+
* endpoint: 'http://site.com/api',
|
|
8401
|
+
* prettyPrintJson: true,
|
|
8402
|
+
* httpAgent: {
|
|
8403
|
+
* ca: fs.readFileSync(__dirname + '/path/to/ca.pem'),
|
|
8404
|
+
* rejectUnauthorized: false,
|
|
8405
|
+
* keepAlive: true
|
|
8406
|
+
* }
|
|
8407
|
+
* }
|
|
8408
|
+
* }
|
|
8409
|
+
* }
|
|
8410
|
+
* ```
|
|
8411
|
+
*
|
|
8459
8412
|
* ## Access From Helpers
|
|
8460
8413
|
*
|
|
8461
8414
|
* Send REST requests by accessing `_executeRequest` method:
|
|
@@ -9766,15 +9719,6 @@ declare namespace CodeceptJS {
|
|
|
9766
9719
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9767
9720
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9768
9721
|
*/
|
|
9769
|
-
// @ts-ignore
|
|
9770
|
-
// @ts-ignore
|
|
9771
|
-
// @ts-ignore
|
|
9772
|
-
// @ts-ignore
|
|
9773
|
-
// @ts-ignore
|
|
9774
|
-
// @ts-ignore
|
|
9775
|
-
// @ts-ignore
|
|
9776
|
-
// @ts-ignore
|
|
9777
|
-
// @ts-ignore
|
|
9778
9722
|
type WebDriverConfig = {
|
|
9779
9723
|
url: string;
|
|
9780
9724
|
browser: string;
|
package/typings/types.d.ts
CHANGED
|
@@ -1204,15 +1204,6 @@ 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
|
|
1214
|
-
// @ts-ignore
|
|
1215
|
-
// @ts-ignore
|
|
1216
1207
|
class ExpectHelper {
|
|
1217
1208
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1218
1209
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -1324,15 +1315,6 @@ declare namespace CodeceptJS {
|
|
|
1324
1315
|
*
|
|
1325
1316
|
* ## Methods
|
|
1326
1317
|
*/
|
|
1327
|
-
// @ts-ignore
|
|
1328
|
-
// @ts-ignore
|
|
1329
|
-
// @ts-ignore
|
|
1330
|
-
// @ts-ignore
|
|
1331
|
-
// @ts-ignore
|
|
1332
|
-
// @ts-ignore
|
|
1333
|
-
// @ts-ignore
|
|
1334
|
-
// @ts-ignore
|
|
1335
|
-
// @ts-ignore
|
|
1336
1318
|
class ExpectHelper {
|
|
1337
1319
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1338
1320
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -2007,15 +1989,6 @@ declare namespace CodeceptJS {
|
|
|
2007
1989
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
2008
1990
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
2009
1991
|
*/
|
|
2010
|
-
// @ts-ignore
|
|
2011
|
-
// @ts-ignore
|
|
2012
|
-
// @ts-ignore
|
|
2013
|
-
// @ts-ignore
|
|
2014
|
-
// @ts-ignore
|
|
2015
|
-
// @ts-ignore
|
|
2016
|
-
// @ts-ignore
|
|
2017
|
-
// @ts-ignore
|
|
2018
|
-
// @ts-ignore
|
|
2019
1992
|
type MockServerConfig = {
|
|
2020
1993
|
port?: number;
|
|
2021
1994
|
host?: string;
|
|
@@ -2140,15 +2113,6 @@ declare namespace CodeceptJS {
|
|
|
2140
2113
|
*
|
|
2141
2114
|
* ## Methods
|
|
2142
2115
|
*/
|
|
2143
|
-
// @ts-ignore
|
|
2144
|
-
// @ts-ignore
|
|
2145
|
-
// @ts-ignore
|
|
2146
|
-
// @ts-ignore
|
|
2147
|
-
// @ts-ignore
|
|
2148
|
-
// @ts-ignore
|
|
2149
|
-
// @ts-ignore
|
|
2150
|
-
// @ts-ignore
|
|
2151
|
-
// @ts-ignore
|
|
2152
2116
|
class MockServer {
|
|
2153
2117
|
/**
|
|
2154
2118
|
* Start the mock server
|
|
@@ -3288,15 +3252,6 @@ declare namespace CodeceptJS {
|
|
|
3288
3252
|
* @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).
|
|
3289
3253
|
* @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).
|
|
3290
3254
|
*/
|
|
3291
|
-
// @ts-ignore
|
|
3292
|
-
// @ts-ignore
|
|
3293
|
-
// @ts-ignore
|
|
3294
|
-
// @ts-ignore
|
|
3295
|
-
// @ts-ignore
|
|
3296
|
-
// @ts-ignore
|
|
3297
|
-
// @ts-ignore
|
|
3298
|
-
// @ts-ignore
|
|
3299
|
-
// @ts-ignore
|
|
3300
3255
|
type PlaywrightConfig = {
|
|
3301
3256
|
url?: string;
|
|
3302
3257
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6824,15 +6779,6 @@ declare namespace CodeceptJS {
|
|
|
6824
6779
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6825
6780
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6826
6781
|
*/
|
|
6827
|
-
// @ts-ignore
|
|
6828
|
-
// @ts-ignore
|
|
6829
|
-
// @ts-ignore
|
|
6830
|
-
// @ts-ignore
|
|
6831
|
-
// @ts-ignore
|
|
6832
|
-
// @ts-ignore
|
|
6833
|
-
// @ts-ignore
|
|
6834
|
-
// @ts-ignore
|
|
6835
|
-
// @ts-ignore
|
|
6836
6782
|
type PuppeteerConfig = {
|
|
6837
6783
|
url: string;
|
|
6838
6784
|
basicAuth?: any;
|
|
@@ -8775,15 +8721,6 @@ declare namespace CodeceptJS {
|
|
|
8775
8721
|
* @property [onResponse] - an async function which can update response object.
|
|
8776
8722
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8777
8723
|
*/
|
|
8778
|
-
// @ts-ignore
|
|
8779
|
-
// @ts-ignore
|
|
8780
|
-
// @ts-ignore
|
|
8781
|
-
// @ts-ignore
|
|
8782
|
-
// @ts-ignore
|
|
8783
|
-
// @ts-ignore
|
|
8784
|
-
// @ts-ignore
|
|
8785
|
-
// @ts-ignore
|
|
8786
|
-
// @ts-ignore
|
|
8787
8724
|
type RESTConfig = {
|
|
8788
8725
|
endpoint?: string;
|
|
8789
8726
|
prettyPrintJson?: boolean;
|
|
@@ -8836,6 +8773,22 @@ declare namespace CodeceptJS {
|
|
|
8836
8773
|
* }
|
|
8837
8774
|
* ```
|
|
8838
8775
|
*
|
|
8776
|
+
* ```js
|
|
8777
|
+
* {
|
|
8778
|
+
* helpers: {
|
|
8779
|
+
* REST: {
|
|
8780
|
+
* endpoint: 'http://site.com/api',
|
|
8781
|
+
* prettyPrintJson: true,
|
|
8782
|
+
* httpAgent: {
|
|
8783
|
+
* ca: fs.readFileSync(__dirname + '/path/to/ca.pem'),
|
|
8784
|
+
* rejectUnauthorized: false,
|
|
8785
|
+
* keepAlive: true
|
|
8786
|
+
* }
|
|
8787
|
+
* }
|
|
8788
|
+
* }
|
|
8789
|
+
* }
|
|
8790
|
+
* ```
|
|
8791
|
+
*
|
|
8839
8792
|
* ## Access From Helpers
|
|
8840
8793
|
*
|
|
8841
8794
|
* Send REST requests by accessing `_executeRequest` method:
|
|
@@ -10206,15 +10159,6 @@ declare namespace CodeceptJS {
|
|
|
10206
10159
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
10207
10160
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
10208
10161
|
*/
|
|
10209
|
-
// @ts-ignore
|
|
10210
|
-
// @ts-ignore
|
|
10211
|
-
// @ts-ignore
|
|
10212
|
-
// @ts-ignore
|
|
10213
|
-
// @ts-ignore
|
|
10214
|
-
// @ts-ignore
|
|
10215
|
-
// @ts-ignore
|
|
10216
|
-
// @ts-ignore
|
|
10217
|
-
// @ts-ignore
|
|
10218
10162
|
type WebDriverConfig = {
|
|
10219
10163
|
url: string;
|
|
10220
10164
|
browser: string;
|
|
@@ -12999,6 +12943,7 @@ declare namespace CodeceptJS {
|
|
|
12999
12943
|
* * `reloadReactNative` - should be enabled for React Native applications.
|
|
13000
12944
|
* * `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app.
|
|
13001
12945
|
* * `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally.
|
|
12946
|
+
* * `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo.
|
|
13002
12947
|
*/
|
|
13003
12948
|
class Detox {
|
|
13004
12949
|
/**
|