codeceptjs 3.7.1-beta.1 → 3.7.2-beta.1

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.
@@ -23,15 +23,23 @@ module.exports = async function (path, options) {
23
23
 
24
24
  if (options.verbose) output.level(3)
25
25
 
26
+ let addGlobalRetries
27
+
28
+ if (config.retry) {
29
+ addGlobalRetries = function retries() {}
30
+ }
31
+
26
32
  output.print('Starting interactive shell for current suite...')
27
33
  recorder.start()
28
34
  event.emit(event.suite.before, {
29
35
  fullTitle: () => 'Interactive Shell',
30
36
  tests: [],
37
+ retries: addGlobalRetries,
31
38
  })
32
39
  event.emit(event.test.before, {
33
40
  title: '',
34
41
  artifacts: {},
42
+ retries: addGlobalRetries,
35
43
  })
36
44
 
37
45
  const enabledHelpers = Container.helpers()
@@ -488,6 +488,9 @@ class WebDriver extends Helper {
488
488
  config.capabilities = config.desiredCapabilities
489
489
  }
490
490
  config.capabilities.browserName = config.browser || config.capabilities.browserName
491
+
492
+ config.capabilities.webSocketUrl = config.webSocketUrl || config.capabilities.webSocketUrl || true
493
+
491
494
  config.capabilities.browserVersion = config.browserVersion || config.capabilities.browserVersion
492
495
  if (config.capabilities.chromeOptions) {
493
496
  config.capabilities['goog:chromeOptions'] = config.capabilities.chromeOptions
@@ -22,7 +22,8 @@ const injectHook = function (inject, suite) {
22
22
  function suiteTestFailedHookError(suite, err, hookName) {
23
23
  suite.eachTest(test => {
24
24
  test.err = err
25
- event.emit(event.test.failed, test, err, ucfirst(hookName))
25
+ if (hookName) hookName = ucfirst(hookName)
26
+ event.emit(event.test.failed, test, err, hookName)
26
27
  })
27
28
  }
28
29
 
@@ -121,7 +122,7 @@ module.exports.injected = function (fn, suite, hookName) {
121
122
  recorder.session.start('teardown')
122
123
  recorder.cleanAsyncErr()
123
124
  if (hookName == 'before' || hookName == 'beforeSuite') suiteTestFailedHookError(suite, err, hookName)
124
- if (hookName === 'after') event.emit(event.test.after, suite)
125
+ if (hookName === 'after') suite.eachTest(test => event.emit(event.test.after, test))
125
126
  if (hookName === 'afterSuite') event.emit(event.suite.after, suite)
126
127
  recorder.add(() => doneFn(err))
127
128
  }
@@ -52,13 +52,13 @@ const defaultConfig = {
52
52
  *
53
53
  */
54
54
  module.exports = function (config) {
55
- supportedHelpers.push('REST')
55
+ const affectedHelpers = [...standardActingHelpers, 'REST']
56
56
  const helpers = Container.helpers()
57
57
  let helper
58
58
 
59
59
  config = Object.assign(defaultConfig, config)
60
60
 
61
- for (const helperName of supportedHelpers) {
61
+ for (const helperName of affectedHelpers) {
62
62
  if (Object.keys(helpers).indexOf(helperName) > -1) {
63
63
  helper = helpers[helperName]
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.1-beta.1",
3
+ "version": "3.7.2-beta.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -101,12 +101,12 @@
101
101
  "inquirer": "8.2.6",
102
102
  "invisi-data": "^1.0.0",
103
103
  "joi": "17.13.3",
104
- "js-beautify": "1.15.1",
104
+ "js-beautify": "1.15.2",
105
105
  "lodash.clonedeep": "4.5.0",
106
106
  "lodash.merge": "4.6.2",
107
107
  "mkdirp": "3.0.1",
108
108
  "mocha": "11.1.0",
109
- "monocart-coverage-reports": "2.12.0",
109
+ "monocart-coverage-reports": "2.12.1",
110
110
  "ms": "2.1.3",
111
111
  "ora-classic": "5.4.2",
112
112
  "parse-function": "5.6.10",
@@ -159,15 +159,15 @@
159
159
  "qrcode-terminal": "0.12.0",
160
160
  "rosie": "2.1.1",
161
161
  "runok": "0.9.3",
162
- "semver": "7.7.0",
162
+ "semver": "7.7.1",
163
163
  "sinon": "19.0.2",
164
164
  "sinon-chai": "3.7.0",
165
165
  "testcafe": "3.7.1",
166
- "ts-morph": "25.0.0",
166
+ "ts-morph": "25.0.1",
167
167
  "ts-node": "10.9.2",
168
168
  "tsd": "^0.31.0",
169
169
  "tsd-jsdoc": "2.5.0",
170
- "typedoc": "0.27.6",
170
+ "typedoc": "0.27.7",
171
171
  "typedoc-plugin-markdown": "4.4.1",
172
172
  "typescript": "5.7.3",
173
173
  "wdio-docker-service": "3.2.1",
@@ -1198,6 +1198,9 @@ declare namespace CodeceptJS {
1198
1198
  *
1199
1199
  * ## Methods
1200
1200
  */
1201
+ // @ts-ignore
1202
+ // @ts-ignore
1203
+ // @ts-ignore
1201
1204
  class ExpectHelper {
1202
1205
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1203
1206
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
@@ -1309,6 +1312,9 @@ declare namespace CodeceptJS {
1309
1312
  *
1310
1313
  * ## Methods
1311
1314
  */
1315
+ // @ts-ignore
1316
+ // @ts-ignore
1317
+ // @ts-ignore
1312
1318
  class ExpectHelper {
1313
1319
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1314
1320
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
@@ -1981,6 +1987,9 @@ declare namespace CodeceptJS {
1981
1987
  * @property [host = "0.0.0.0"] - Mock server host
1982
1988
  * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1983
1989
  */
1990
+ // @ts-ignore
1991
+ // @ts-ignore
1992
+ // @ts-ignore
1984
1993
  type MockServerConfig = {
1985
1994
  port?: number;
1986
1995
  host?: string;
@@ -2105,6 +2114,9 @@ declare namespace CodeceptJS {
2105
2114
  *
2106
2115
  * ## Methods
2107
2116
  */
2117
+ // @ts-ignore
2118
+ // @ts-ignore
2119
+ // @ts-ignore
2108
2120
  class MockServer {
2109
2121
  /**
2110
2122
  * Start the mock server
@@ -3178,6 +3190,9 @@ declare namespace CodeceptJS {
3178
3190
  * @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).
3179
3191
  * @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).
3180
3192
  */
3193
+ // @ts-ignore
3194
+ // @ts-ignore
3195
+ // @ts-ignore
3181
3196
  type PlaywrightConfig = {
3182
3197
  url?: string;
3183
3198
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6554,6 +6569,9 @@ declare namespace CodeceptJS {
6554
6569
  * @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
6555
6570
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
6556
6571
  */
6572
+ // @ts-ignore
6573
+ // @ts-ignore
6574
+ // @ts-ignore
6557
6575
  type PuppeteerConfig = {
6558
6576
  url: string;
6559
6577
  basicAuth?: any;
@@ -8360,6 +8378,9 @@ declare namespace CodeceptJS {
8360
8378
  * @property [onResponse] - an async function which can update response object.
8361
8379
  * @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
8362
8380
  */
8381
+ // @ts-ignore
8382
+ // @ts-ignore
8383
+ // @ts-ignore
8363
8384
  type RESTConfig = {
8364
8385
  endpoint?: string;
8365
8386
  prettyPrintJson?: boolean;
@@ -9748,6 +9769,9 @@ declare namespace CodeceptJS {
9748
9769
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9749
9770
  * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9750
9771
  */
9772
+ // @ts-ignore
9773
+ // @ts-ignore
9774
+ // @ts-ignore
9751
9775
  type WebDriverConfig = {
9752
9776
  url: string;
9753
9777
  browser: string;
@@ -1222,6 +1222,9 @@ declare namespace CodeceptJS {
1222
1222
  *
1223
1223
  * ## Methods
1224
1224
  */
1225
+ // @ts-ignore
1226
+ // @ts-ignore
1227
+ // @ts-ignore
1225
1228
  class ExpectHelper {
1226
1229
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1227
1230
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
@@ -1333,6 +1336,9 @@ declare namespace CodeceptJS {
1333
1336
  *
1334
1337
  * ## Methods
1335
1338
  */
1339
+ // @ts-ignore
1340
+ // @ts-ignore
1341
+ // @ts-ignore
1336
1342
  class ExpectHelper {
1337
1343
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1338
1344
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
@@ -2008,6 +2014,9 @@ declare namespace CodeceptJS {
2008
2014
  * @property [host = "0.0.0.0"] - Mock server host
2009
2015
  * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
2010
2016
  */
2017
+ // @ts-ignore
2018
+ // @ts-ignore
2019
+ // @ts-ignore
2011
2020
  type MockServerConfig = {
2012
2021
  port?: number;
2013
2022
  host?: string;
@@ -2132,6 +2141,9 @@ declare namespace CodeceptJS {
2132
2141
  *
2133
2142
  * ## Methods
2134
2143
  */
2144
+ // @ts-ignore
2145
+ // @ts-ignore
2146
+ // @ts-ignore
2135
2147
  class MockServer {
2136
2148
  /**
2137
2149
  * Start the mock server
@@ -3271,6 +3283,9 @@ declare namespace CodeceptJS {
3271
3283
  * @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).
3272
3284
  * @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).
3273
3285
  */
3286
+ // @ts-ignore
3287
+ // @ts-ignore
3288
+ // @ts-ignore
3274
3289
  type PlaywrightConfig = {
3275
3290
  url?: string;
3276
3291
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6798,6 +6813,9 @@ declare namespace CodeceptJS {
6798
6813
  * @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
6799
6814
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
6800
6815
  */
6816
+ // @ts-ignore
6817
+ // @ts-ignore
6818
+ // @ts-ignore
6801
6819
  type PuppeteerConfig = {
6802
6820
  url: string;
6803
6821
  basicAuth?: any;
@@ -8740,6 +8758,9 @@ declare namespace CodeceptJS {
8740
8758
  * @property [onResponse] - an async function which can update response object.
8741
8759
  * @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
8742
8760
  */
8761
+ // @ts-ignore
8762
+ // @ts-ignore
8763
+ // @ts-ignore
8743
8764
  type RESTConfig = {
8744
8765
  endpoint?: string;
8745
8766
  prettyPrintJson?: boolean;
@@ -10188,6 +10209,9 @@ declare namespace CodeceptJS {
10188
10209
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
10189
10210
  * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
10190
10211
  */
10212
+ // @ts-ignore
10213
+ // @ts-ignore
10214
+ // @ts-ignore
10191
10215
  type WebDriverConfig = {
10192
10216
  url: string;
10193
10217
  browser: string;