codeceptjs 3.7.2 → 3.7.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.
@@ -3,6 +3,42 @@ const envinfo = require('envinfo')
3
3
  const { getConfig, getTestRoot } = require('./utils')
4
4
  const Codecept = require('../codecept')
5
5
  const output = require('../output')
6
+ const { execSync } = require('child_process')
7
+
8
+ async function getPlaywrightBrowsers() {
9
+ try {
10
+ const regex = /(chromium|firefox|webkit)\s+version\s+([\d.]+)/gi
11
+ let versions = []
12
+
13
+ const info = execSync('npx playwright install --dry-run').toString().trim()
14
+
15
+ const matches = [...info.matchAll(regex)]
16
+
17
+ matches.forEach(match => {
18
+ const browser = match[1]
19
+ const version = match[2]
20
+ versions.push(`${browser}: ${version}`)
21
+ })
22
+
23
+ return versions.join(', ')
24
+ } catch (err) {
25
+ return 'Playwright not installed'
26
+ }
27
+ }
28
+
29
+ async function getOsBrowsers() {
30
+ const chromeInfo = await envinfo.helpers.getChromeInfo()
31
+ const edgeInfo = await envinfo.helpers.getEdgeInfo()
32
+ const firefoxInfo = await envinfo.helpers.getFirefoxInfo()
33
+ const safariInfo = await envinfo.helpers.getSafariInfo()
34
+
35
+ return [
36
+ `chrome: ${chromeInfo ? chromeInfo[1] : 'not installed'}`,
37
+ `edge: ${edgeInfo ? edgeInfo[1] : 'not installed'}`,
38
+ `firefox: ${firefoxInfo ? firefoxInfo[1] : 'not installed'}`,
39
+ `safari: ${safariInfo ? safariInfo[1] : 'not installed'}`,
40
+ ].join(', ')
41
+ }
6
42
 
7
43
  module.exports = async function (path) {
8
44
  const testsPath = getTestRoot(path)
@@ -10,16 +46,15 @@ module.exports = async function (path) {
10
46
  const codecept = new Codecept(config, {})
11
47
  codecept.init(testsPath)
12
48
 
13
- output.print('\n Environment information:-\n')
49
+ output.print('\n Environment information: \n')
14
50
  const info = {}
15
51
  info.codeceptVersion = Codecept.version()
16
52
  info.nodeInfo = await envinfo.helpers.getNodeInfo()
17
53
  info.osInfo = await envinfo.helpers.getOSInfo()
18
54
  info.cpuInfo = await envinfo.helpers.getCPUInfo()
19
- info.chromeInfo = await envinfo.helpers.getChromeInfo()
20
- info.edgeInfo = await envinfo.helpers.getEdgeInfo()
21
- info.firefoxInfo = await envinfo.helpers.getFirefoxInfo()
22
- info.safariInfo = await envinfo.helpers.getSafariInfo()
55
+ info.osBrowsers = await getOsBrowsers()
56
+ info.playwrightBrowsers = await getPlaywrightBrowsers()
57
+
23
58
  const { helpers, plugins } = config
24
59
  info.helpers = helpers || "You don't use any helpers"
25
60
  info.plugins = plugins || "You don't have any enabled plugins"
@@ -47,6 +82,7 @@ module.exports.getMachineInfo = async () => {
47
82
  edgeInfo: await envinfo.helpers.getEdgeInfo(),
48
83
  firefoxInfo: await envinfo.helpers.getFirefoxInfo(),
49
84
  safariInfo: await envinfo.helpers.getSafariInfo(),
85
+ playwrightBrowsers: await getPlaywrightBrowsers(),
50
86
  }
51
87
 
52
88
  output.print('***************************************')
package/lib/container.js CHANGED
@@ -469,7 +469,7 @@ function loadGherkinSteps(paths) {
469
469
  loadSupportObject(path, `Step Definition from ${path}`)
470
470
  }
471
471
  } else {
472
- const folderPath = paths.startsWith('.') ? path.join(global.codecept_dir, paths) : ''
472
+ const folderPath = paths.startsWith('.') ? normalizeAndJoin(global.codecept_dir, paths) : ''
473
473
  if (folderPath !== '') {
474
474
  globSync(folderPath).forEach(file => {
475
475
  loadSupportObject(file, `Step Definition from ${file}`)
@@ -562,3 +562,16 @@ function getHelperModuleName(helperName, config) {
562
562
  // built-in helpers
563
563
  return `./helper/${helperName}`
564
564
  }
565
+ function normalizeAndJoin(basePath, subPath) {
566
+ // Normalize and convert slashes to forward slashes in one step
567
+ const normalizedBase = path.posix.normalize(basePath.replace(/\\/g, '/'))
568
+ const normalizedSub = path.posix.normalize(subPath.replace(/\\/g, '/'))
569
+
570
+ // If subPath is absolute (starts with "/"), return it as the final path
571
+ if (normalizedSub.startsWith('/')) {
572
+ return normalizedSub
573
+ }
574
+
575
+ // Join the paths using POSIX-style
576
+ return path.posix.join(normalizedBase, normalizedSub)
577
+ }
@@ -383,8 +383,10 @@ class Appium extends Webdriver {
383
383
 
384
384
  _buildAppiumEndpoint() {
385
385
  const { protocol, port, hostname, path } = this.browser.options
386
+ // Ensure path does NOT end with a slash to prevent double slashes
387
+ const normalizedPath = path.replace(/\/$/, '')
386
388
  // Build path to Appium REST API endpoint
387
- return `${protocol}://${hostname}:${port}${path}/session/${this.browser.sessionId}`
389
+ return `${protocol}://${hostname}:${port}${normalizedPath}/session/${this.browser.sessionId}`
388
390
  }
389
391
 
390
392
  /**
@@ -4,6 +4,7 @@ let currentSuite
4
4
 
5
5
  const Helper = require('@codeceptjs/helper')
6
6
  const { clearString } = require('../utils')
7
+ const { testToFileName } = require('../mocha/test')
7
8
 
8
9
  class Mochawesome extends Helper {
9
10
  constructor(config) {
@@ -50,7 +51,7 @@ class Mochawesome extends Helper {
50
51
  fileName = clearString(`${test.title}_${currentTest.test.title}`)
51
52
  } else {
52
53
  currentTest = { test }
53
- fileName = clearString(test.title)
54
+ fileName = `${testToFileName(test)}`
54
55
  }
55
56
  if (this.options.uniqueScreenshotNames) {
56
57
  const uuid = test.uuid || test.ctx.test.uuid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -75,15 +75,15 @@
75
75
  "publish-beta": "./runok.js publish:next-beta-version"
76
76
  },
77
77
  "dependencies": {
78
- "@codeceptjs/configure": "1.0.2",
78
+ "@codeceptjs/configure": "1.0.3",
79
79
  "@codeceptjs/helper": "2.0.4",
80
80
  "@cucumber/cucumber-expressions": "18",
81
- "@cucumber/gherkin": "31",
81
+ "@cucumber/gherkin": "32",
82
82
  "@cucumber/messages": "27.2.0",
83
- "@xmldom/xmldom": "0.9.7",
84
- "acorn": "8.14.0",
83
+ "@xmldom/xmldom": "0.9.8",
84
+ "acorn": "8.14.1",
85
85
  "arrify": "3.0.0",
86
- "axios": "1.7.9",
86
+ "axios": "1.8.3",
87
87
  "chalk": "4.1.2",
88
88
  "cheerio": "^1.0.0",
89
89
  "commander": "11.1.0",
@@ -101,12 +101,12 @@
101
101
  "inquirer": "8.2.6",
102
102
  "invisi-data": "^1.0.0",
103
103
  "joi": "17.13.3",
104
- "js-beautify": "1.15.2",
104
+ "js-beautify": "1.15.4",
105
105
  "lodash.clonedeep": "4.5.0",
106
106
  "lodash.merge": "4.6.2",
107
107
  "mkdirp": "3.0.1",
108
108
  "mocha": "11.1.0",
109
- "monocart-coverage-reports": "2.12.1",
109
+ "monocart-coverage-reports": "2.12.3",
110
110
  "ms": "2.1.3",
111
111
  "ora-classic": "5.4.2",
112
112
  "parse-function": "5.6.10",
@@ -114,38 +114,38 @@
114
114
  "promise-retry": "1.1.1",
115
115
  "resq": "1.11.0",
116
116
  "sprintf-js": "1.1.3",
117
- "uuid": "11.0.5"
117
+ "uuid": "11.1.0"
118
118
  },
119
119
  "optionalDependencies": {
120
- "@codeceptjs/detox-helper": "1.1.5"
120
+ "@codeceptjs/detox-helper": "1.1.7"
121
121
  },
122
122
  "devDependencies": {
123
123
  "@apollo/server": "^4",
124
- "@codeceptjs/expect-helper": "^0.2.2",
124
+ "@codeceptjs/expect-helper": "^1.0.1",
125
125
  "@codeceptjs/mock-request": "0.3.1",
126
- "@eslint/eslintrc": "3.2.0",
127
- "@eslint/js": "9.19.0",
128
- "@faker-js/faker": "9.4.0",
126
+ "@eslint/eslintrc": "3.3.0",
127
+ "@eslint/js": "9.22.0",
128
+ "@faker-js/faker": "9.6.0",
129
129
  "@pollyjs/adapter-puppeteer": "6.0.6",
130
- "@pollyjs/core": "5.1.0",
131
- "@types/chai": "4.3.19",
130
+ "@pollyjs/core": "6.0.6",
131
+ "@types/chai": "5.2.0",
132
132
  "@types/inquirer": "9.0.7",
133
- "@types/node": "22.13.0",
134
- "@wdio/sauce-service": "9.7.2",
133
+ "@types/node": "22.13.10",
134
+ "@wdio/sauce-service": "9.12.0",
135
135
  "@wdio/selenium-standalone-service": "8.15.0",
136
- "@wdio/utils": "9.7.2",
137
- "@xmldom/xmldom": "0.9.7",
136
+ "@wdio/utils": "9.11.0",
137
+ "@xmldom/xmldom": "0.9.8",
138
138
  "chai": "^4.0.0",
139
139
  "chai-as-promised": "7.1.2",
140
140
  "chai-subset": "1.6.0",
141
141
  "documentation": "14.0.3",
142
- "electron": "34.0.2",
143
- "eslint": "^9.19.0",
142
+ "electron": "35.0.1",
143
+ "eslint": "^9.21.0",
144
144
  "eslint-plugin-import": "2.31.0",
145
145
  "eslint-plugin-mocha": "10.5.0",
146
146
  "expect": "29.7.0",
147
147
  "express": "4.21.2",
148
- "globals": "15.14.0",
148
+ "globals": "16.0.0",
149
149
  "graphql": "16.10.0",
150
150
  "graphql-tag": "^2.12.6",
151
151
  "husky": "9.1.7",
@@ -153,25 +153,25 @@
153
153
  "jsdoc": "^3.6.11",
154
154
  "jsdoc-typeof-plugin": "1.0.0",
155
155
  "json-server": "0.17.4",
156
- "playwright": "1.50.1",
156
+ "playwright": "1.51.0",
157
157
  "prettier": "^3.3.2",
158
- "puppeteer": "24.1.1",
158
+ "puppeteer": "24.4.0",
159
159
  "qrcode-terminal": "0.12.0",
160
160
  "rosie": "2.1.1",
161
161
  "runok": "0.9.3",
162
162
  "semver": "7.7.1",
163
163
  "sinon": "19.0.2",
164
164
  "sinon-chai": "3.7.0",
165
- "testcafe": "3.7.1",
165
+ "testcafe": "3.7.2",
166
166
  "ts-morph": "25.0.1",
167
167
  "ts-node": "10.9.2",
168
168
  "tsd": "^0.31.0",
169
169
  "tsd-jsdoc": "2.5.0",
170
- "typedoc": "0.27.7",
171
- "typedoc-plugin-markdown": "4.4.1",
172
- "typescript": "5.7.3",
170
+ "typedoc": "0.28.0",
171
+ "typedoc-plugin-markdown": "4.5.0",
172
+ "typescript": "5.8.2",
173
173
  "wdio-docker-service": "3.2.1",
174
- "webdriverio": "9.7.2",
174
+ "webdriverio": "9.12.0",
175
175
  "xml2js": "0.6.2",
176
176
  "xpath": "0.0.34"
177
177
  },