Error when trying `run-workers` with combination of `channel` using playwright helper.
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js, playwright
调研方向
首先,在 win32 上使用 Playwright helper、channel: 'msedge' 和 npx codeceptjs run-workers 2,于一个演示 CodeceptJS 项目中重现该问题。检查 run-workers 子进程的环境处理,并验证 channel 浏览器在并行执行期间能够成功启动。
由索引模型根据 Issue 内容生成。
描述
What are you trying to achieve?
When I use Playwright driver along with channel, and also use run-workers, I get error like the browser exe file is not present at specific location and browser cannot be launched.
How to reproduce?
- Create a demo codeceptjs project with playwright as driver.
- In
codecept.conf.jsfile add thechannelproperty inside playwright object (add any property from here) OR use below code.
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();
/** @type {CodeceptJS.MainConfig} */
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Playwright: {
browser: 'chromium',
url: 'http://localhost',
show: true,
channel: 'msedge',
}
},
include: {
I: './steps_file.js'
},
name: 'demo-codecept'
}
Command for execution
npx codeceptjs run-workers 2
Possible resolution way and reason for Error
The error comes when child processes are created for the parallel execution using run-workers. For windows operating system, the env variable are case-insensitive, which means process.env['PROGRAMFILES(X86)'] and process.env['ProgramFiles(x86)'] would produce same output. But inside the child process, only writing exact case only produces result. ex. process.env['ProgramFiles(x86)'] will produce correct output and anything other produces undefined.
Because of this it is not able to find the correct path at which the browser exe files are present.
Details
- CodeceptJS version:
3.6.6 - NodeJS Version:
22.11.0 - Operating System:
win32 - playwright:
1.49.0
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 756
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeceptjs/CodeceptJS 的其他 Issue
-
stale
难度 2/5 1-3 小时 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 76/100
codeceptjs/CodeceptJS#5358 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 条评论 · 2 个 reaction ·
-
stale
难度 1/5 1 小时以内 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 条评论 ·
-
stale
难度 4/5 3-5 天 新手友好度 38/100
codeceptjs/CodeceptJS#5618 · 1 条评论 ·
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
Seeed-Studio/wiki-documents#5655 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
capricorn86/happy-dom#2435 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
Edit: CW+ 未关闭channels:edit check:passed
难度 2/5 1-3 小时 新手友好度 68/100
-
01 type: bug 30 needs: triage 99 tag: UX Accessibility
难度 2/5 1-3 小时 新手友好度 82/100