codeceptjs 4.0.0-beta.1 → 4.0.0-beta.3

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 (151) hide show
  1. package/bin/codecept.js +84 -81
  2. package/lib/actor.js +13 -13
  3. package/lib/ai.js +10 -13
  4. package/lib/assert/empty.js +20 -21
  5. package/lib/assert/equal.js +37 -39
  6. package/lib/assert/error.js +14 -14
  7. package/lib/assert/include.js +46 -47
  8. package/lib/assert/throws.js +13 -11
  9. package/lib/assert/truth.js +19 -22
  10. package/lib/assert.js +4 -2
  11. package/lib/cli.js +57 -49
  12. package/lib/codecept.js +142 -155
  13. package/lib/colorUtils.js +3 -3
  14. package/lib/command/configMigrate.js +58 -52
  15. package/lib/command/definitions.js +88 -89
  16. package/lib/command/dryRun.js +71 -68
  17. package/lib/command/generate.js +197 -188
  18. package/lib/command/gherkin/init.js +27 -16
  19. package/lib/command/gherkin/snippets.js +20 -20
  20. package/lib/command/gherkin/steps.js +8 -8
  21. package/lib/command/info.js +40 -38
  22. package/lib/command/init.js +290 -288
  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 +6 -2
  28. package/lib/command/run-multiple.js +113 -93
  29. package/lib/command/run-rerun.js +20 -25
  30. package/lib/command/run-workers.js +64 -66
  31. package/lib/command/run.js +26 -29
  32. package/lib/command/utils.js +80 -65
  33. package/lib/command/workers/runTests.js +10 -10
  34. package/lib/config.js +10 -9
  35. package/lib/container.js +40 -48
  36. package/lib/data/context.js +60 -59
  37. package/lib/data/dataScenarioConfig.js +47 -47
  38. package/lib/data/dataTableArgument.js +29 -29
  39. package/lib/data/table.js +26 -20
  40. package/lib/event.js +163 -167
  41. package/lib/heal.js +13 -17
  42. package/lib/helper/AI.js +130 -41
  43. package/lib/helper/ApiDataFactory.js +73 -69
  44. package/lib/helper/Appium.js +413 -382
  45. package/lib/helper/ExpectHelper.js +40 -48
  46. package/lib/helper/FileSystem.js +80 -79
  47. package/lib/helper/GraphQL.js +44 -43
  48. package/lib/helper/GraphQLDataFactory.js +50 -50
  49. package/lib/helper/JSONResponse.js +65 -62
  50. package/lib/helper/Mochawesome.js +28 -28
  51. package/lib/helper/MockServer.js +12 -14
  52. package/lib/helper/Nightmare.js +662 -566
  53. package/lib/helper/Playwright.js +1361 -1216
  54. package/lib/helper/Protractor.js +663 -627
  55. package/lib/helper/Puppeteer.js +1231 -1128
  56. package/lib/helper/REST.js +159 -68
  57. package/lib/helper/SoftExpectHelper.js +2 -2
  58. package/lib/helper/TestCafe.js +490 -484
  59. package/lib/helper/WebDriver.js +1297 -1156
  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 +2 -2
  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 +3 -2
  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 +6 -7
  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 +6 -10
  97. package/lib/mochaFactory.js +18 -15
  98. package/lib/output.js +6 -10
  99. package/lib/parser.js +15 -12
  100. package/lib/pause.js +40 -33
  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 +115 -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 -2
  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 -32
  136. package/package.json +56 -57
  137. package/translations/de-DE.js +1 -1
  138. package/translations/fr-FR.js +1 -1
  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 +415 -65
  148. package/typings/promiseBasedTypes.d.ts +32 -0
  149. package/typings/types.d.ts +32 -0
  150. package/lib/dirname.js +0 -5
  151. package/lib/helper/Expect.js +0 -425
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.3",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -37,11 +37,12 @@
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.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'",
@@ -55,34 +56,32 @@
55
56
  "test:unit:webbapi:webDriver:noSeleniumServer": "mocha test/helper/WebDriver.noSeleniumServer_test.js",
56
57
  "test:unit:webbapi:webDriver:devtools": "mocha test/helper/WebDriver_devtools_test.js --exit",
57
58
  "test:unit:webbapi:testCafe": "mocha test/helper/TestCafe_test.js",
58
- "test:unit:expect": "mocha test/helper/Expect_test.js --exit",
59
+ "test:unit:expect": "mocha test/helper/Expect_test.js",
59
60
  "test:unit:mockServer": "mocha test/helper/MockServer_test.js",
60
61
  "test:plugin": "mocha test/plugin/plugin_test.js",
61
- "def": "./runok.cjs def",
62
+ "def": "./runok.js def",
62
63
  "dev:graphql": "node test/data/graphql/index.js",
63
- "publish:site": "./runok.cjs publish:site",
64
- "update-contributor-faces": "./runok.cjs contributor:faces",
64
+ "publish:site": "./runok.js publish:site",
65
+ "update-contributor-faces": "./runok.js contributor:faces",
65
66
  "types-fix": "node typings/fixDefFiles.js",
66
67
  "dtslint": "npm run types-fix && tsd",
67
68
  "prepare": "husky install",
68
- "prepare-release": "./runok.cjs versioning && ./runok.cjs get:commit-log"
69
+ "prepare-release": "./runok.js versioning && ./runok.js get:commit-log",
70
+ "publish-beta": "./runok.js publish:next-beta-version"
69
71
  },
70
72
  "dependencies": {
71
- "@babel/core": "^7.23.9",
72
- "@codeceptjs/configure": "0.10.0",
73
- "@codeceptjs/helper": "^2.0.3",
73
+ "@codeceptjs/configure": "1.0.1",
74
+ "@codeceptjs/helper": "2.0.4",
74
75
  "@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",
76
+ "@cucumber/gherkin": "29",
77
+ "@cucumber/messages": "25.0.1",
78
+ "@xmldom/xmldom": "0.9.4",
79
+ "acorn": "8.12.1",
80
80
  "arrify": "2.0.1",
81
- "axios": "1.6.7",
82
- "babel-register-esm": "^1.2.5",
83
- "chai": "5.0.3",
81
+ "axios": "1.7.7",
82
+ "chai": "5.1.1",
84
83
  "chai-deep-match": "1.2.1",
85
- "chai-exclude": "2.1.0",
84
+ "chai-exclude": "2.1.1",
86
85
  "chai-json-schema": "1.5.1",
87
86
  "chai-json-schema-ajv": "5.2.4",
88
87
  "chai-match-pattern": "1.3.0",
@@ -92,84 +91,85 @@
92
91
  "cross-spawn": "7.0.3",
93
92
  "css-to-xpath": "0.1.0",
94
93
  "csstoxpath": "1.6.0",
95
- "debug": "^4.3.4",
96
- "devtools": "8.33.1",
97
- "envinfo": "7.11.1",
94
+ "devtools": "8.40.2",
95
+ "envinfo": "7.14.0",
98
96
  "escape-string-regexp": "4.0.0",
99
97
  "figures": "3.2.0",
100
98
  "fn-args": "4.0.0",
101
99
  "fs-extra": "11.2.0",
102
100
  "glob": "6.0.1",
103
101
  "html-minifier-terser": "7.2.0",
104
- "import-sync": "2.2.0",
105
102
  "inquirer": "6.5.2",
106
- "joi": "17.12.2",
103
+ "joi": "17.13.3",
107
104
  "js-beautify": "1.15.1",
108
105
  "lodash.clonedeep": "4.5.0",
109
106
  "lodash.merge": "4.6.2",
110
107
  "mkdirp": "1.0.4",
111
- "mocha": "10.3.0",
112
- "monocart-coverage-reports": "2.7.8",
108
+ "mocha": "10.7.3",
109
+ "monocart-coverage-reports": "2.10.3",
113
110
  "ms": "2.1.3",
114
111
  "ora-classic": "5.4.2",
115
- "pactum": "3.6.1",
112
+ "pactum": "3.7.1",
116
113
  "parse-function": "5.6.10",
117
114
  "parse5": "7.1.2",
118
115
  "promise-retry": "1.1.1",
119
116
  "resq": "1.11.0",
120
117
  "sprintf-js": "1.1.1",
121
- "uuid": "9.0"
118
+ "uuid": "10.0"
122
119
  },
123
120
  "optionalDependencies": {
124
- "@codeceptjs/detox-helper": "1.0.5"
121
+ "@codeceptjs/detox-helper": "1.1.2"
125
122
  },
126
123
  "devDependencies": {
127
124
  "@codeceptjs/mock-request": "0.3.1",
128
- "@faker-js/faker": "7.6.0",
125
+ "@faker-js/faker": "9.0.3",
129
126
  "@pollyjs/adapter-puppeteer": "6.0.6",
130
127
  "@pollyjs/core": "5.1.0",
131
- "@types/chai": "4.3.12",
128
+ "@types/chai": "4.3.19",
132
129
  "@types/inquirer": "9.0.3",
133
- "@types/node": "20.11.30",
134
- "@wdio/sauce-service": "8.32.3",
130
+ "@types/node": "22.5.5",
131
+ "@wdio/sauce-service": "9.0.9",
135
132
  "@wdio/selenium-standalone-service": "8.3.2",
136
- "@wdio/utils": "8.33.1",
137
- "@xmldom/xmldom": "0.8.10",
133
+ "@wdio/utils": "9.1.2",
134
+ "@xmldom/xmldom": "0.9.4",
138
135
  "apollo-server-express": "2.25.3",
139
- "chai-as-promised": "7.1.1",
136
+ "chai-as-promised": "7.1.2",
140
137
  "chai-subset": "1.6.0",
138
+ "cheerio": "^1.0.0",
141
139
  "contributor-faces": "1.1.0",
142
140
  "documentation": "12.3.0",
143
- "electron": "28.2.1",
144
- "eslint": "8.56.0",
141
+ "electron": "31.3.1",
142
+ "eslint": "8.57.0",
145
143
  "eslint-config-airbnb-base": "15.0.0",
146
- "eslint-plugin-import": "2.29.1",
147
- "eslint-plugin-mocha": "6.3.0",
144
+ "eslint-plugin-import": "2.30.0",
145
+ "eslint-plugin-mocha": "10.5.0",
148
146
  "expect": "29.7.0",
149
147
  "express": "4.19.2",
150
- "graphql": "14.6.0",
151
- "husky": "8.0.3",
148
+ "graphql": "16.9.0",
149
+ "husky": "9.1.6",
152
150
  "inquirer-test": "2.0.1",
153
- "jsdoc": "3.6.11",
151
+ "jsdoc": "4.0.3",
154
152
  "jsdoc-typeof-plugin": "1.0.0",
155
153
  "json-server": "0.10.1",
156
- "playwright": "1.42.1",
157
- "puppeteer": "22.6.0",
154
+ "playwright": "1.45.3",
155
+ "prettier": "^3.3.2",
156
+ "puppeteer": "23.3.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": "18.0.0",
162
162
  "sinon-chai": "3.7.0",
163
163
  "testcafe": "3.5.0",
164
- "ts-morph": "21.0.1",
164
+ "ts-morph": "23.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.7",
169
+ "typedoc-plugin-markdown": "4.2.9",
170
+ "typescript": "5.6.3",
171
171
  "wdio-docker-service": "1.5.0",
172
- "webdriverio": "8.33.1",
172
+ "webdriverio": "8.39.1",
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',
@@ -1,4 +1,4 @@
1
- export default {
1
+ module.exports = {
2
2
  I: 'Je',
3
3
  contexts: {
4
4
  Feature: 'Fonctionnalité',
@@ -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: '功能',