codeceptjs 3.7.0-beta.8 → 3.7.0-rc.1

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 (46) hide show
  1. package/lib/codecept.js +14 -12
  2. package/lib/command/check.js +11 -2
  3. package/lib/command/definitions.js +1 -1
  4. package/lib/command/gherkin/snippets.js +69 -69
  5. package/lib/command/interactive.js +1 -1
  6. package/lib/command/run-multiple/chunk.js +48 -45
  7. package/lib/container.js +14 -7
  8. package/lib/els.js +87 -106
  9. package/lib/helper/AI.js +2 -1
  10. package/lib/helper/Playwright.js +7 -1
  11. package/lib/listener/store.js +9 -1
  12. package/lib/mocha/asyncWrapper.js +6 -4
  13. package/lib/mocha/cli.js +15 -7
  14. package/lib/mocha/gherkin.js +1 -1
  15. package/lib/mocha/inject.js +5 -0
  16. package/lib/output.js +1 -1
  17. package/lib/plugin/analyze.js +14 -17
  18. package/lib/plugin/auth.js +435 -0
  19. package/lib/plugin/autoDelay.js +2 -2
  20. package/lib/plugin/autoLogin.js +3 -337
  21. package/lib/plugin/pageInfo.js +1 -4
  22. package/lib/plugin/retryTo.js +6 -17
  23. package/lib/plugin/screenshotOnFail.js +8 -11
  24. package/lib/plugin/standardActingHelpers.js +4 -1
  25. package/lib/plugin/stepByStepReport.js +6 -5
  26. package/lib/plugin/tryTo.js +6 -15
  27. package/lib/step/base.js +15 -4
  28. package/lib/step/comment.js +10 -0
  29. package/lib/step/func.js +46 -0
  30. package/lib/step.js +6 -0
  31. package/lib/store.js +2 -0
  32. package/package.json +21 -20
  33. package/translations/de-DE.js +4 -3
  34. package/translations/fr-FR.js +4 -3
  35. package/translations/index.js +1 -0
  36. package/translations/it-IT.js +4 -3
  37. package/translations/ja-JP.js +4 -3
  38. package/translations/nl-NL.js +76 -0
  39. package/translations/pl-PL.js +4 -3
  40. package/translations/pt-BR.js +4 -3
  41. package/translations/ru-RU.js +4 -3
  42. package/translations/utils.js +9 -0
  43. package/translations/zh-CN.js +4 -3
  44. package/translations/zh-TW.js +4 -3
  45. package/typings/promiseBasedTypes.d.ts +0 -18
  46. package/typings/types.d.ts +10 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.0-beta.8",
3
+ "version": "3.7.0-rc.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -31,6 +31,7 @@
31
31
  "main": "lib/index.js",
32
32
  "exports": {
33
33
  ".": "./lib/index.js",
34
+ "./lib/*": "./lib/*.js",
34
35
  "./els": "./lib/els.js",
35
36
  "./effects": "./lib/effects.js",
36
37
  "./steps": "./lib/steps.js"
@@ -74,12 +75,12 @@
74
75
  "publish-beta": "./runok.js publish:next-beta-version"
75
76
  },
76
77
  "dependencies": {
77
- "@codeceptjs/configure": "1.0.1",
78
+ "@codeceptjs/configure": "1.0.2",
78
79
  "@codeceptjs/helper": "2.0.4",
79
80
  "@cucumber/cucumber-expressions": "18",
80
- "@cucumber/gherkin": "30",
81
- "@cucumber/messages": "27.0.2",
82
- "@xmldom/xmldom": "0.9.6",
81
+ "@cucumber/gherkin": "31",
82
+ "@cucumber/messages": "27.2.0",
83
+ "@xmldom/xmldom": "0.9.7",
83
84
  "acorn": "8.14.0",
84
85
  "arrify": "3.0.0",
85
86
  "axios": "1.7.9",
@@ -93,8 +94,8 @@
93
94
  "escape-string-regexp": "4.0.0",
94
95
  "figures": "3.2.0",
95
96
  "fn-args": "4.0.0",
96
- "fs-extra": "11.2.0",
97
- "glob": "^11.0.1",
97
+ "fs-extra": "11.3.0",
98
+ "glob": ">=9.0.0 <12",
98
99
  "fuse.js": "^7.0.0",
99
100
  "html-minifier-terser": "7.2.0",
100
101
  "inquirer": "6.5.2",
@@ -105,7 +106,7 @@
105
106
  "lodash.merge": "4.6.2",
106
107
  "mkdirp": "3.0.1",
107
108
  "mocha": "11.1.0",
108
- "monocart-coverage-reports": "2.11.5",
109
+ "monocart-coverage-reports": "2.12.0",
109
110
  "ms": "2.1.3",
110
111
  "ora-classic": "5.4.2",
111
112
  "parse-function": "5.6.10",
@@ -123,23 +124,23 @@
123
124
  "@codeceptjs/expect-helper": "^0.2.2",
124
125
  "@codeceptjs/mock-request": "0.3.1",
125
126
  "@eslint/eslintrc": "3.2.0",
126
- "@eslint/js": "9.18.0",
127
+ "@eslint/js": "9.19.0",
127
128
  "@faker-js/faker": "9.4.0",
128
129
  "@pollyjs/adapter-puppeteer": "6.0.6",
129
130
  "@pollyjs/core": "5.1.0",
130
131
  "@types/chai": "4.3.19",
131
132
  "@types/inquirer": "9.0.7",
132
- "@types/node": "22.10.7",
133
- "@wdio/sauce-service": "9.5.7",
133
+ "@types/node": "22.13.0",
134
+ "@wdio/sauce-service": "9.7.2",
134
135
  "@wdio/selenium-standalone-service": "8.15.0",
135
- "@wdio/utils": "9.5.0",
136
- "@xmldom/xmldom": "0.9.6",
136
+ "@wdio/utils": "9.7.2",
137
+ "@xmldom/xmldom": "0.9.7",
137
138
  "chai": "^4.0.0",
138
139
  "chai-as-promised": "7.1.2",
139
140
  "chai-subset": "1.6.0",
140
141
  "documentation": "14.0.3",
141
- "electron": "34.0.0",
142
- "eslint": "^9.18.0",
142
+ "electron": "34.0.2",
143
+ "eslint": "^9.19.0",
143
144
  "eslint-plugin-import": "2.31.0",
144
145
  "eslint-plugin-mocha": "10.5.0",
145
146
  "expect": "29.7.0",
@@ -152,13 +153,13 @@
152
153
  "jsdoc": "^3.6.11",
153
154
  "jsdoc-typeof-plugin": "1.0.0",
154
155
  "json-server": "0.17.4",
155
- "playwright": "1.49.1",
156
+ "playwright": "1.50.1",
156
157
  "prettier": "^3.3.2",
157
- "puppeteer": "24.0.0",
158
+ "puppeteer": "24.1.1",
158
159
  "qrcode-terminal": "0.12.0",
159
160
  "rosie": "2.1.1",
160
161
  "runok": "0.9.3",
161
- "semver": "7.6.3",
162
+ "semver": "7.7.0",
162
163
  "sinon": "19.0.2",
163
164
  "sinon-chai": "3.7.0",
164
165
  "testcafe": "3.7.1",
@@ -169,8 +170,8 @@
169
170
  "typedoc": "0.27.6",
170
171
  "typedoc-plugin-markdown": "4.4.1",
171
172
  "typescript": "5.7.3",
172
- "wdio-docker-service": "1.5.0",
173
- "webdriverio": "^9.5.1",
173
+ "wdio-docker-service": "3.2.1",
174
+ "webdriverio": "9.7.2",
174
175
  "xml2js": "0.6.2",
175
176
  "xpath": "0.0.34"
176
177
  },
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'de'
3
+
1
4
  module.exports = {
2
5
  I: 'Ich',
3
6
  contexts: {
4
- Feature: 'Funktionalität',
5
- Scenario: 'Szenario',
6
- ScenarioOutline: 'Szenariogrundriss',
7
+ ...gherkinTranslations(langCode),
7
8
  },
8
9
  actions: {
9
10
  amOutsideAngularApp: 'befinde_mich_außerhalb_der_angular_app',
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'fr'
3
+
1
4
  module.exports = {
2
5
  I: 'Je',
3
6
  contexts: {
4
- Feature: 'Fonctionnalité',
5
- Scenario: 'Scénario',
6
- ScenarioOutline: 'Plan du scénario',
7
+ ...gherkinTranslations(langCode),
7
8
  Before: 'Avant',
8
9
  After: 'Après',
9
10
  BeforeSuite: 'AvantLaSuite',
@@ -7,3 +7,4 @@ exports['pt-BR'] = require('./pt-BR')
7
7
  exports['ru-RU'] = require('./ru-RU')
8
8
  exports['zh-CN'] = require('./zh-CN')
9
9
  exports['zh-TW'] = require('./zh-TW')
10
+ exports['nl-NL'] = require('./nl-NL')
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'it'
3
+
1
4
  module.exports = {
2
5
  I: 'io',
3
6
  contexts: {
4
- Feature: 'Caratteristica',
5
- Scenario: 'lo_scenario',
6
- ScenarioOutline: 'Schema dello scenario',
7
+ ...gherkinTranslations(langCode),
7
8
  Before: 'Prima',
8
9
  After: 'Dopo',
9
10
  BeforeSuite: 'Prima_della_suite',
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'ja'
3
+
1
4
  module.exports = {
2
5
  I: '私は',
3
6
  contexts: {
4
- Feature: 'フィーチャ',
5
- Scenario: 'シナリオ',
6
- ScenarioOutline: 'シナリオアウトライン',
7
+ ...gherkinTranslations(langCode),
7
8
  },
8
9
  actions: {
9
10
  amOutsideAngularApp: 'Angularの外に出る',
@@ -0,0 +1,76 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'nl'
3
+
4
+ module.exports = {
5
+ I: 'Ik',
6
+ contexts: {
7
+ ...gherkinTranslations(langCode),
8
+ },
9
+ actions: {
10
+ amOutsideAngularApp: 'ben_buiten_angular_app',
11
+ amInsideAngularApp: 'ben_binnen_angular_app',
12
+ waitForElement: 'wacht_op_element',
13
+ waitForClickable: 'wacht_tot_klikbaar',
14
+ waitForVisible: 'wacht_tot_zichtbaar',
15
+ waitForEnabled: 'wacht_tot_ingeschakeld',
16
+ waitForInvisible: 'wacht_tot_onzichtbaar',
17
+ waitInUrl: 'wacht_in_url',
18
+ waitForText: 'wacht_op_tekst',
19
+ moveTo: 'beweeg_de_cursor_naar',
20
+ refresh: 'vernieuw_pagina',
21
+ refreshPage: 'vernieuw_pagina',
22
+ haveModule: 'heb_module',
23
+ resetModule: 'reset_module',
24
+ amOnPage: 'ben_op_pagina',
25
+ click: 'klik',
26
+ doubleClick: 'dubbelklik',
27
+ see: 'zie',
28
+ dontSee: 'zie_niet',
29
+ selectOption: 'selecteer_optie',
30
+ fillField: 'vul_veld_in',
31
+ pressKey: 'druk_op_toets',
32
+ triggerMouseEvent: 'trigger_een_muis_event',
33
+ attachFile: 'voeg_bestand_toe',
34
+ seeInField: 'zie_in_veld',
35
+ dontSeeInField: 'zie_niet_in_veld',
36
+ appendField: 'voeg_toe_aan_veld',
37
+ checkOption: 'vink_optie_aan',
38
+ seeCheckboxIsChecked: 'zie_dat_checkbox_aangevinkt_is',
39
+ dontSeeCheckboxIsChecked: 'zie_niet_dat_checkbox_aangevinkt_is',
40
+ grabTextFrom: 'pak_tekst_van',
41
+ grabValueFrom: 'pak_waarde_van',
42
+ grabAttributeFrom: 'pak_attribuut_van',
43
+ seeInTitle: 'zie_in_titel',
44
+ dontSeeInTitle: 'zie_niet_in_titel',
45
+ grabTitle: 'pak_titel',
46
+ seeElement: 'zie_element',
47
+ dontSeeElement: 'zie_element_niet',
48
+ seeInSource: 'zie_in_broncode',
49
+ dontSeeInSource: 'zie_niet_in_broncode',
50
+ executeScript: 'voer_script_uit',
51
+ executeAsyncScript: 'voer_asynchroon_script_uit',
52
+ seeInCurrentUrl: 'zie_in_huidige_url',
53
+ dontSeeInCurrentUrl: 'zie_niet_in_huidige_url',
54
+ seeCurrentUrlEquals: 'zie_dat_url_gelijk_is',
55
+ dontSeeCurrentUrlEquals: 'zie_dat_url_niet_gelijk_is',
56
+ saveScreenshot: 'sla_screenshot_op',
57
+ setCookie: 'stel_cookie_in',
58
+ clearCookie: 'verwijder_cookie',
59
+ seeCookie: 'zie_cookie',
60
+ dontSeeCookie: 'zie_cookie_niet',
61
+ grabCookie: 'pak_cookie',
62
+ resizeWindow: 'verander_venstergrootte',
63
+ wait: 'wacht',
64
+ haveHeader: 'gebruik_http_header',
65
+ clearField: 'wis_veld',
66
+ dontSeeElementInDOM: 'zie_element_niet_in_DOM',
67
+ moveCursorTo: 'beweeg_de_cursor_naar',
68
+ scrollTo: 'scroll_naar',
69
+ sendGetRequest: 'doe_een_get_verzoek',
70
+ sendPutRequest: 'doe_een_put_verzoek',
71
+ sendDeleteRequest: 'doe_een_delete_verzoek',
72
+ sendDeleteRequestWithPayload: 'doe_een_delete_verzoek_met_payload',
73
+ sendPostRequest: 'doe_een_post_verzoek',
74
+ switchTo: 'wissel_naar_iframe',
75
+ },
76
+ }
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'pl'
3
+
1
4
  module.exports = {
2
5
  I: 'Ja',
3
6
  contexts: {
4
- Feature: 'Funkcja',
5
- Scenario: 'Scenariusz',
6
- ScenarioOutline: 'Szablon scenariusza',
7
+ ...gherkinTranslations(langCode),
7
8
  },
8
9
  actions: {
9
10
  amOutsideAngularApp: 'jestem_poza_aplikacją_angular',
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'pt'
3
+
1
4
  module.exports = {
2
5
  I: 'Eu',
3
6
  contexts: {
4
- Feature: 'Funcionalidade',
5
- Scenario: 'Cenário',
6
- ScenarioOutline: 'Esquema do Cenário',
7
+ ...gherkinTranslations(langCode),
7
8
  Before: 'Antes',
8
9
  After: 'Depois',
9
10
  BeforeSuite: 'AntesDaSuite',
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'ru'
3
+
1
4
  module.exports = {
2
5
  I: 'Я',
3
6
  contexts: {
4
- Feature: 'Цель',
5
- Scenario: 'Сценарий',
6
- ScenarioOutline: 'Структура сценария',
7
+ ...gherkinTranslations(langCode),
7
8
  Before: 'Начало',
8
9
  After: 'Конец',
9
10
  BeforeSuite: 'Перед_всем',
@@ -0,0 +1,9 @@
1
+ module.exports.gherkinTranslations = function (langCode) {
2
+ const gherkinLanguages = require('@cucumber/gherkin/src/gherkin-languages.json')
3
+ const { feature, scenario, scenarioOutline } = gherkinLanguages[langCode]
4
+ return {
5
+ Feature: feature[0],
6
+ Scenario: scenario[0],
7
+ ScenarioOutline: scenarioOutline[0],
8
+ }
9
+ }
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'zh-CN'
3
+
1
4
  module.exports = {
2
5
  I: '我',
3
6
  contexts: {
4
- Feature: '功能',
5
- Scenario: '场景',
6
- ScenarioOutline: '场景大纲',
7
+ ...gherkinTranslations(langCode),
7
8
  },
8
9
  actions: {
9
10
  amOutsideAngularApp: '在Angular应用外',
@@ -1,9 +1,10 @@
1
+ const { gherkinTranslations } = require('./utils')
2
+ const langCode = 'zh-TW'
3
+
1
4
  module.exports = {
2
5
  I: '我',
3
6
  contexts: {
4
- Feature: '功能',
5
- Scenario: '場景',
6
- ScenarioOutline: '場景大綱',
7
+ ...gherkinTranslations(langCode),
7
8
  },
8
9
  actions: {
9
10
  amOutsideAngularApp: '在Angular應用外',
@@ -1764,9 +1764,6 @@ declare namespace CodeceptJS {
1764
1764
  // @ts-ignore
1765
1765
  // @ts-ignore
1766
1766
  // @ts-ignore
1767
- // @ts-ignore
1768
- // @ts-ignore
1769
- // @ts-ignore
1770
1767
  type MockServerConfig = {
1771
1768
  port?: number;
1772
1769
  host?: string;
@@ -1896,9 +1893,6 @@ declare namespace CodeceptJS {
1896
1893
  // @ts-ignore
1897
1894
  // @ts-ignore
1898
1895
  // @ts-ignore
1899
- // @ts-ignore
1900
- // @ts-ignore
1901
- // @ts-ignore
1902
1896
  class MockServer {
1903
1897
  /**
1904
1898
  * Start the mock server
@@ -2937,9 +2931,6 @@ declare namespace CodeceptJS {
2937
2931
  // @ts-ignore
2938
2932
  // @ts-ignore
2939
2933
  // @ts-ignore
2940
- // @ts-ignore
2941
- // @ts-ignore
2942
- // @ts-ignore
2943
2934
  type PlaywrightConfig = {
2944
2935
  url?: string;
2945
2936
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6321,9 +6312,6 @@ declare namespace CodeceptJS {
6321
6312
  // @ts-ignore
6322
6313
  // @ts-ignore
6323
6314
  // @ts-ignore
6324
- // @ts-ignore
6325
- // @ts-ignore
6326
- // @ts-ignore
6327
6315
  type PuppeteerConfig = {
6328
6316
  url: string;
6329
6317
  basicAuth?: any;
@@ -8135,9 +8123,6 @@ declare namespace CodeceptJS {
8135
8123
  // @ts-ignore
8136
8124
  // @ts-ignore
8137
8125
  // @ts-ignore
8138
- // @ts-ignore
8139
- // @ts-ignore
8140
- // @ts-ignore
8141
8126
  type RESTConfig = {
8142
8127
  endpoint?: string;
8143
8128
  prettyPrintJson?: boolean;
@@ -9287,9 +9272,6 @@ declare namespace CodeceptJS {
9287
9272
  // @ts-ignore
9288
9273
  // @ts-ignore
9289
9274
  // @ts-ignore
9290
- // @ts-ignore
9291
- // @ts-ignore
9292
- // @ts-ignore
9293
9275
  type WebDriverConfig = {
9294
9276
  url: string;
9295
9277
  browser: string;
@@ -1791,9 +1791,6 @@ declare namespace CodeceptJS {
1791
1791
  // @ts-ignore
1792
1792
  // @ts-ignore
1793
1793
  // @ts-ignore
1794
- // @ts-ignore
1795
- // @ts-ignore
1796
- // @ts-ignore
1797
1794
  type MockServerConfig = {
1798
1795
  port?: number;
1799
1796
  host?: string;
@@ -1923,9 +1920,6 @@ declare namespace CodeceptJS {
1923
1920
  // @ts-ignore
1924
1921
  // @ts-ignore
1925
1922
  // @ts-ignore
1926
- // @ts-ignore
1927
- // @ts-ignore
1928
- // @ts-ignore
1929
1923
  class MockServer {
1930
1924
  /**
1931
1925
  * Start the mock server
@@ -3030,9 +3024,6 @@ declare namespace CodeceptJS {
3030
3024
  // @ts-ignore
3031
3025
  // @ts-ignore
3032
3026
  // @ts-ignore
3033
- // @ts-ignore
3034
- // @ts-ignore
3035
- // @ts-ignore
3036
3027
  type PlaywrightConfig = {
3037
3028
  url?: string;
3038
3029
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6565,9 +6556,6 @@ declare namespace CodeceptJS {
6565
6556
  // @ts-ignore
6566
6557
  // @ts-ignore
6567
6558
  // @ts-ignore
6568
- // @ts-ignore
6569
- // @ts-ignore
6570
- // @ts-ignore
6571
6559
  type PuppeteerConfig = {
6572
6560
  url: string;
6573
6561
  basicAuth?: any;
@@ -8515,9 +8503,6 @@ declare namespace CodeceptJS {
8515
8503
  // @ts-ignore
8516
8504
  // @ts-ignore
8517
8505
  // @ts-ignore
8518
- // @ts-ignore
8519
- // @ts-ignore
8520
- // @ts-ignore
8521
8506
  type RESTConfig = {
8522
8507
  endpoint?: string;
8523
8508
  prettyPrintJson?: boolean;
@@ -9727,9 +9712,6 @@ declare namespace CodeceptJS {
9727
9712
  // @ts-ignore
9728
9713
  // @ts-ignore
9729
9714
  // @ts-ignore
9730
- // @ts-ignore
9731
- // @ts-ignore
9732
- // @ts-ignore
9733
9715
  type WebDriverConfig = {
9734
9716
  url: string;
9735
9717
  browser: string;
@@ -11861,6 +11843,10 @@ declare namespace CodeceptJS {
11861
11843
  * @param options - set {local: true} to not share among workers
11862
11844
  */
11863
11845
  static share(data: any, options: any): void;
11846
+ /**
11847
+ * List of helpers that are used in CodeceptJS and can't be used together
11848
+ */
11849
+ static STANDARD_ACTING_HELPERS: string[];
11864
11850
  }
11865
11851
  /**
11866
11852
  * Method collect own property and prototype
@@ -12258,6 +12244,7 @@ declare namespace CodeceptJS {
12258
12244
  var onPause: boolean;
12259
12245
  var currentTest: CodeceptJS.Test | null;
12260
12246
  var currentStep: any;
12247
+ var currentSuite: CodeceptJS.Suite | null;
12261
12248
  }
12262
12249
  /**
12263
12250
  * Describe a "suite" with the given `title`
@@ -13007,3 +12994,8 @@ declare var helper: CodeceptJS.Helper;
13007
12994
  */
13008
12995
  declare var helperMethod: string;
13009
12996
 
12997
+ /**
12998
+ * hide children steps from output
12999
+ */
13000
+ declare var collsapsed: boolean;
13001
+