[Dynamic configuration] [Playwright] Can't reconfigure configuration per scenario
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, playwright
- Lĩnh vực
- developer-experience, testing-qa
Hướng nghiên cứu
Chạy bản tái hiện trong dynamic-configuration/override-config.e2e-test.js và so sánh các lệnh gọi .config() của từng Scenario với trường hợp Feature('Dynamic Configuration').config() đang hoạt động. Theo dõi cách cấu hình của Scenario đến được helper của Playwright, sau đó xác minh rằng browser override có hiệu lực đối với từng Scenario, trong khi hành vi --override trên dòng lệnh vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What are you trying to achieve?
I'm trying to reconfigure browser configuration per scenario
What do you get instead?
Provide console output if related. Use
--verbosemode for more details.
CodeceptJS v3.0.4
Helpers: Playwright
Plugins: screenshotOnFail, retryFailedStep, tryTo
Dynamic Configuration --
[1] Starting recording promises
› [Session] Starting singleton browser session
should override browser in config per scenario try#1 @dynamic-configuration
› [Test Config] Playwright {"browser":"firefox"}
I am on page "/"
› [Browser:Warning]
I execute script () => !!window.chrome
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
✔ OK in 3224ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
should override browser in config per scenario try#2 @dynamic-configuration
› [Test Config] Playwright {"Playwright":{"browser":"firefox"}}
I am on page "/"
› [Browser:Warning]
I execute script () => !!window.chrome
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
✔ OK in 611ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
should override browser in config per scenario try#3 @dynamic-configuration
› [Test Config] Playwright {"helpers":{"Playwright":{"browser":"webkit"}}}
I am on page "/"
› [Browser:Warning]
I execute script () => !!window.chrome
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
✔ OK in 552ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] JSHandle@THREE.WebGLProgram: gl.getProgramInfoLog() JSHandle@
OK | 3 passed // 5s
Provide test source code if related
const assert = require('assert');
Feature('Dynamic Configuration');
Scenario('should override browser in config per scenario try#1 @dynamic-configuration', async ({ I }) => {
I.amOnPage('/');
const isChrome = await I.executeScript(() => !!window.chrome);
assert(isChrome, 'should check that browser is chrome');
}).config({"browser": "firefox"});
Scenario('should override browser in config per scenario try#2 @dynamic-configuration', async ({ I }) => {
I.amOnPage('/');
const isChrome = await I.executeScript(() => !!window.chrome);
assert(isChrome, 'should check that browser is chrome');
}).config({"Playwright": {"browser": "firefox"}});
Scenario('should override browser in config per scenario try#3 @dynamic-configuration', async ({ I }) => {
I.amOnPage('/');
const isChrome = await I.executeScript(() => !!window.chrome);
assert(isChrome, 'should check that browser is chrome');
}).config({ "helpers": {"Playwright": {"browser": "webkit"}}});
Details
- CodeceptJS version: v3.0.4
- NodeJS Version: v12.18.3
- Operating System: macOS Catalina 10.15.7
- playwright
- Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
tests: '*/*.e2e-test.js',
output: './output',
helpers: {
Playwright: {
url: 'http://github.com',
show: true,
browser: 'chromium'
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'experiments-with-codeceptjs',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
}
NOTE:
But it works for the Feature
Feature('Dynamic Configuration').config({"browser": "firefox"})
and I can override the configuration in runtime by using --override or -o option in the command line, passing valid JSON as a value:
codeceptjs run -o '{ "helpers": {"Playwright": {"browser": "firefox"}}}'
Also here is the link to reproduce the issue:
https://github.com/elaichenkov/experiments-with-codeceptjs/blob/main/dynamic-configuration/override-config.e2e-test.js
- Ngôn ngữ chính
- JavaScript
- Star
- 4.2k
- Fork
- 756
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeceptjs/CodeceptJS
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#5420 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeceptjs/CodeceptJS#5358 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeceptjs/CodeceptJS#4958 · 10 bình luận · 2 reaction ·
-
stale
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#4778 · 3 bình luận ·
-
stale
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
codeceptjs/CodeceptJS#5618 · 1 bình luận ·
Tất cả issue của codeceptjs/CodeceptJS
Issue tương tự
-
ai-observability bug team/ai-observability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AllTheMods/ATM-10-L#19 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SignalK/n2k-signalk#345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
JuliaPluto/PlutoPlotly.jl#72 ·