overriding the configuration for the multi-session by passing a second parameter don't work
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js, playwright
- 领域
- testing-qa
调研方向
从 codecept.conf.ts 中的 session 函数和 Playwright helper 配置开始,然后使用第二个参数复现所提供的 multi-session 示例。跟踪 session 选项如何与默认配置合并,并验证使用的是被覆盖的浏览器和设备设置,而不是默认设置。
由索引模型根据 Issue 内容生成。
描述
What are you trying to achieve?
I'm trying to override the configuration for multi-session by passing a second parameter to the session function. I want the configuration to apply the overridden settings, but it doesn't work as expected.
What do you get instead?
The overriding doesn't apply; the default configuration in codecept.conf.ts is still being applied.
Provide console output if related. Use
--verbosemode for more details.
> crossdevices@1.0.0 codeceptjs
> codeceptjs run --verbose
***************************************
nodeInfo: 16.18.1
osInfo: macOS 14.4
cpuInfo: (8) arm64 Apple M2
chromeInfo: 126.0.6478.61
edgeInfo: 126.0.2592.61
firefoxInfo: undefined
safariInfo: 17.4
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.6.3 #StandWithUkraine
Using test root "/Users/raspfr/repo/poc/crossdevices"
Helpers: Playwright
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement
login --
[1] Starting recording promises
Timeouts:
› [Session] Starting singleton browser session
test something
I am on page "https://www.google.com"
› [Browser:Error] Permissions policy violation: unload is not allowed in this document.
I wait 5
› [New Context] {"browser":"webkit","emulate":{"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1","viewport":{"width":393,"height":660},"screen":{"width":393,"height":852},"deviceScaleFactor":3,"isMobile":true,"hasTouch":true,"defaultBrowserType":"webkit"}}
mobile: I am on page "https://www.google.com"
› [Browser:Info] Autofocus processing was blocked because a document already has a focused element.
› [Browser:Error] Permissions policy violation: unload is not allowed in this document.
mobile: I wait 5
✔ OK in 11410ms
OK | 1 passed // 13s
Provide test source code if related
import { devices } from "playwright";
Feature("login");
Scenario("test something", ({ I }) => {
I.amOnPage("https://www.google.com");
I.wait(5);
session(
"mobile",
{
browser: "webkit",
emulate: devices["iPhone 14 Pro"],
},
() => {
I.amOnPage("https://www.google.com");
I.wait(5);
}
);
});
Details
CodeceptJS version: 3.6.3
NodeJS Version: 20.14.5
Operating System: MacOS 14.4 (23E214)
playwright 1.44.1
- Configuration file:
import { setHeadlessWhen, setCommonPlugins } from "@codeceptjs/configure";
import { devices } from "playwright";
// 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();
export const config: CodeceptJS.MainConfig = {
tests: "./*_test.ts",
output: "./output",
helpers: {
Playwright: {
browser: "chromium",
emulate: devices["Chrome Desktop"],
url: "http://localhost",
show: true,
},
},
include: {
I: "./steps_file",
},
name: "crossdevices",
};
- 主要语言
- 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 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
难度 1/5 1 小时以内 新手友好度 90/100
matrix-org/matrix.org#3649 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
vadimdemedes/ink#1029 ·