codeceptjs 4.0.0-beta.4 → 4.0.0-beta.6.esm-aria

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.
Files changed (188) hide show
  1. package/README.md +89 -119
  2. package/bin/codecept.js +53 -54
  3. package/docs/webapi/clearCookie.mustache +1 -1
  4. package/lib/actor.js +70 -102
  5. package/lib/ai.js +131 -121
  6. package/lib/assert/empty.js +11 -12
  7. package/lib/assert/equal.js +16 -21
  8. package/lib/assert/error.js +2 -2
  9. package/lib/assert/include.js +11 -15
  10. package/lib/assert/throws.js +3 -5
  11. package/lib/assert/truth.js +10 -7
  12. package/lib/assert.js +18 -18
  13. package/lib/codecept.js +112 -101
  14. package/lib/colorUtils.js +48 -50
  15. package/lib/command/check.js +206 -0
  16. package/lib/command/configMigrate.js +13 -14
  17. package/lib/command/definitions.js +24 -36
  18. package/lib/command/dryRun.js +16 -16
  19. package/lib/command/generate.js +38 -39
  20. package/lib/command/gherkin/init.js +36 -38
  21. package/lib/command/gherkin/snippets.js +76 -74
  22. package/lib/command/gherkin/steps.js +21 -18
  23. package/lib/command/info.js +49 -15
  24. package/lib/command/init.js +41 -37
  25. package/lib/command/interactive.js +22 -13
  26. package/lib/command/list.js +11 -10
  27. package/lib/command/run-multiple/chunk.js +50 -47
  28. package/lib/command/run-multiple/collection.js +5 -5
  29. package/lib/command/run-multiple/run.js +3 -3
  30. package/lib/command/run-multiple.js +27 -47
  31. package/lib/command/run-rerun.js +6 -7
  32. package/lib/command/run-workers.js +15 -66
  33. package/lib/command/run.js +8 -8
  34. package/lib/command/utils.js +22 -21
  35. package/lib/command/workers/runTests.js +131 -241
  36. package/lib/config.js +111 -49
  37. package/lib/container.js +589 -244
  38. package/lib/data/context.js +16 -18
  39. package/lib/data/dataScenarioConfig.js +9 -9
  40. package/lib/data/dataTableArgument.js +7 -7
  41. package/lib/data/table.js +6 -12
  42. package/lib/effects.js +307 -0
  43. package/lib/els.js +160 -0
  44. package/lib/event.js +24 -19
  45. package/lib/globals.js +141 -0
  46. package/lib/heal.js +89 -81
  47. package/lib/helper/AI.js +3 -2
  48. package/lib/helper/ApiDataFactory.js +19 -19
  49. package/lib/helper/Appium.js +47 -51
  50. package/lib/helper/FileSystem.js +35 -15
  51. package/lib/helper/GraphQL.js +1 -1
  52. package/lib/helper/GraphQLDataFactory.js +4 -4
  53. package/lib/helper/JSONResponse.js +72 -45
  54. package/lib/helper/Mochawesome.js +14 -11
  55. package/lib/helper/Playwright.js +832 -434
  56. package/lib/helper/Puppeteer.js +393 -292
  57. package/lib/helper/REST.js +32 -27
  58. package/lib/helper/WebDriver.js +320 -219
  59. package/lib/helper/errors/ConnectionRefused.js +6 -6
  60. package/lib/helper/errors/ElementAssertion.js +11 -16
  61. package/lib/helper/errors/ElementNotFound.js +5 -9
  62. package/lib/helper/errors/RemoteBrowserConnectionRefused.js +5 -5
  63. package/lib/helper/extras/Console.js +11 -11
  64. package/lib/helper/extras/PlaywrightLocator.js +110 -0
  65. package/lib/helper/extras/PlaywrightPropEngine.js +18 -18
  66. package/lib/helper/extras/PlaywrightRestartOpts.js +23 -23
  67. package/lib/helper/extras/Popup.js +22 -22
  68. package/lib/helper/extras/React.js +29 -30
  69. package/lib/helper/network/actions.js +33 -48
  70. package/lib/helper/network/utils.js +76 -83
  71. package/lib/helper/scripts/blurElement.js +6 -6
  72. package/lib/helper/scripts/focusElement.js +6 -6
  73. package/lib/helper/scripts/highlightElement.js +9 -9
  74. package/lib/helper/scripts/isElementClickable.js +34 -34
  75. package/lib/helper.js +2 -1
  76. package/lib/history.js +23 -20
  77. package/lib/hooks.js +10 -10
  78. package/lib/html.js +90 -100
  79. package/lib/index.js +48 -21
  80. package/lib/listener/config.js +8 -9
  81. package/lib/listener/emptyRun.js +54 -0
  82. package/lib/listener/exit.js +10 -12
  83. package/lib/listener/{retry.js → globalRetry.js} +10 -10
  84. package/lib/listener/globalTimeout.js +166 -0
  85. package/lib/listener/helpers.js +43 -24
  86. package/lib/listener/mocha.js +4 -5
  87. package/lib/listener/result.js +11 -0
  88. package/lib/listener/steps.js +26 -23
  89. package/lib/listener/store.js +20 -0
  90. package/lib/locator.js +213 -192
  91. package/lib/mocha/asyncWrapper.js +264 -0
  92. package/lib/mocha/bdd.js +167 -0
  93. package/lib/mocha/cli.js +341 -0
  94. package/lib/mocha/factory.js +160 -0
  95. package/lib/{interfaces → mocha}/featureConfig.js +33 -13
  96. package/lib/{interfaces → mocha}/gherkin.js +75 -45
  97. package/lib/mocha/hooks.js +121 -0
  98. package/lib/mocha/index.js +21 -0
  99. package/lib/mocha/inject.js +46 -0
  100. package/lib/{interfaces → mocha}/scenarioConfig.js +32 -8
  101. package/lib/mocha/suite.js +89 -0
  102. package/lib/mocha/test.js +178 -0
  103. package/lib/mocha/types.d.ts +42 -0
  104. package/lib/mocha/ui.js +229 -0
  105. package/lib/output.js +86 -64
  106. package/lib/parser.js +44 -44
  107. package/lib/pause.js +160 -139
  108. package/lib/plugin/analyze.js +403 -0
  109. package/lib/plugin/{autoLogin.js → auth.js} +137 -43
  110. package/lib/plugin/autoDelay.js +19 -15
  111. package/lib/plugin/coverage.js +22 -27
  112. package/lib/plugin/customLocator.js +5 -5
  113. package/lib/plugin/customReporter.js +53 -0
  114. package/lib/plugin/heal.js +49 -17
  115. package/lib/plugin/pageInfo.js +140 -0
  116. package/lib/plugin/pauseOnFail.js +4 -3
  117. package/lib/plugin/retryFailedStep.js +60 -19
  118. package/lib/plugin/screenshotOnFail.js +80 -83
  119. package/lib/plugin/stepByStepReport.js +70 -31
  120. package/lib/plugin/stepTimeout.js +7 -13
  121. package/lib/plugin/subtitles.js +10 -9
  122. package/lib/recorder.js +167 -126
  123. package/lib/rerun.js +94 -50
  124. package/lib/result.js +161 -0
  125. package/lib/secret.js +18 -17
  126. package/lib/session.js +95 -89
  127. package/lib/step/base.js +239 -0
  128. package/lib/step/comment.js +10 -0
  129. package/lib/step/config.js +50 -0
  130. package/lib/step/func.js +46 -0
  131. package/lib/step/helper.js +50 -0
  132. package/lib/step/meta.js +99 -0
  133. package/lib/step/record.js +74 -0
  134. package/lib/step/retry.js +11 -0
  135. package/lib/step/section.js +55 -0
  136. package/lib/step.js +18 -332
  137. package/lib/steps.js +54 -0
  138. package/lib/store.js +37 -5
  139. package/lib/template/heal.js +2 -11
  140. package/lib/timeout.js +60 -0
  141. package/lib/transform.js +8 -8
  142. package/lib/translation.js +32 -18
  143. package/lib/utils.js +354 -250
  144. package/lib/workerStorage.js +16 -16
  145. package/lib/workers.js +366 -282
  146. package/package.json +107 -95
  147. package/translations/de-DE.js +5 -4
  148. package/translations/fr-FR.js +5 -4
  149. package/translations/index.js +23 -9
  150. package/translations/it-IT.js +5 -4
  151. package/translations/ja-JP.js +5 -4
  152. package/translations/nl-NL.js +76 -0
  153. package/translations/pl-PL.js +5 -4
  154. package/translations/pt-BR.js +5 -4
  155. package/translations/ru-RU.js +5 -4
  156. package/translations/utils.js +18 -0
  157. package/translations/zh-CN.js +5 -4
  158. package/translations/zh-TW.js +5 -4
  159. package/typings/index.d.ts +177 -186
  160. package/typings/promiseBasedTypes.d.ts +3573 -5941
  161. package/typings/types.d.ts +4042 -6370
  162. package/lib/cli.js +0 -256
  163. package/lib/helper/ExpectHelper.js +0 -391
  164. package/lib/helper/Nightmare.js +0 -1504
  165. package/lib/helper/Protractor.js +0 -1863
  166. package/lib/helper/SoftExpectHelper.js +0 -381
  167. package/lib/helper/TestCafe.js +0 -1414
  168. package/lib/helper/clientscripts/nightmare.js +0 -213
  169. package/lib/helper/extras/PlaywrightReactVueLocator.js +0 -43
  170. package/lib/helper/testcafe/testControllerHolder.js +0 -42
  171. package/lib/helper/testcafe/testcafe-utils.js +0 -62
  172. package/lib/interfaces/bdd.js +0 -81
  173. package/lib/listener/artifacts.js +0 -19
  174. package/lib/listener/timeout.js +0 -109
  175. package/lib/mochaFactory.js +0 -113
  176. package/lib/plugin/allure.js +0 -15
  177. package/lib/plugin/commentStep.js +0 -136
  178. package/lib/plugin/debugErrors.js +0 -67
  179. package/lib/plugin/eachElement.js +0 -127
  180. package/lib/plugin/fakerTransform.js +0 -49
  181. package/lib/plugin/retryTo.js +0 -127
  182. package/lib/plugin/selenoid.js +0 -384
  183. package/lib/plugin/standardActingHelpers.js +0 -3
  184. package/lib/plugin/tryTo.js +0 -115
  185. package/lib/plugin/wdio.js +0 -249
  186. package/lib/scenario.js +0 -224
  187. package/lib/ui.js +0 -236
  188. package/lib/within.js +0 -70
@@ -1,381 +0,0 @@
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