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
-
Bug
難度 2/5 1-3 小時 新手友好度 70/100
Automattic/safe-publish#594 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
難度 2/5 1-3 小時 新手友好度 70/100
NousResearch/hermes-agent#121143 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
難度 2/5 1-3 小時 新手友好度 75/100