codeceptjs 3.6.7 → 4.0.0-beta.2

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 (149) hide show
  1. package/bin/codecept.js +81 -84
  2. package/lib/actor.js +13 -13
  3. package/lib/ai.js +13 -10
  4. package/lib/assert/empty.js +21 -20
  5. package/lib/assert/equal.js +39 -37
  6. package/lib/assert/error.js +14 -14
  7. package/lib/assert/include.js +47 -46
  8. package/lib/assert/throws.js +11 -13
  9. package/lib/assert/truth.js +22 -19
  10. package/lib/assert.js +2 -4
  11. package/lib/cli.js +49 -57
  12. package/lib/codecept.js +155 -142
  13. package/lib/colorUtils.js +3 -3
  14. package/lib/command/configMigrate.js +52 -58
  15. package/lib/command/definitions.js +89 -88
  16. package/lib/command/dryRun.js +68 -71
  17. package/lib/command/generate.js +188 -197
  18. package/lib/command/gherkin/init.js +16 -27
  19. package/lib/command/gherkin/snippets.js +20 -20
  20. package/lib/command/gherkin/steps.js +8 -8
  21. package/lib/command/info.js +38 -40
  22. package/lib/command/init.js +288 -290
  23. package/lib/command/interactive.js +32 -32
  24. package/lib/command/list.js +26 -26
  25. package/lib/command/run-multiple/chunk.js +5 -5
  26. package/lib/command/run-multiple/collection.js +3 -3
  27. package/lib/command/run-multiple/run.js +2 -6
  28. package/lib/command/run-multiple.js +93 -113
  29. package/lib/command/run-rerun.js +25 -20
  30. package/lib/command/run-workers.js +66 -64
  31. package/lib/command/run.js +29 -26
  32. package/lib/command/utils.js +65 -80
  33. package/lib/command/workers/runTests.js +10 -10
  34. package/lib/config.js +9 -10
  35. package/lib/container.js +48 -40
  36. package/lib/data/context.js +59 -60
  37. package/lib/data/dataScenarioConfig.js +47 -47
  38. package/lib/data/dataTableArgument.js +29 -29
  39. package/lib/data/table.js +20 -26
  40. package/lib/dirname.js +5 -0
  41. package/lib/event.js +167 -163
  42. package/lib/heal.js +17 -13
  43. package/lib/helper/AI.js +41 -130
  44. package/lib/helper/ApiDataFactory.js +69 -73
  45. package/lib/helper/Appium.js +381 -412
  46. package/lib/helper/Expect.js +425 -0
  47. package/lib/helper/ExpectHelper.js +48 -40
  48. package/lib/helper/FileSystem.js +79 -80
  49. package/lib/helper/GraphQL.js +43 -44
  50. package/lib/helper/GraphQLDataFactory.js +50 -50
  51. package/lib/helper/JSONResponse.js +62 -65
  52. package/lib/helper/Mochawesome.js +28 -28
  53. package/lib/helper/MockServer.js +14 -12
  54. package/lib/helper/Nightmare.js +566 -662
  55. package/lib/helper/Playwright.js +1216 -1361
  56. package/lib/helper/Protractor.js +627 -663
  57. package/lib/helper/Puppeteer.js +1128 -1231
  58. package/lib/helper/REST.js +68 -159
  59. package/lib/helper/SoftExpectHelper.js +2 -2
  60. package/lib/helper/TestCafe.js +484 -490
  61. package/lib/helper/WebDriver.js +1156 -1297
  62. package/lib/helper/clientscripts/PollyWebDriverExt.js +1 -1
  63. package/lib/helper/errors/ConnectionRefused.js +1 -1
  64. package/lib/helper/errors/ElementAssertion.js +2 -2
  65. package/lib/helper/errors/ElementNotFound.js +2 -2
  66. package/lib/helper/errors/RemoteBrowserConnectionRefused.js +1 -1
  67. package/lib/helper/extras/Console.js +1 -1
  68. package/lib/helper/extras/PlaywrightPropEngine.js +2 -2
  69. package/lib/helper/extras/PlaywrightReactVueLocator.js +1 -1
  70. package/lib/helper/extras/PlaywrightRestartOpts.js +18 -21
  71. package/lib/helper/extras/Popup.js +1 -1
  72. package/lib/helper/extras/React.js +3 -3
  73. package/lib/helper/network/actions.js +7 -14
  74. package/lib/helper/network/utils.js +2 -3
  75. package/lib/helper/scripts/blurElement.js +1 -1
  76. package/lib/helper/scripts/focusElement.js +1 -1
  77. package/lib/helper/scripts/highlightElement.js +1 -1
  78. package/lib/helper/scripts/isElementClickable.js +1 -1
  79. package/lib/helper/testcafe/testControllerHolder.js +1 -1
  80. package/lib/helper/testcafe/testcafe-utils.js +7 -6
  81. package/lib/helper.js +3 -1
  82. package/lib/history.js +5 -6
  83. package/lib/hooks.js +6 -6
  84. package/lib/html.js +7 -7
  85. package/lib/index.js +41 -25
  86. package/lib/interfaces/bdd.js +64 -47
  87. package/lib/interfaces/featureConfig.js +19 -19
  88. package/lib/interfaces/gherkin.js +118 -124
  89. package/lib/interfaces/scenarioConfig.js +29 -29
  90. package/lib/listener/artifacts.js +9 -9
  91. package/lib/listener/config.js +24 -24
  92. package/lib/listener/exit.js +12 -12
  93. package/lib/listener/helpers.js +42 -42
  94. package/lib/listener/mocha.js +11 -11
  95. package/lib/listener/retry.js +30 -32
  96. package/lib/listener/steps.js +53 -50
  97. package/lib/listener/timeout.js +54 -54
  98. package/lib/locator.js +10 -6
  99. package/lib/mochaFactory.js +15 -18
  100. package/lib/output.js +10 -6
  101. package/lib/parser.js +12 -15
  102. package/lib/pause.js +33 -40
  103. package/lib/plugin/allure.js +15 -15
  104. package/lib/plugin/autoDelay.js +37 -29
  105. package/lib/plugin/autoLogin.js +65 -70
  106. package/lib/plugin/commentStep.js +18 -18
  107. package/lib/plugin/coverage.js +67 -115
  108. package/lib/plugin/customLocator.js +20 -21
  109. package/lib/plugin/debugErrors.js +24 -24
  110. package/lib/plugin/eachElement.js +38 -38
  111. package/lib/plugin/fakerTransform.js +6 -6
  112. package/lib/plugin/heal.js +108 -67
  113. package/lib/plugin/pauseOnFail.js +11 -11
  114. package/lib/plugin/retryFailedStep.js +39 -32
  115. package/lib/plugin/retryTo.js +40 -46
  116. package/lib/plugin/screenshotOnFail.js +87 -109
  117. package/lib/plugin/selenoid.js +118 -131
  118. package/lib/plugin/standardActingHelpers.js +8 -2
  119. package/lib/plugin/stepByStepReport.js +91 -110
  120. package/lib/plugin/stepTimeout.js +23 -24
  121. package/lib/plugin/subtitles.js +35 -34
  122. package/lib/plugin/tryTo.js +30 -40
  123. package/lib/plugin/wdio.js +75 -78
  124. package/lib/recorder.js +17 -14
  125. package/lib/rerun.js +10 -11
  126. package/lib/scenario.js +23 -25
  127. package/lib/secret.js +2 -4
  128. package/lib/session.js +10 -10
  129. package/lib/step.js +9 -12
  130. package/lib/store.js +3 -2
  131. package/lib/transform.js +1 -1
  132. package/lib/translation.js +8 -7
  133. package/lib/ui.js +14 -12
  134. package/lib/utils.js +72 -70
  135. package/lib/within.js +10 -10
  136. package/lib/workerStorage.js +25 -27
  137. package/lib/workers.js +32 -29
  138. package/package.json +53 -51
  139. package/translations/de-DE.js +1 -1
  140. package/translations/fr-FR.js +1 -1
  141. package/translations/index.js +13 -9
  142. package/translations/it-IT.js +1 -1
  143. package/translations/ja-JP.js +1 -1
  144. package/translations/pl-PL.js +1 -1
  145. package/translations/pt-BR.js +1 -1
  146. package/translations/ru-RU.js +1 -1
  147. package/translations/zh-CN.js +1 -1
  148. package/translations/zh-TW.js +1 -1
  149. package/typings/index.d.ts +65 -415
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.6.7",
3
+ "version": "4.0.0-beta.2",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -37,12 +37,11 @@
37
37
  "scripts": {
38
38
  "json-server": "./node_modules/json-server/bin/index.js test/data/rest/db.json -p 8010 --watch -m test/data/rest/headers.js",
39
39
  "json-server:graphql": "node test/data/graphql/index.js",
40
- "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.js",
41
- "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.js --fix",
42
- "prettier": "prettier --config prettier.config.js --write bin/**/*.js lib/**/*.js test/**/*.js translations/**/*.js runok.js",
43
- "docs": "./runok.js docs",
44
- "test:unit": "mocha test/unit --recursive --timeout 10000",
45
- "test:runner": "mocha test/runner --recursive --timeout 10000",
40
+ "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs",
41
+ "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.cjs --fix",
42
+ "docs": "./runok.cjs docs",
43
+ "test:unit": "mocha $(find test/unit -name '*.js' | grep workers --invert) --timeout 40000 --exit",
44
+ "test:runner": "mocha $(find test/runner -name '*.js') --timeout 40000 --exit",
46
45
  "test": "npm run test:unit && npm run test:runner",
47
46
  "test:appium-quick": "mocha test/helper/AppiumV2_test.js --grep 'quick'",
48
47
  "test:appium-other": "mocha test/helper/AppiumV2_test.js --grep 'second'",
@@ -56,32 +55,34 @@
56
55
  "test:unit:webbapi:webDriver:noSeleniumServer": "mocha test/helper/WebDriver.noSeleniumServer_test.js",
57
56
  "test:unit:webbapi:webDriver:devtools": "mocha test/helper/WebDriver_devtools_test.js --exit",
58
57
  "test:unit:webbapi:testCafe": "mocha test/helper/TestCafe_test.js",
59
- "test:unit:expect": "mocha test/helper/Expect_test.js",
58
+ "test:unit:expect": "mocha test/helper/Expect_test.js --exit",
60
59
  "test:unit:mockServer": "mocha test/helper/MockServer_test.js",
61
60
  "test:plugin": "mocha test/plugin/plugin_test.js",
62
- "def": "./runok.js def",
61
+ "def": "./runok.cjs def",
63
62
  "dev:graphql": "node test/data/graphql/index.js",
64
- "publish:site": "./runok.js publish:site",
65
- "update-contributor-faces": "./runok.js contributor:faces",
63
+ "publish:site": "./runok.cjs publish:site",
64
+ "update-contributor-faces": "./runok.cjs contributor:faces",
66
65
  "types-fix": "node typings/fixDefFiles.js",
67
66
  "dtslint": "npm run types-fix && tsd",
68
67
  "prepare": "husky install",
69
- "prepare-release": "./runok.js versioning && ./runok.js get:commit-log",
70
- "publish-beta": "./runok.js publish:next-beta-version"
68
+ "prepare-release": "./runok.cjs versioning && ./runok.cjs get:commit-log"
71
69
  },
72
70
  "dependencies": {
73
- "@codeceptjs/configure": "1.0.1",
74
- "@codeceptjs/helper": "2.0.4",
71
+ "@babel/core": "^7.23.9",
72
+ "@codeceptjs/configure": "0.10.0",
73
+ "@codeceptjs/helper": "^2.0.3",
75
74
  "@cucumber/cucumber-expressions": "17",
76
75
  "@cucumber/gherkin": "26",
77
- "@cucumber/messages": "25.0.1",
76
+ "@cucumber/messages": "24.1.0",
77
+ "@types/chai-string": "^1.4.5",
78
78
  "@xmldom/xmldom": "0.8.10",
79
- "acorn": "8.12.1",
79
+ "acorn": "8.11.3",
80
80
  "arrify": "2.0.1",
81
- "axios": "1.7.7",
82
- "chai": "5.1.1",
81
+ "axios": "1.6.7",
82
+ "babel-register-esm": "^1.2.5",
83
+ "chai": "5.0.3",
83
84
  "chai-deep-match": "1.2.1",
84
- "chai-exclude": "2.1.1",
85
+ "chai-exclude": "2.1.0",
85
86
  "chai-json-schema": "1.5.1",
86
87
  "chai-json-schema-ajv": "5.2.4",
87
88
  "chai-match-pattern": "1.3.0",
@@ -91,84 +92,84 @@
91
92
  "cross-spawn": "7.0.3",
92
93
  "css-to-xpath": "0.1.0",
93
94
  "csstoxpath": "1.6.0",
94
- "devtools": "8.40.2",
95
- "envinfo": "7.14.0",
95
+ "debug": "^4.3.4",
96
+ "devtools": "8.33.1",
97
+ "envinfo": "7.11.1",
96
98
  "escape-string-regexp": "4.0.0",
97
99
  "figures": "3.2.0",
98
100
  "fn-args": "4.0.0",
99
101
  "fs-extra": "11.2.0",
100
102
  "glob": "6.0.1",
101
103
  "html-minifier-terser": "7.2.0",
104
+ "import-sync": "2.2.0",
102
105
  "inquirer": "6.5.2",
103
- "joi": "17.13.3",
106
+ "joi": "17.12.2",
104
107
  "js-beautify": "1.15.1",
105
108
  "lodash.clonedeep": "4.5.0",
106
109
  "lodash.merge": "4.6.2",
107
110
  "mkdirp": "1.0.4",
108
- "mocha": "10.7.3",
109
- "monocart-coverage-reports": "2.10.3",
111
+ "mocha": "10.3.0",
112
+ "monocart-coverage-reports": "2.7.8",
110
113
  "ms": "2.1.3",
111
114
  "ora-classic": "5.4.2",
112
- "pactum": "3.7.1",
115
+ "pactum": "3.6.1",
113
116
  "parse-function": "5.6.10",
114
117
  "parse5": "7.1.2",
115
118
  "promise-retry": "1.1.1",
116
119
  "resq": "1.11.0",
117
120
  "sprintf-js": "1.1.1",
118
- "uuid": "10.0"
121
+ "uuid": "9.0"
119
122
  },
120
123
  "optionalDependencies": {
121
- "@codeceptjs/detox-helper": "1.1.2"
124
+ "@codeceptjs/detox-helper": "1.0.5"
122
125
  },
123
126
  "devDependencies": {
124
127
  "@codeceptjs/mock-request": "0.3.1",
125
128
  "@faker-js/faker": "7.6.0",
126
129
  "@pollyjs/adapter-puppeteer": "6.0.6",
127
130
  "@pollyjs/core": "5.1.0",
128
- "@types/chai": "4.3.19",
131
+ "@types/chai": "4.3.12",
129
132
  "@types/inquirer": "9.0.3",
130
- "@types/node": "22.5.5",
131
- "@wdio/sauce-service": "9.0.9",
133
+ "@types/node": "20.11.30",
134
+ "@wdio/sauce-service": "8.32.3",
132
135
  "@wdio/selenium-standalone-service": "8.3.2",
133
- "@wdio/utils": "9.0.6",
136
+ "@wdio/utils": "8.33.1",
134
137
  "@xmldom/xmldom": "0.8.10",
135
138
  "apollo-server-express": "2.25.3",
136
- "chai-as-promised": "7.1.2",
139
+ "chai-as-promised": "7.1.1",
137
140
  "chai-subset": "1.6.0",
138
141
  "contributor-faces": "1.1.0",
139
142
  "documentation": "12.3.0",
140
- "electron": "31.3.1",
141
- "eslint": "8.57.0",
143
+ "electron": "28.2.1",
144
+ "eslint": "8.56.0",
142
145
  "eslint-config-airbnb-base": "15.0.0",
143
- "eslint-plugin-import": "2.30.0",
144
- "eslint-plugin-mocha": "10.5.0",
146
+ "eslint-plugin-import": "2.29.1",
147
+ "eslint-plugin-mocha": "6.3.0",
145
148
  "expect": "29.7.0",
146
149
  "express": "4.19.2",
147
- "graphql": "16.9.0",
148
- "husky": "9.1.6",
150
+ "graphql": "14.6.0",
151
+ "husky": "8.0.3",
149
152
  "inquirer-test": "2.0.1",
150
- "jsdoc": "4.0.3",
153
+ "jsdoc": "3.6.11",
151
154
  "jsdoc-typeof-plugin": "1.0.0",
152
155
  "json-server": "0.10.1",
153
- "playwright": "1.45.3",
154
- "prettier": "^3.3.2",
155
- "puppeteer": "23.3.0",
156
+ "playwright": "1.42.1",
157
+ "puppeteer": "22.6.0",
156
158
  "qrcode-terminal": "0.12.0",
157
159
  "rosie": "2.1.1",
158
160
  "runok": "0.9.3",
159
- "semver": "7.6.3",
160
- "sinon": "18.0.0",
161
+ "sinon": "17.0.1",
161
162
  "sinon-chai": "3.7.0",
162
163
  "testcafe": "3.5.0",
163
- "ts-morph": "23.0.0",
164
+ "ts-morph": "21.0.1",
164
165
  "ts-node": "10.9.2",
165
- "tsd": "^0.31.0",
166
+ "tsd": "^0.30.7",
166
167
  "tsd-jsdoc": "2.5.0",
167
- "typedoc": "0.26.7",
168
- "typedoc-plugin-markdown": "4.2.6",
169
- "typescript": "5.6.2",
168
+ "typedoc": "0.25.12",
169
+ "typedoc-plugin-markdown": "3.17.1",
170
+ "typescript": "5.3.3",
170
171
  "wdio-docker-service": "1.5.0",
171
- "webdriverio": "8.39.1",
172
+ "webdriverio": "8.33.1",
172
173
  "xml2js": "0.6.2",
173
174
  "xpath": "0.0.34"
174
175
  },
@@ -176,6 +177,7 @@
176
177
  "node": ">=16.0",
177
178
  "npm": ">=5.6.0"
178
179
  },
180
+ "type": "module",
179
181
  "es6": true,
180
182
  "tsd": {
181
183
  "directory": "typings",
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'Ich',
3
3
  contexts: {
4
4
  Feature: 'Funktionalität',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'Je',
3
3
  contexts: {
4
4
  Feature: 'Fonctionnalité',
@@ -1,9 +1,13 @@
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')
1
+ import de_DE from './de-DE.js';
2
+ import it_IT from './it-IT.js';
3
+ import fr_FR from './fr-FR.js';
4
+ import ja_JP from './ja-JP.js';
5
+ import pl_PL from './pl-PL.js';
6
+ import pt_BR from './pt-BR.js';
7
+ import ru_RU from './ru-RU.js';
8
+ import zh_CN from './zh-CN.js';
9
+ import zh_TW from './zh-TW.js';
10
+
11
+ export {
12
+ de_DE, it_IT, ja_JP, pl_PL, pt_BR, ru_RU, zh_CN, zh_TW, fr_FR,
13
+ };
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'io',
3
3
  contexts: {
4
4
  Feature: 'Caratteristica',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: '私は',
3
3
  contexts: {
4
4
  Feature: 'フィーチャ',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'Ja',
3
3
  contexts: {
4
4
  Feature: 'Funkcja',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'Eu',
3
3
  contexts: {
4
4
  Feature: 'Funcionalidade',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: 'Я',
3
3
  contexts: {
4
4
  Feature: 'Цель',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: '我',
3
3
  contexts: {
4
4
  Feature: '功能',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  I: '我',
3
3
  contexts: {
4
4
  Feature: '功能',