codeceptjs 4.0.0-beta.5 → 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 (179) hide show
  1. package/README.md +0 -45
  2. package/bin/codecept.js +46 -57
  3. package/lib/actor.js +15 -11
  4. package/lib/ai.js +6 -5
  5. package/lib/assert/empty.js +9 -8
  6. package/lib/assert/equal.js +15 -17
  7. package/lib/assert/error.js +2 -2
  8. package/lib/assert/include.js +9 -11
  9. package/lib/assert/throws.js +1 -1
  10. package/lib/assert/truth.js +8 -5
  11. package/lib/assert.js +18 -18
  12. package/lib/codecept.js +66 -107
  13. package/lib/colorUtils.js +48 -50
  14. package/lib/command/check.js +32 -27
  15. package/lib/command/configMigrate.js +11 -10
  16. package/lib/command/definitions.js +16 -10
  17. package/lib/command/dryRun.js +16 -16
  18. package/lib/command/generate.js +29 -26
  19. package/lib/command/gherkin/init.js +36 -38
  20. package/lib/command/gherkin/snippets.js +14 -14
  21. package/lib/command/gherkin/steps.js +21 -18
  22. package/lib/command/info.js +8 -8
  23. package/lib/command/init.js +34 -31
  24. package/lib/command/interactive.js +11 -10
  25. package/lib/command/list.js +10 -9
  26. package/lib/command/run-multiple/chunk.js +5 -5
  27. package/lib/command/run-multiple/collection.js +5 -5
  28. package/lib/command/run-multiple/run.js +3 -3
  29. package/lib/command/run-multiple.js +16 -13
  30. package/lib/command/run-rerun.js +6 -7
  31. package/lib/command/run-workers.js +10 -24
  32. package/lib/command/run.js +8 -8
  33. package/lib/command/utils.js +20 -18
  34. package/lib/command/workers/runTests.js +117 -269
  35. package/lib/config.js +111 -49
  36. package/lib/container.js +299 -102
  37. package/lib/data/context.js +6 -5
  38. package/lib/data/dataScenarioConfig.js +1 -1
  39. package/lib/data/dataTableArgument.js +1 -1
  40. package/lib/data/table.js +1 -1
  41. package/lib/effects.js +94 -10
  42. package/lib/els.js +11 -9
  43. package/lib/event.js +11 -10
  44. package/lib/globals.js +141 -0
  45. package/lib/heal.js +12 -12
  46. package/lib/helper/AI.js +1 -1
  47. package/lib/helper/ApiDataFactory.js +16 -13
  48. package/lib/helper/FileSystem.js +32 -12
  49. package/lib/helper/GraphQL.js +1 -1
  50. package/lib/helper/GraphQLDataFactory.js +1 -1
  51. package/lib/helper/JSONResponse.js +19 -30
  52. package/lib/helper/Mochawesome.js +9 -28
  53. package/lib/helper/Playwright.js +668 -265
  54. package/lib/helper/Puppeteer.js +284 -169
  55. package/lib/helper/REST.js +29 -12
  56. package/lib/helper/WebDriver.js +191 -71
  57. package/lib/helper/errors/ConnectionRefused.js +6 -6
  58. package/lib/helper/errors/ElementAssertion.js +11 -16
  59. package/lib/helper/errors/ElementNotFound.js +5 -9
  60. package/lib/helper/errors/RemoteBrowserConnectionRefused.js +5 -5
  61. package/lib/helper/extras/Console.js +11 -11
  62. package/lib/helper/extras/PlaywrightLocator.js +110 -0
  63. package/lib/helper/extras/PlaywrightPropEngine.js +18 -18
  64. package/lib/helper/extras/PlaywrightRestartOpts.js +23 -23
  65. package/lib/helper/extras/Popup.js +1 -1
  66. package/lib/helper/extras/React.js +29 -30
  67. package/lib/helper/network/actions.js +33 -48
  68. package/lib/helper/network/utils.js +76 -83
  69. package/lib/helper/scripts/blurElement.js +6 -6
  70. package/lib/helper/scripts/focusElement.js +6 -6
  71. package/lib/helper/scripts/highlightElement.js +9 -9
  72. package/lib/helper/scripts/isElementClickable.js +34 -34
  73. package/lib/helper.js +2 -1
  74. package/lib/history.js +23 -20
  75. package/lib/hooks.js +10 -10
  76. package/lib/html.js +90 -100
  77. package/lib/index.js +48 -21
  78. package/lib/listener/config.js +8 -9
  79. package/lib/listener/emptyRun.js +6 -7
  80. package/lib/listener/exit.js +4 -3
  81. package/lib/listener/globalRetry.js +5 -5
  82. package/lib/listener/globalTimeout.js +11 -10
  83. package/lib/listener/helpers.js +33 -14
  84. package/lib/listener/mocha.js +3 -4
  85. package/lib/listener/result.js +4 -5
  86. package/lib/listener/steps.js +7 -18
  87. package/lib/listener/store.js +3 -3
  88. package/lib/locator.js +213 -192
  89. package/lib/mocha/asyncWrapper.js +108 -75
  90. package/lib/mocha/bdd.js +99 -13
  91. package/lib/mocha/cli.js +60 -27
  92. package/lib/mocha/factory.js +75 -19
  93. package/lib/mocha/featureConfig.js +1 -1
  94. package/lib/mocha/gherkin.js +57 -25
  95. package/lib/mocha/hooks.js +12 -3
  96. package/lib/mocha/index.js +13 -4
  97. package/lib/mocha/inject.js +22 -5
  98. package/lib/mocha/scenarioConfig.js +2 -2
  99. package/lib/mocha/suite.js +9 -2
  100. package/lib/mocha/test.js +10 -13
  101. package/lib/mocha/ui.js +28 -31
  102. package/lib/output.js +11 -9
  103. package/lib/parser.js +44 -44
  104. package/lib/pause.js +15 -16
  105. package/lib/plugin/analyze.js +19 -12
  106. package/lib/plugin/auth.js +20 -21
  107. package/lib/plugin/autoDelay.js +12 -8
  108. package/lib/plugin/coverage.js +12 -8
  109. package/lib/plugin/customLocator.js +3 -3
  110. package/lib/plugin/customReporter.js +3 -2
  111. package/lib/plugin/heal.js +14 -9
  112. package/lib/plugin/pageInfo.js +10 -10
  113. package/lib/plugin/pauseOnFail.js +4 -3
  114. package/lib/plugin/retryFailedStep.js +47 -5
  115. package/lib/plugin/screenshotOnFail.js +75 -37
  116. package/lib/plugin/stepByStepReport.js +14 -14
  117. package/lib/plugin/stepTimeout.js +4 -3
  118. package/lib/plugin/subtitles.js +6 -5
  119. package/lib/recorder.js +33 -23
  120. package/lib/rerun.js +69 -26
  121. package/lib/result.js +4 -4
  122. package/lib/secret.js +18 -17
  123. package/lib/session.js +95 -89
  124. package/lib/step/base.js +6 -6
  125. package/lib/step/config.js +1 -1
  126. package/lib/step/func.js +3 -3
  127. package/lib/step/helper.js +3 -3
  128. package/lib/step/meta.js +4 -4
  129. package/lib/step/record.js +11 -11
  130. package/lib/step/retry.js +3 -3
  131. package/lib/step/section.js +3 -3
  132. package/lib/step.js +7 -10
  133. package/lib/steps.js +9 -5
  134. package/lib/store.js +1 -1
  135. package/lib/timeout.js +1 -7
  136. package/lib/transform.js +8 -8
  137. package/lib/translation.js +32 -18
  138. package/lib/utils.js +68 -97
  139. package/lib/workerStorage.js +16 -17
  140. package/lib/workers.js +145 -171
  141. package/package.json +63 -57
  142. package/translations/de-DE.js +2 -2
  143. package/translations/fr-FR.js +2 -2
  144. package/translations/index.js +23 -10
  145. package/translations/it-IT.js +2 -2
  146. package/translations/ja-JP.js +2 -2
  147. package/translations/nl-NL.js +2 -2
  148. package/translations/pl-PL.js +2 -2
  149. package/translations/pt-BR.js +2 -2
  150. package/translations/ru-RU.js +2 -2
  151. package/translations/utils.js +11 -2
  152. package/translations/zh-CN.js +2 -2
  153. package/translations/zh-TW.js +2 -2
  154. package/typings/index.d.ts +7 -18
  155. package/typings/promiseBasedTypes.d.ts +3769 -5450
  156. package/typings/types.d.ts +3953 -5778
  157. package/bin/test-server.js +0 -53
  158. package/lib/element/WebElement.js +0 -327
  159. package/lib/helper/Nightmare.js +0 -1486
  160. package/lib/helper/Protractor.js +0 -1840
  161. package/lib/helper/TestCafe.js +0 -1391
  162. package/lib/helper/clientscripts/nightmare.js +0 -213
  163. package/lib/helper/extras/PlaywrightReactVueLocator.js +0 -43
  164. package/lib/helper/testcafe/testControllerHolder.js +0 -42
  165. package/lib/helper/testcafe/testcafe-utils.js +0 -61
  166. package/lib/listener/retryEnhancer.js +0 -85
  167. package/lib/plugin/allure.js +0 -15
  168. package/lib/plugin/autoLogin.js +0 -5
  169. package/lib/plugin/commentStep.js +0 -141
  170. package/lib/plugin/eachElement.js +0 -127
  171. package/lib/plugin/fakerTransform.js +0 -49
  172. package/lib/plugin/htmlReporter.js +0 -1947
  173. package/lib/plugin/retryTo.js +0 -16
  174. package/lib/plugin/selenoid.js +0 -364
  175. package/lib/plugin/standardActingHelpers.js +0 -6
  176. package/lib/plugin/tryTo.js +0 -16
  177. package/lib/plugin/wdio.js +0 -247
  178. package/lib/test-server.js +0 -323
  179. package/lib/within.js +0 -90
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.6.esm-aria",
4
+ "type": "module",
4
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
6
  "keywords": [
6
7
  "acceptance",
@@ -8,7 +9,6 @@
8
9
  "end 2 end",
9
10
  "puppeteer",
10
11
  "webdriver",
11
- "testcafe",
12
12
  "playwright",
13
13
  "bdd",
14
14
  "tdd",
@@ -34,59 +34,66 @@
34
34
  "./lib/*": "./lib/*.js",
35
35
  "./els": "./lib/els.js",
36
36
  "./effects": "./lib/effects.js",
37
- "./steps": "./lib/steps.js"
37
+ "./steps": "./lib/steps.js",
38
+ "./store": "./lib/store.js"
38
39
  },
39
40
  "types": "typings/index.d.ts",
40
41
  "bin": {
41
- "codeceptjs": "./bin/codecept.js"
42
+ "codeceptjs": "bin/codecept.js"
43
+ },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/Codeception/codeceptjs.git"
42
47
  },
43
- "repository": "Codeception/codeceptjs",
44
48
  "scripts": {
45
- "test-server": "node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010",
49
+ "json-server": "json-server test/data/rest/db.json --host 0.0.0.0 -p 8010 --watch -m test/data/rest/headers.cjs",
46
50
  "json-server:graphql": "node test/data/graphql/index.js",
47
- "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.js",
48
- "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.js --fix",
49
- "prettier": "prettier --config prettier.config.js --write bin/**/*.js lib/**/*.js test/**/*.js translations/**/*.js runok.js",
50
- "docs": "./runok.js docs",
51
- "test:unit": "mocha test/unit --recursive --timeout 10000",
52
- "test:runner": "mocha test/runner --recursive --timeout 10000",
51
+ "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs",
52
+ "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs --fix",
53
+ "prettier": "prettier --config prettier.config.js --write bin/**/*.js lib/**/*.js test/**/*.js translations/**/*.js runok.cjs",
54
+ "docs": "./runok.cjs docs",
55
+ "test:unit": "mocha test/unit --recursive --timeout 10000 --reporter @testomatio/reporter/mocha",
56
+ "test:runner": "mocha test/runner --recursive --timeout 10000 --reporter @testomatio/reporter/mocha",
53
57
  "test": "npm run test:unit && npm run test:runner",
54
- "test:appium-quick": "mocha test/helper/Appium_test.js --grep 'quick'",
55
- "test:appium-other": "mocha test/helper/Appium_test.js --grep 'second'",
56
- "test:ios:appium-quick": "mocha test/helper/Appium_ios_test.js --grep 'quick'",
57
- "test:ios:appium-other": "mocha test/helper/Appium_ios_test.js --grep 'second'",
58
+ "test:appium-quick": "mocha test/helper/Appium_test.js --grep 'quick' --reporter @testomatio/reporter/mocha",
59
+ "test:appium-other": "mocha test/helper/Appium_test.js --grep 'second' --reporter @testomatio/reporter/mocha",
60
+ "test:ios:appium-quick": "mocha test/helper/Appium_ios_test.js --grep 'quick' --reporter @testomatio/reporter/mocha",
61
+ "test:ios:appium-other": "mocha test/helper/Appium_ios_test.js --grep 'second' --reporter @testomatio/reporter/mocha",
58
62
  "test-app:start": "php -S 127.0.0.1:8000 -t test/data/app",
59
63
  "test-app:stop": "kill -9 $(lsof -t -i:8000)",
60
- "test:unit:webbapi:playwright": "mocha test/helper/Playwright_test.js",
61
- "test:unit:webbapi:puppeteer": "mocha test/helper/Puppeteer_test.js",
62
- "test:unit:webbapi:webDriver": "mocha test/helper/WebDriver_test.js --timeout 10000",
63
- "test:unit:webbapi:webDriver:noSeleniumServer": "mocha test/helper/WebDriver.noSeleniumServer_test.js --timeout 10000",
64
- "test:unit:webbapi:testCafe": "mocha test/helper/TestCafe_test.js",
65
- "test:unit:expect": "mocha test/helper/Expect_test.js",
66
- "test:plugin": "mocha test/plugin/plugin_test.js",
67
- "def": "./runok.js def",
64
+ "test:unit:webbapi:playwright": "mocha test/helper/Playwright_test.js --reporter @testomatio/reporter/mocha",
65
+ "test:unit:webbapi:puppeteer": "mocha test/helper/Puppeteer_test.js --reporter @testomatio/reporter/mocha",
66
+ "test:unit:webbapi:webDriver": "mocha test/helper/WebDriver_test.js --timeout 10000 --reporter @testomatio/reporter/mocha",
67
+ "test:unit:webbapi:webDriver:noSeleniumServer": "mocha test/helper/WebDriver.noSeleniumServer_test.js --timeout 10000 --reporter @testomatio/reporter/mocha",
68
+ "test:unit:expect": "mocha test/helper/Expect_test.js --reporter @testomatio/reporter/mocha",
69
+ "test:plugin": "mocha test/plugin/plugin_test.js --reporter @testomatio/reporter/mocha",
70
+ "def": "./runok.cjs def",
68
71
  "dev:graphql": "node test/data/graphql/index.js",
69
- "publish:site": "./runok.js publish:site",
70
- "update-contributor-faces": "./runok.js contributor:faces",
72
+ "publish:site": "./runok.cjs publish:site",
73
+ "update-contributor-faces": "./runok.cjs contributor:faces",
71
74
  "types-fix": "node typings/fixDefFiles.js",
72
75
  "dtslint": "npm run types-fix && tsd",
73
76
  "prepare": "husky install",
74
- "prepare-release": "./runok.js versioning && ./runok.js get:commit-log",
75
- "publish-beta": "./runok.js publish:next-beta-version"
77
+ "prepare-release": "./runok.cjs versioning && ./runok.cjs get:commit-log",
78
+ "publish-beta": "./runok.cjs publish:next-beta-version"
76
79
  },
77
80
  "dependencies": {
78
81
  "@codeceptjs/configure": "1.0.6",
79
- "@codeceptjs/helper": "2.0.4",
80
- "@cucumber/cucumber-expressions": "18",
82
+ "@codeceptjs/helper": "^4.0.0-beta.1",
83
+ "@cucumber/cucumber-expressions": "^18.0.1",
81
84
  "@cucumber/gherkin": "32.1.2",
82
85
  "@cucumber/messages": "27.2.0",
86
+ "@inquirer/confirm": "^5.1.14",
87
+ "@inquirer/core": "^10.1.15",
88
+ "@inquirer/input": "^4.2.1",
89
+ "@inquirer/prompts": "^7.8.2",
90
+ "@inquirer/select": "^4.3.1",
83
91
  "@xmldom/xmldom": "0.9.8",
84
92
  "acorn": "8.14.1",
85
93
  "arrify": "3.0.0",
86
- "axios": "1.11.0",
94
+ "axios": "1.8.4",
87
95
  "chalk": "4.1.2",
88
- "cheerio": "^1.0.0",
89
- "chokidar": "^4.0.3",
96
+ "cheerio": "^1.1.0",
90
97
  "commander": "11.1.0",
91
98
  "cross-spawn": "7.0.6",
92
99
  "css-to-xpath": "0.1.0",
@@ -96,22 +103,20 @@
96
103
  "figures": "3.2.0",
97
104
  "fn-args": "4.0.0",
98
105
  "fs-extra": "11.3.0",
99
- "fuse.js": "^7.0.0",
100
- "glob": ">=9.0.0 <12",
106
+ "fuse.js": "^7.1.0",
107
+ "glob": "^11.0.3",
101
108
  "html-minifier-terser": "7.2.0",
102
- "inquirer": "^8.2.7",
103
- "invisi-data": "^1.0.0",
109
+ "inquirer": "12.9.2",
110
+ "invisi-data": "^1.1.2",
104
111
  "joi": "17.13.3",
105
112
  "js-beautify": "1.15.4",
106
113
  "lodash.clonedeep": "4.5.0",
107
114
  "lodash.merge": "4.6.2",
108
- "lodash.shuffle": "4.2.0",
109
115
  "mkdirp": "3.0.1",
110
116
  "mocha": "11.6.0",
111
117
  "monocart-coverage-reports": "2.12.6",
112
118
  "ms": "2.1.3",
113
- "multer": "^2.0.2",
114
- "ora-classic": "5.4.2",
119
+ "ora": "^8.0.0",
115
120
  "parse-function": "5.6.10",
116
121
  "parse5": "7.3.0",
117
122
  "promise-retry": "1.1.1",
@@ -123,14 +128,16 @@
123
128
  "@codeceptjs/detox-helper": "1.1.8"
124
129
  },
125
130
  "devDependencies": {
126
- "@apollo/server": "^4",
131
+ "@apollo/server": "^4.12.2",
127
132
  "@codeceptjs/expect-helper": "^1.0.2",
128
133
  "@codeceptjs/mock-request": "0.3.1",
129
134
  "@eslint/eslintrc": "3.3.1",
130
- "@eslint/js": "9.31.0",
135
+ "@eslint/js": "9.30.0",
131
136
  "@faker-js/faker": "9.8.0",
137
+ "@inquirer/testing": "^2.1.49",
132
138
  "@pollyjs/adapter-puppeteer": "6.0.6",
133
139
  "@pollyjs/core": "6.0.6",
140
+ "@testomatio/reporter": "^2.3.1",
134
141
  "@types/chai": "5.2.2",
135
142
  "@types/inquirer": "9.0.7",
136
143
  "@types/node": "24.0.10",
@@ -138,41 +145,40 @@
138
145
  "@wdio/selenium-standalone-service": "8.15.0",
139
146
  "@wdio/utils": "9.15.0",
140
147
  "@xmldom/xmldom": "0.9.8",
141
- "chai": "^4.0.0",
148
+ "bunosh": "latest",
149
+ "chai": "^4.5.0",
142
150
  "chai-as-promised": "7.1.2",
143
151
  "chai-subset": "1.6.0",
144
152
  "documentation": "14.0.3",
145
- "electron": "37.2.3",
146
- "eslint": "^9.24.0",
153
+ "electron": "37.1.0",
154
+ "eslint": "^9.31.0",
147
155
  "eslint-plugin-import": "2.32.0",
148
156
  "eslint-plugin-mocha": "11.1.0",
149
- "expect": "30.0.5",
150
- "express": "^5.1.0",
157
+ "expect": "29.7.0",
158
+ "express": "5.1.0",
151
159
  "globals": "16.2.0",
152
- "graphql": "16.11.0",
160
+ "graphql": "16.10.0",
153
161
  "graphql-tag": "^2.12.6",
154
162
  "husky": "9.1.7",
155
- "inquirer-test": "2.0.1",
156
163
  "jsdoc": "^3.6.11",
157
164
  "jsdoc-typeof-plugin": "1.0.0",
158
165
  "json-server": "0.17.4",
159
166
  "mochawesome": "^7.1.3",
160
- "playwright": "1.54.1",
161
- "prettier": "^3.3.2",
162
- "puppeteer": "24.15.0",
167
+ "playwright": "1.53.0",
168
+ "prettier": "^3.6.2",
169
+ "puppeteer": "24.8.0",
163
170
  "qrcode-terminal": "0.12.0",
164
171
  "rosie": "2.1.1",
165
- "runok": "0.9.3",
172
+ "runok": "^0.9.3",
166
173
  "semver": "7.7.2",
167
174
  "sinon": "21.0.0",
168
175
  "sinon-chai": "3.7.0",
169
- "testcafe": "3.7.2",
170
176
  "ts-morph": "26.0.0",
171
177
  "ts-node": "10.9.2",
172
- "tsd": "^0.33.0",
178
+ "tsd": "^0.32.0",
173
179
  "tsd-jsdoc": "2.5.0",
174
- "typedoc": "0.28.10",
175
- "typedoc-plugin-markdown": "4.8.1",
180
+ "typedoc": "0.28.7",
181
+ "typedoc-plugin-markdown": "4.7.0",
176
182
  "typescript": "5.8.3",
177
183
  "wdio-docker-service": "3.2.1",
178
184
  "webdriverio": "9.12.5",
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'de'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Ich',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'fr'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Je',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,10 +1,23 @@
1
- exports['de-DE'] = require('./de-DE')
2
- exports['it-IT'] = require('./it-IT')
3
- exports['fr-FR'] = require('./fr-FR')
4
- exports['ja-JP'] = require('./ja-JP')
5
- exports['pl-PL'] = require('./pl-PL')
6
- exports['pt-BR'] = require('./pt-BR')
7
- exports['ru-RU'] = require('./ru-RU')
8
- exports['zh-CN'] = require('./zh-CN')
9
- exports['zh-TW'] = require('./zh-TW')
10
- exports['nl-NL'] = require('./nl-NL')
1
+ import deDE from './de-DE.js'
2
+ import itIT from './it-IT.js'
3
+ import frFR from './fr-FR.js'
4
+ import jaJP from './ja-JP.js'
5
+ import plPL from './pl-PL.js'
6
+ import ptBR from './pt-BR.js'
7
+ import ruRU from './ru-RU.js'
8
+ import zhCN from './zh-CN.js'
9
+ import zhTW from './zh-TW.js'
10
+ import nlNL from './nl-NL.js'
11
+
12
+ export default {
13
+ 'de-DE': deDE,
14
+ 'it-IT': itIT,
15
+ 'fr-FR': frFR,
16
+ 'ja-JP': jaJP,
17
+ 'pl-PL': plPL,
18
+ 'pt-BR': ptBR,
19
+ 'ru-RU': ruRU,
20
+ 'zh-CN': zhCN,
21
+ 'zh-TW': zhTW,
22
+ 'nl-NL': nlNL
23
+ }
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'it'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'io',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'ja'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: '私は',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'nl'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Ik',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'pl'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Ja',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'pt'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Eu',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'ru'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: 'Я',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,5 +1,14 @@
1
- module.exports.gherkinTranslations = function (langCode) {
2
- const gherkinLanguages = require('@cucumber/gherkin/src/gherkin-languages.json')
1
+ import { readFileSync } from 'fs'
2
+ import { fileURLToPath } from 'url'
3
+ import { dirname, join } from 'path'
4
+
5
+ const __filename = fileURLToPath(import.meta.url)
6
+ const __dirname = dirname(__filename)
7
+
8
+ export function gherkinTranslations(langCode) {
9
+ // Load gherkin languages JSON file
10
+ const gherkinLanguagesPath = join(__dirname, '../node_modules/@cucumber/gherkin/src/gherkin-languages.json')
11
+ const gherkinLanguages = JSON.parse(readFileSync(gherkinLanguagesPath, 'utf8'))
3
12
  const { feature, scenario, scenarioOutline } = gherkinLanguages[langCode]
4
13
  return {
5
14
  Feature: feature[0],
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'zh-CN'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: '我',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -1,7 +1,7 @@
1
- const { gherkinTranslations } = require('./utils')
1
+ import { gherkinTranslations } from './utils.js'
2
2
  const langCode = 'zh-TW'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  I: '我',
6
6
  contexts: {
7
7
  ...gherkinTranslations(langCode),
@@ -440,7 +440,7 @@ declare namespace CodeceptJS {
440
440
  interface IHook {}
441
441
  interface IScenario {}
442
442
  interface IFeature {
443
- (title: string, opts?: { [key: string]: any }): FeatureConfig
443
+ (title: string): FeatureConfig
444
444
  }
445
445
  interface CallbackOrder extends Array<any> {}
446
446
  interface SupportObject {
@@ -486,7 +486,6 @@ declare namespace CodeceptJS {
486
486
  todo: IScenario
487
487
  }
488
488
  interface Feature extends IFeature {
489
- only: IFeature
490
489
  skip: IFeature
491
490
  }
492
491
  interface IData {
@@ -518,19 +517,15 @@ declare namespace CodeceptJS {
518
517
  interface HookConfig {
519
518
  retry(retries?: number): HookConfig
520
519
  }
521
- }
522
-
523
- type TryTo = <T>(fn: () => Promise<T> | T) => Promise<T | false>;
524
- type HopeThat = <T>(fn: () => Promise<T> | T) => Promise<T | false>;
525
- type RetryTo = <T>(fn: () => Promise<T> | T, retries?: number) => Promise<T>;
526
520
 
521
+ function addStep(step: string, fn: Function): Promise<void>
522
+ }
527
523
 
528
524
  // Globals
529
525
  declare const codecept_dir: string
530
526
  declare const output_dir: string
531
- declare const tryTo: TryTo;
532
- declare const retryTo: RetryTo;
533
- declare const hopeThat: HopeThat;
527
+ declare function tryTo(...fn): Promise<boolean>
528
+ declare function retryTo(...fn): Promise<null>
534
529
 
535
530
  declare const actor: CodeceptJS.actor
536
531
  declare const codecept_actor: CodeceptJS.actor
@@ -541,7 +536,7 @@ declare const within: typeof CodeceptJS.within
541
536
  declare const session: typeof CodeceptJS.session
542
537
  declare const DataTable: typeof CodeceptJS.DataTable
543
538
  declare const DataTableArgument: typeof CodeceptJS.DataTableArgument
544
- declare const codeceptjs: typeof CodeceptJS.index
539
+ declare const codeceptjs: typeof CodeceptJS
545
540
  declare const locate: typeof CodeceptJS.Locator.build
546
541
  declare function inject(): CodeceptJS.SupportObject
547
542
  declare function inject<T extends keyof CodeceptJS.SupportObject>(name: T): CodeceptJS.SupportObject[T]
@@ -552,7 +547,7 @@ declare const Given: typeof CodeceptJS.addStep
552
547
  declare const When: typeof CodeceptJS.addStep
553
548
  declare const Then: typeof CodeceptJS.addStep
554
549
 
555
- declare const Feature: CodeceptJS.Feature
550
+ declare const Feature: typeof CodeceptJS.Feature
556
551
  declare const Scenario: CodeceptJS.Scenario
557
552
  declare const xScenario: CodeceptJS.IScenario
558
553
  declare const xFeature: CodeceptJS.IFeature
@@ -641,9 +636,3 @@ declare module 'codeceptjs' {
641
636
  declare module '@codeceptjs/helper' {
642
637
  export = CodeceptJS.Helper
643
638
  }
644
-
645
- declare module 'codeceptjs/effects' {
646
- export const tryTo: TryTo;
647
- export const retryTo: RetryTo;
648
- export const hopeThat: HopeThat;
649
- }