[Dynamic configuration] [Playwright] Can't reconfigure configuration per scenario
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript, playwright
- Domaine
- developer-experience, testing-qa
Piste de recherche
Exécutez la reproduction dans dynamic-configuration/override-config.e2e-test.js et comparez les appels à .config() de chaque Scenario avec le cas fonctionnel Feature('Dynamic Configuration').config(). Suivez le cheminement de la configuration de Scenario jusqu’au helper Playwright, puis vérifiez que l’override du navigateur prend effet pour chaque Scenario, tandis que le comportement de --override en ligne de commande reste inchangé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
✔ OK in 3224ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] [email protected]: 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] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
✔ OK in 611ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] [email protected]: 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] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
› [Browser:Warning] [email protected]: gl.getProgramInfoLog() JSHandle@
✔ OK in 552ms
› [Test Config] Reverted for Playwright
› [Session] cleaning cookies and localStorage
› [Browser:Warning] [email protected]: 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
- Langage dominant
- JavaScript
- Étoiles
- 4.2k
- Forks
- 756
- Merge moyen
- 1 j 20 h
- PR mergées (30 j)
- 18
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de codeceptjs/CodeceptJS
-
stale
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
codeceptjs/CodeceptJS#5420 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
stale
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
codeceptjs/CodeceptJS#5358 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
stale
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
codeceptjs/CodeceptJS#4958 · 10 commentaires · 2 réactions ·
Les mainteneurs répondent en général sous 2 jours
-
stale
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
codeceptjs/CodeceptJS#4778 · 3 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
stale
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
codeceptjs/CodeceptJS#5618 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de codeceptjs/CodeceptJS
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour
-
Design only Leadership Survey SLFS
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
bcgov/digital-journeys#2293 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
tursodatabase/turso#9405 ·
Les mainteneurs répondent en général sous 1 jour
-
Toolkit
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
API Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
Les mainteneurs répondent en général sous 1 jour