codeceptjs 4.0.0-beta.2 → 4.0.0-beta.4

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