codeceptjs 4.0.0-beta.7.esm-aria → 4.0.0-beta.9.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 (68) hide show
  1. package/README.md +46 -3
  2. package/bin/codecept.js +9 -0
  3. package/bin/test-server.js +64 -0
  4. package/docs/webapi/click.mustache +5 -1
  5. package/lib/ai.js +66 -102
  6. package/lib/codecept.js +99 -24
  7. package/lib/command/generate.js +33 -1
  8. package/lib/command/init.js +7 -3
  9. package/lib/command/run-workers.js +31 -2
  10. package/lib/command/run.js +15 -0
  11. package/lib/command/workers/runTests.js +331 -58
  12. package/lib/config.js +16 -5
  13. package/lib/container.js +15 -13
  14. package/lib/effects.js +1 -1
  15. package/lib/element/WebElement.js +327 -0
  16. package/lib/event.js +10 -1
  17. package/lib/helper/AI.js +11 -11
  18. package/lib/helper/ApiDataFactory.js +34 -6
  19. package/lib/helper/Appium.js +156 -42
  20. package/lib/helper/GraphQL.js +3 -3
  21. package/lib/helper/GraphQLDataFactory.js +4 -4
  22. package/lib/helper/JSONResponse.js +48 -40
  23. package/lib/helper/Mochawesome.js +24 -2
  24. package/lib/helper/Playwright.js +841 -153
  25. package/lib/helper/Puppeteer.js +263 -67
  26. package/lib/helper/REST.js +21 -0
  27. package/lib/helper/WebDriver.js +105 -16
  28. package/lib/helper/clientscripts/PollyWebDriverExt.js +1 -1
  29. package/lib/helper/extras/PlaywrightReactVueLocator.js +52 -0
  30. package/lib/helper/extras/PlaywrightRestartOpts.js +12 -1
  31. package/lib/helper/network/actions.js +8 -6
  32. package/lib/listener/config.js +11 -3
  33. package/lib/listener/enhancedGlobalRetry.js +110 -0
  34. package/lib/listener/globalTimeout.js +19 -4
  35. package/lib/listener/helpers.js +8 -2
  36. package/lib/listener/retryEnhancer.js +85 -0
  37. package/lib/listener/steps.js +12 -0
  38. package/lib/mocha/asyncWrapper.js +13 -3
  39. package/lib/mocha/cli.js +1 -1
  40. package/lib/mocha/factory.js +3 -0
  41. package/lib/mocha/gherkin.js +1 -1
  42. package/lib/mocha/test.js +6 -0
  43. package/lib/mocha/ui.js +13 -0
  44. package/lib/output.js +62 -18
  45. package/lib/plugin/coverage.js +16 -3
  46. package/lib/plugin/enhancedRetryFailedStep.js +99 -0
  47. package/lib/plugin/htmlReporter.js +3648 -0
  48. package/lib/plugin/retryFailedStep.js +1 -0
  49. package/lib/plugin/stepByStepReport.js +1 -1
  50. package/lib/recorder.js +28 -3
  51. package/lib/result.js +100 -23
  52. package/lib/retryCoordinator.js +207 -0
  53. package/lib/step/base.js +1 -1
  54. package/lib/step/comment.js +2 -2
  55. package/lib/step/meta.js +1 -1
  56. package/lib/template/heal.js +1 -1
  57. package/lib/template/prompts/generatePageObject.js +31 -0
  58. package/lib/template/prompts/healStep.js +13 -0
  59. package/lib/template/prompts/writeStep.js +9 -0
  60. package/lib/test-server.js +334 -0
  61. package/lib/utils/mask_data.js +47 -0
  62. package/lib/utils.js +87 -6
  63. package/lib/workerStorage.js +2 -1
  64. package/lib/workers.js +179 -23
  65. package/package.json +59 -47
  66. package/typings/index.d.ts +19 -7
  67. package/typings/promiseBasedTypes.d.ts +5534 -3764
  68. package/typings/types.d.ts +5789 -3775
package/lib/workers.js CHANGED
@@ -54,16 +54,37 @@ const populateGroups = numberOfWorkers => {
54
54
  return groups
55
55
  }
56
56
 
57
- const createWorker = workerObject => {
57
+ const createWorker = (workerObject, isPoolMode = false) => {
58
58
  const worker = new Worker(pathToWorker, {
59
59
  workerData: {
60
60
  options: simplifyObject(workerObject.options),
61
61
  tests: workerObject.tests,
62
62
  testRoot: workerObject.testRoot,
63
63
  workerIndex: workerObject.workerIndex + 1,
64
+ poolMode: isPoolMode,
64
65
  },
66
+ stdout: true,
67
+ stderr: true,
68
+ })
69
+
70
+ // Pipe worker stdout/stderr to main process
71
+ if (worker.stdout) {
72
+ worker.stdout.setEncoding('utf8')
73
+ worker.stdout.on('data', (data) => {
74
+ process.stdout.write(data)
75
+ })
76
+ }
77
+ if (worker.stderr) {
78
+ worker.stderr.setEncoding('utf8')
79
+ worker.stderr.on('data', (data) => {
80
+ process.stderr.write(data)
81
+ })
82
+ }
83
+
84
+ worker.on('error', err => {
85
+ console.error(`[Main] Worker Error:`, err)
86
+ output.error(`Worker Error: ${err.stack}`)
65
87
  })
66
- worker.on('error', err => output.error(`Worker Error: ${err.stack}`))
67
88
 
68
89
  WorkerStorage.addWorker(worker)
69
90
  return worker
@@ -200,9 +221,31 @@ class WorkerObject {
200
221
 
201
222
  addConfig(config) {
202
223
  const oldConfig = JSON.parse(this.options.override || '{}')
224
+
225
+ // Remove customLocatorStrategies from both old and new config before JSON serialization
226
+ // since functions cannot be serialized and will be lost, causing workers to have empty strategies
227
+ const configWithoutFunctions = { ...config }
228
+
229
+ // Clean both old and new config
230
+ const cleanConfig = (cfg) => {
231
+ if (cfg.helpers) {
232
+ cfg.helpers = { ...cfg.helpers }
233
+ Object.keys(cfg.helpers).forEach(helperName => {
234
+ if (cfg.helpers[helperName] && cfg.helpers[helperName].customLocatorStrategies !== undefined) {
235
+ cfg.helpers[helperName] = { ...cfg.helpers[helperName] }
236
+ delete cfg.helpers[helperName].customLocatorStrategies
237
+ }
238
+ })
239
+ }
240
+ return cfg
241
+ }
242
+
243
+ const cleanedOldConfig = cleanConfig(oldConfig)
244
+ const cleanedNewConfig = cleanConfig(configWithoutFunctions)
245
+
203
246
  const newConfig = {
204
- ...oldConfig,
205
- ...config,
247
+ ...cleanedOldConfig,
248
+ ...cleanedNewConfig,
206
249
  }
207
250
  this.options.override = JSON.stringify(newConfig)
208
251
  }
@@ -237,15 +280,19 @@ class Workers extends EventEmitter {
237
280
  this.setMaxListeners(50)
238
281
  this.codeceptPromise = initializeCodecept(config.testConfig, config.options)
239
282
  this.codecept = null
283
+ this.config = config // Save config
284
+ this.numberOfWorkersRequested = numberOfWorkers // Save requested worker count
285
+ this.options = config.options || {}
240
286
  this.errors = []
241
287
  this.numberOfWorkers = 0
242
288
  this.closedWorkers = 0
243
289
  this.workers = []
244
290
  this.testGroups = []
245
- this.config = config
246
- this.numberOfWorkersRequested = numberOfWorkers
247
- // Track emitted pass events to avoid double-counting duplicates from retries/race conditions
248
- this._passedUids = new Set()
291
+ this.testPool = []
292
+ this.testPoolInitialized = false
293
+ this.isPoolMode = config.by === 'pool'
294
+ this.activeWorkers = new Map()
295
+ this.maxWorkers = numberOfWorkers // Track original worker count for pool mode
249
296
 
250
297
  createOutputDir(config.testConfig)
251
298
  // Defer worker initialization until codecept is ready
@@ -284,6 +331,7 @@ class Workers extends EventEmitter {
284
331
  *
285
332
  * - `suite`
286
333
  * - `test`
334
+ * - `pool`
287
335
  * - function(numberOfWorkers)
288
336
  *
289
337
  * This method can be overridden for a better split.
@@ -299,7 +347,11 @@ class Workers extends EventEmitter {
299
347
  this.testGroups.push(convertToMochaTests(testGroup))
300
348
  }
301
349
  } else if (typeof numberOfWorkers === 'number' && numberOfWorkers > 0) {
302
- this.testGroups = config.by === 'suite' ? this.createGroupsOfSuites(numberOfWorkers) : this.createGroupsOfTests(numberOfWorkers)
350
+ if (config.by === 'pool') {
351
+ this.createTestPool(numberOfWorkers)
352
+ } else {
353
+ this.testGroups = config.by === 'suite' ? this.createGroupsOfSuites(numberOfWorkers) : this.createGroupsOfTests(numberOfWorkers)
354
+ }
303
355
  }
304
356
  }
305
357
 
@@ -339,6 +391,62 @@ class Workers extends EventEmitter {
339
391
  return groups
340
392
  }
341
393
 
394
+ /**
395
+ * @param {Number} numberOfWorkers
396
+ */
397
+ createTestPool(numberOfWorkers) {
398
+ // For pool mode, create empty groups for each worker and initialize empty pool
399
+ // Test pool will be populated lazily when getNextTest() is first called
400
+ this.testPool = []
401
+ this.testPoolInitialized = false
402
+ this.testGroups = populateGroups(numberOfWorkers)
403
+ }
404
+
405
+ /**
406
+ * Initialize the test pool if not already done
407
+ * This is called lazily to avoid state pollution issues during construction
408
+ */
409
+ _initializeTestPool() {
410
+ if (this.testPoolInitialized) {
411
+ return
412
+ }
413
+
414
+ // Ensure codecept is initialized
415
+ if (!this.codecept) {
416
+ output.log('Warning: codecept not initialized when initializing test pool')
417
+ this.testPoolInitialized = true
418
+ return
419
+ }
420
+
421
+ const files = this.codecept.testFiles
422
+ if (!files || files.length === 0) {
423
+ this.testPoolInitialized = true
424
+ return
425
+ }
426
+
427
+ // In ESM, test UIDs are not stable across different mocha instances
428
+ // So instead of using UIDs, we distribute test FILES
429
+ // Each file may contain multiple tests
430
+ for (const file of files) {
431
+ this.testPool.push(file)
432
+ }
433
+
434
+ this.testPoolInitialized = true
435
+ }
436
+
437
+ /**
438
+ * Gets the next test from the pool
439
+ * @returns {String|null} test file path or null if no tests available
440
+ */
441
+ getNextTest() {
442
+ // Lazy initialization of test pool on first call
443
+ if (!this.testPoolInitialized) {
444
+ this._initializeTestPool()
445
+ }
446
+
447
+ return this.testPool.shift()
448
+ }
449
+
342
450
  /**
343
451
  * @param {Number} numberOfWorkers
344
452
  */
@@ -386,12 +494,20 @@ class Workers extends EventEmitter {
386
494
  recorder.startUnlessRunning()
387
495
  event.dispatcher.emit(event.workers.before)
388
496
  process.env.RUNS_WITH_WORKERS = 'true'
389
- recorder.add('starting workers', () => {
390
- for (const worker of this.workers) {
391
- const workerThread = createWorker(worker)
392
- this._listenWorkerEvents(workerThread)
393
- }
497
+
498
+ // Create workers and set up message handlers immediately (not in recorder queue)
499
+ // This prevents a race condition where workers start sending messages before handlers are attached
500
+ const workerThreads = []
501
+ for (const worker of this.workers) {
502
+ const workerThread = createWorker(worker, this.isPoolMode)
503
+ this._listenWorkerEvents(workerThread)
504
+ workerThreads.push(workerThread)
505
+ }
506
+
507
+ recorder.add('workers started', () => {
508
+ // Workers are already running, this is just a placeholder step
394
509
  })
510
+
395
511
  return new Promise(resolve => {
396
512
  this.on('end', resolve)
397
513
  })
@@ -412,9 +528,27 @@ class Workers extends EventEmitter {
412
528
  }
413
529
 
414
530
  _listenWorkerEvents(worker) {
531
+ // Track worker thread for pool mode
532
+ if (this.isPoolMode) {
533
+ this.activeWorkers.set(worker, { available: true, workerIndex: null })
534
+ }
535
+
415
536
  worker.on('message', message => {
416
537
  output.process(message.workerIndex)
417
538
 
539
+ // Handle test requests for pool mode
540
+ if (message.type === 'REQUEST_TEST') {
541
+ if (this.isPoolMode) {
542
+ const nextTest = this.getNextTest()
543
+ if (nextTest) {
544
+ worker.postMessage({ type: 'TEST_ASSIGNED', test: nextTest })
545
+ } else {
546
+ worker.postMessage({ type: 'NO_MORE_TESTS' })
547
+ }
548
+ }
549
+ return
550
+ }
551
+
418
552
  // deal with events that are not test cycle related
419
553
  if (!message.event) {
420
554
  return this.emit('message', message)
@@ -423,11 +557,21 @@ class Workers extends EventEmitter {
423
557
  switch (message.event) {
424
558
  case event.all.result:
425
559
  // we ensure consistency of result by adding tests in the very end
426
- Container.result().addFailures(message.data.failures)
427
- Container.result().addStats(message.data.stats)
428
- message.data.tests.forEach(test => {
429
- Container.result().addTest(deserializeTest(test))
430
- })
560
+ // Check if message.data.stats is valid before adding
561
+ if (message.data.stats) {
562
+ Container.result().addStats(message.data.stats)
563
+ }
564
+
565
+ if (message.data.failures) {
566
+ Container.result().addFailures(message.data.failures)
567
+ }
568
+
569
+ if (message.data.tests) {
570
+ message.data.tests.forEach(test => {
571
+ Container.result().addTest(deserializeTest(test))
572
+ })
573
+ }
574
+
431
575
  break
432
576
  case event.suite.before:
433
577
  this.emit(event.suite.before, deserializeSuite(message.data))
@@ -439,7 +583,12 @@ class Workers extends EventEmitter {
439
583
  this.emit(event.test.started, deserializeTest(message.data))
440
584
  break
441
585
  case event.test.failed:
442
- // Skip individual failed events - we'll emit based on finished state
586
+ // For hook failures, emit immediately as there won't be a test.finished event
587
+ // Regular test failures are handled via test.finished to support retries
588
+ if (message.data?.hookName) {
589
+ this.emit(event.test.failed, deserializeTest(message.data))
590
+ }
591
+ // Otherwise skip - we'll emit based on finished state
443
592
  break
444
593
  case event.test.passed:
445
594
  // Skip individual passed events - we'll emit based on finished state
@@ -493,8 +642,8 @@ class Workers extends EventEmitter {
493
642
  this.emit(event.step.failed, message.data, message.data.error)
494
643
  break
495
644
  case event.hook.failed:
496
- // Count hook failures as test failures for event counting
497
- this.emit(event.test.failed, { title: `Hook failure: ${message.data.hookName || 'unknown'}`, err: message.data.error })
645
+ // Hook failures are already reported as test failures by the worker
646
+ // Just emit the hook.failed event for listeners
498
647
  this.emit(event.hook.failed, message.data)
499
648
  break
500
649
  }
@@ -506,7 +655,14 @@ class Workers extends EventEmitter {
506
655
 
507
656
  worker.on('exit', () => {
508
657
  this.closedWorkers += 1
509
- if (this.closedWorkers === this.numberOfWorkers) {
658
+
659
+ if (this.isPoolMode) {
660
+ // Pool mode: finish when all workers have exited and no more tests
661
+ if (this.closedWorkers === this.numberOfWorkers) {
662
+ this._finishRun()
663
+ }
664
+ } else if (this.closedWorkers === this.numberOfWorkers) {
665
+ // Regular mode: finish when all original workers have exited
510
666
  this._finishRun()
511
667
  }
512
668
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.0-beta.7.esm-aria",
3
+ "version": "4.0.0-beta.9.esm-aria",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [
@@ -29,29 +29,39 @@
29
29
  "docs/webapi/**"
30
30
  ],
31
31
  "main": "lib/index.js",
32
+ "module": "lib/index.js",
33
+ "types": "typings/index.d.ts",
32
34
  "exports": {
33
- ".": "./lib/index.js",
35
+ ".": {
36
+ "import": "./lib/index.js",
37
+ "require": "./lib/index.js",
38
+ "types": "./typings/index.d.ts"
39
+ },
34
40
  "./lib/*": "./lib/*.js",
35
41
  "./els": "./lib/els.js",
36
42
  "./effects": "./lib/effects.js",
37
43
  "./steps": "./lib/steps.js",
38
44
  "./store": "./lib/store.js"
39
45
  },
40
- "types": "typings/index.d.ts",
41
46
  "bin": {
42
47
  "codeceptjs": "./bin/codecept.js"
43
48
  },
44
49
  "repository": "Codeception/codeceptjs",
45
50
  "scripts": {
46
- "json-server": "json-server test/data/rest/db.json --host 0.0.0.0 -p 8010 --watch -m test/data/rest/headers.cjs",
51
+ "test-server": "node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010 --read-only",
52
+ "test-server:writable": "node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010",
53
+ "mock-server:start": "node test/mock-server/start-mock-server.js",
54
+ "mock-server:stop": "kill -9 $(lsof -t -i:3001)",
55
+ "test:with-mock-server": "npm run mock-server:start && npm test",
47
56
  "json-server:graphql": "node test/data/graphql/index.js",
48
57
  "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs",
49
58
  "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs --fix",
50
59
  "prettier": "prettier --config prettier.config.js --write bin/**/*.js lib/**/*.js test/**/*.js translations/**/*.js runok.cjs",
51
60
  "docs": "./runok.cjs docs",
52
61
  "test:unit": "mocha test/unit --recursive --timeout 10000 --reporter @testomatio/reporter/mocha",
62
+ "test:rest": "mocha test/rest --recursive --timeout 20000 --reporter @testomatio/reporter/mocha",
53
63
  "test:runner": "mocha test/runner --recursive --timeout 10000 --reporter @testomatio/reporter/mocha",
54
- "test": "npm run test:unit && npm run test:runner",
64
+ "test": "npm run test:unit && npm run test:rest && npm run test:runner",
55
65
  "test:appium-quick": "mocha test/helper/Appium_test.js --grep 'quick' --reporter @testomatio/reporter/mocha",
56
66
  "test:appium-other": "mocha test/helper/Appium_test.js --grep 'second' --reporter @testomatio/reporter/mocha",
57
67
  "test:ios:appium-quick": "mocha test/helper/Appium_ios_test.js --grep 'quick' --reporter @testomatio/reporter/mocha",
@@ -76,44 +86,43 @@
76
86
  },
77
87
  "dependencies": {
78
88
  "@codeceptjs/configure": "1.0.6",
79
- "@codeceptjs/helper": "^4.0.0-beta.1",
80
- "@cucumber/cucumber-expressions": "^18.0.1",
81
- "@cucumber/gherkin": "32.1.2",
82
- "@cucumber/messages": "27.2.0",
83
- "@inquirer/confirm": "^5.1.14",
84
- "@inquirer/core": "^10.1.15",
85
- "@inquirer/input": "^4.2.1",
86
- "@inquirer/prompts": "^7.8.2",
87
- "@inquirer/select": "^4.3.1",
89
+ "@codeceptjs/helper": "2.0.4",
90
+ "@cucumber/cucumber-expressions": "18",
91
+ "@cucumber/gherkin": "35.1.0",
92
+ "@cucumber/messages": "29.0.1",
88
93
  "@xmldom/xmldom": "0.9.8",
89
- "acorn": "8.14.1",
94
+ "acorn": "8.15.0",
95
+ "ai": "^5.0.60",
90
96
  "arrify": "3.0.0",
91
- "axios": "1.8.4",
97
+ "axios": "1.12.2",
92
98
  "chalk": "4.1.2",
93
- "cheerio": "^1.1.0",
99
+ "cheerio": "^1.0.0",
100
+ "chokidar": "^4.0.3",
94
101
  "commander": "11.1.0",
95
102
  "cross-spawn": "7.0.6",
96
103
  "css-to-xpath": "0.1.0",
97
104
  "csstoxpath": "1.6.0",
98
- "envinfo": "7.14.0",
105
+ "envinfo": "7.20.0",
99
106
  "escape-string-regexp": "4.0.0",
100
107
  "figures": "3.2.0",
101
108
  "fn-args": "4.0.0",
102
- "fs-extra": "11.3.0",
103
- "fuse.js": "^7.1.0",
104
- "glob": "^11.0.3",
109
+ "fs-extra": "11.3.2",
110
+ "fuse.js": "^7.0.0",
111
+ "glob": ">=9.0.0 <12",
105
112
  "html-minifier-terser": "7.2.0",
106
- "inquirer": "12.9.2",
107
- "invisi-data": "^1.1.2",
108
- "joi": "17.13.3",
113
+ "inquirer": "^8.2.7",
114
+ "invisi-data": "^1.0.0",
115
+ "joi": "18.0.1",
109
116
  "js-beautify": "1.15.4",
110
117
  "lodash.clonedeep": "4.5.0",
111
118
  "lodash.merge": "4.6.2",
119
+ "lodash.shuffle": "4.2.0",
112
120
  "mkdirp": "3.0.1",
113
- "mocha": "11.6.0",
114
- "monocart-coverage-reports": "2.12.6",
121
+ "mocha": "11.7.5",
122
+ "monocart-coverage-reports": "2.12.9",
115
123
  "ms": "2.1.3",
116
- "ora": "^8.0.0",
124
+ "multer": "^2.0.2",
125
+ "ora-classic": "5.4.2",
117
126
  "parse-function": "5.6.10",
118
127
  "parse5": "7.3.0",
119
128
  "promise-retry": "1.1.1",
@@ -122,60 +131,60 @@
122
131
  "uuid": "11.1.0"
123
132
  },
124
133
  "optionalDependencies": {
125
- "@codeceptjs/detox-helper": "1.1.8"
134
+ "@codeceptjs/detox-helper": "1.1.13"
126
135
  },
127
136
  "devDependencies": {
128
- "@apollo/server": "^4.12.2",
137
+ "@apollo/server": "^5",
129
138
  "@codeceptjs/expect-helper": "^1.0.2",
130
139
  "@codeceptjs/mock-request": "0.3.1",
131
140
  "@eslint/eslintrc": "3.3.1",
132
- "@eslint/js": "9.30.0",
141
+ "@eslint/js": "9.36.0",
133
142
  "@faker-js/faker": "9.8.0",
134
143
  "@inquirer/testing": "^2.1.49",
135
144
  "@pollyjs/adapter-puppeteer": "6.0.6",
136
145
  "@pollyjs/core": "6.0.6",
137
146
  "@testomatio/reporter": "^2.3.1",
138
147
  "@types/chai": "5.2.2",
139
- "@types/inquirer": "9.0.7",
140
- "@types/node": "24.0.10",
148
+ "@types/inquirer": "9.0.9",
149
+ "@types/node": "^24.9.2",
141
150
  "@wdio/sauce-service": "9.12.5",
142
151
  "@wdio/selenium-standalone-service": "8.15.0",
143
- "@wdio/utils": "9.15.0",
152
+ "@wdio/utils": "9.20.0",
144
153
  "@xmldom/xmldom": "0.9.8",
145
154
  "bunosh": "latest",
146
155
  "chai": "^4.5.0",
147
156
  "chai-as-promised": "7.1.2",
148
157
  "chai-subset": "1.6.0",
149
158
  "documentation": "14.0.3",
150
- "electron": "37.1.0",
151
- "eslint": "^9.31.0",
159
+ "electron": "38.2.0",
160
+ "eslint": "^9.36.0",
152
161
  "eslint-plugin-import": "2.32.0",
153
162
  "eslint-plugin-mocha": "11.1.0",
154
- "expect": "29.7.0",
155
- "express": "5.1.0",
156
- "globals": "16.2.0",
157
- "graphql": "16.10.0",
163
+ "expect": "30.2.0",
164
+ "express": "^5.1.0",
165
+ "globals": "16.4.0",
166
+ "graphql": "16.11.0",
158
167
  "graphql-tag": "^2.12.6",
159
168
  "husky": "9.1.7",
160
169
  "jsdoc": "^3.6.11",
161
170
  "jsdoc-typeof-plugin": "1.0.0",
162
171
  "json-server": "0.17.4",
163
172
  "mochawesome": "^7.1.3",
164
- "playwright": "1.53.0",
165
- "prettier": "^3.6.2",
166
- "puppeteer": "24.8.0",
173
+ "playwright": "1.55.1",
174
+ "prettier": "^3.3.2",
175
+ "puppeteer": "24.15.0",
167
176
  "qrcode-terminal": "0.12.0",
168
177
  "rosie": "2.1.1",
169
178
  "runok": "^0.9.3",
170
- "semver": "7.7.2",
179
+ "semver": "7.7.3",
171
180
  "sinon": "21.0.0",
172
181
  "sinon-chai": "3.7.0",
173
- "ts-morph": "26.0.0",
182
+ "ts-morph": "27.0.2",
174
183
  "ts-node": "10.9.2",
175
- "tsd": "^0.32.0",
184
+ "tsd": "^0.33.0",
176
185
  "tsd-jsdoc": "2.5.0",
177
- "typedoc": "0.28.7",
178
- "typedoc-plugin-markdown": "4.7.0",
186
+ "typedoc": "0.28.13",
187
+ "typedoc-plugin-markdown": "4.9.0",
179
188
  "typescript": "5.8.3",
180
189
  "wdio-docker-service": "3.2.1",
181
190
  "webdriverio": "9.12.5",
@@ -192,5 +201,8 @@
192
201
  "compilerOptions": {
193
202
  "strict": false
194
203
  }
204
+ },
205
+ "overrides": {
206
+ "tmp": "0.2.5"
195
207
  }
196
208
  }
@@ -97,7 +97,7 @@ declare namespace CodeceptJS {
97
97
  * tests: 'tests/**.test.ts'
98
98
  * ```
99
99
  */
100
- tests: string
100
+ tests: string | string[]
101
101
  /**
102
102
  * Where to store failure screenshots, artifacts, etc
103
103
  *
@@ -440,7 +440,7 @@ declare namespace CodeceptJS {
440
440
  interface IHook {}
441
441
  interface IScenario {}
442
442
  interface IFeature {
443
- (title: string): FeatureConfig
443
+ (title: string, opts?: { [key: string]: any }): FeatureConfig
444
444
  }
445
445
  interface CallbackOrder extends Array<any> {}
446
446
  interface SupportObject {
@@ -486,6 +486,7 @@ declare namespace CodeceptJS {
486
486
  todo: IScenario
487
487
  }
488
488
  interface Feature extends IFeature {
489
+ only: IFeature
489
490
  skip: IFeature
490
491
  }
491
492
  interface IData {
@@ -521,11 +522,16 @@ declare namespace CodeceptJS {
521
522
  function addStep(step: string, fn: Function): Promise<void>
522
523
  }
523
524
 
525
+ type TryTo = <T>(fn: () => Promise<T> | T) => Promise<T | false>
526
+ type HopeThat = <T>(fn: () => Promise<T> | T) => Promise<T | false>
527
+ type RetryTo = <T>(fn: () => Promise<T> | T, retries?: number) => Promise<T>
528
+
524
529
  // Globals
525
530
  declare const codecept_dir: string
526
531
  declare const output_dir: string
527
- declare function tryTo(...fn): Promise<boolean>
528
- declare function retryTo(...fn): Promise<null>
532
+ declare const tryTo: TryTo
533
+ declare const retryTo: RetryTo
534
+ declare const hopeThat: HopeThat
529
535
 
530
536
  declare const actor: CodeceptJS.actor
531
537
  declare const codecept_actor: CodeceptJS.actor
@@ -547,7 +553,7 @@ declare const Given: typeof CodeceptJS.addStep
547
553
  declare const When: typeof CodeceptJS.addStep
548
554
  declare const Then: typeof CodeceptJS.addStep
549
555
 
550
- declare const Feature: typeof CodeceptJS.Feature
556
+ declare const Feature: CodeceptJS.Feature
551
557
  declare const Scenario: CodeceptJS.Scenario
552
558
  declare const xScenario: CodeceptJS.IScenario
553
559
  declare const xFeature: CodeceptJS.IFeature
@@ -630,9 +636,15 @@ declare namespace Mocha {
630
636
  }
631
637
 
632
638
  declare module 'codeceptjs' {
633
- export = codeceptjs
639
+ export default codeceptjs
634
640
  }
635
641
 
636
642
  declare module '@codeceptjs/helper' {
637
- export = CodeceptJS.Helper
643
+ export default CodeceptJS.Helper
644
+ }
645
+
646
+ declare module 'codeceptjs/effects' {
647
+ export const tryTo: TryTo
648
+ export const retryTo: RetryTo
649
+ export const hopeThat: HopeThat
638
650
  }