Skip to content

Commit a67509a

Browse files
committed
Merge branch '3.x' into task-4875-update-webdriverio
2 parents b228ef1 + 28f7837 commit a67509a

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

lib/container.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ function loadGherkinSteps(paths) {
469469
loadSupportObject(path, `Step Definition from ${path}`)
470470
}
471471
} else {
472-
const folderPath = paths.startsWith('.') ? path.join(global.codecept_dir, paths) : ''
472+
const folderPath = paths.startsWith('.') ? normalizeAndJoin(global.codecept_dir, paths) : ''
473473
if (folderPath !== '') {
474474
globSync(folderPath).forEach(file => {
475475
loadSupportObject(file, `Step Definition from ${file}`)
@@ -562,3 +562,16 @@ function getHelperModuleName(helperName, config) {
562562
// built-in helpers
563563
return `./helper/${helperName}`
564564
}
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+
}

lib/helper/Appium.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ class Appium extends Webdriver {
383383

384384
_buildAppiumEndpoint() {
385385
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(/\/$/, '')
386388
// 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}`
388390
}
389391

390392
/**

lib/helper/Mochawesome.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ let currentSuite
44

55
const Helper = require('@codeceptjs/helper')
66
const { clearString } = require('../utils')
7+
const { testToFileName } = require('../mocha/test')
78

89
class Mochawesome extends Helper {
910
constructor(config) {
@@ -50,7 +51,7 @@ class Mochawesome extends Helper {
5051
fileName = clearString(`${test.title}_${currentTest.test.title}`)
5152
} else {
5253
currentTest = { test }
53-
fileName = clearString(test.title)
54+
fileName = `${testToFileName(test)}`
5455
}
5556
if (this.options.uniqueScreenshotNames) {
5657
const uuid = test.uuid || test.ctx.test.uuid

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
"@codeceptjs/configure": "1.0.2",
7979
"@codeceptjs/helper": "2.0.4",
8080
"@cucumber/cucumber-expressions": "18",
81-
"@cucumber/gherkin": "31",
81+
"@cucumber/gherkin": "32",
8282
"@cucumber/messages": "27.2.0",
83-
"@xmldom/xmldom": "0.9.7",
83+
"@xmldom/xmldom": "0.9.8",
8484
"acorn": "8.14.0",
8585
"arrify": "3.0.0",
8686
"axios": "1.8.1",
@@ -123,8 +123,8 @@
123123
"@apollo/server": "^4",
124124
"@codeceptjs/expect-helper": "^0.2.2",
125125
"@codeceptjs/mock-request": "0.3.1",
126-
"@eslint/eslintrc": "3.2.0",
127-
"@eslint/js": "9.19.0",
126+
"@eslint/eslintrc": "3.3.0",
127+
"@eslint/js": "9.21.0",
128128
"@faker-js/faker": "9.4.0",
129129
"@pollyjs/adapter-puppeteer": "6.0.6",
130130
"@pollyjs/core": "5.1.0",
@@ -140,7 +140,7 @@
140140
"chai-subset": "1.6.0",
141141
"documentation": "14.0.3",
142142
"electron": "34.0.2",
143-
"eslint": "^9.19.0",
143+
"eslint": "^9.21.0",
144144
"eslint-plugin-import": "2.31.0",
145145
"eslint-plugin-mocha": "10.5.0",
146146
"expect": "29.7.0",
@@ -155,7 +155,7 @@
155155
"json-server": "0.17.4",
156156
"playwright": "1.50.1",
157157
"prettier": "^3.3.2",
158-
"puppeteer": "24.1.1",
158+
"puppeteer": "24.3.1",
159159
"qrcode-terminal": "0.12.0",
160160
"rosie": "2.1.1",
161161
"runok": "0.9.3",
@@ -168,7 +168,7 @@
168168
"tsd": "^0.31.0",
169169
"tsd-jsdoc": "2.5.0",
170170
"typedoc": "0.27.7",
171-
"typedoc-plugin-markdown": "4.4.1",
171+
"typedoc-plugin-markdown": "4.4.2",
172172
"typescript": "5.7.3",
173173
"wdio-docker-service": "3.2.1",
174174
"webdriverio": "9.10.1",

0 commit comments

Comments
 (0)