[Codecept Playwright] - Not able to maximize the window. windowSize = "maximize" not working properly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js, playwright
- Ambito
- testing
Direzione di ricerca
Inizia dalla configurazione dell’helper Playwright in conf.js, in particolare windowSize, chromium.args e viewport, e riproduci il comportamento su Windows 11 con CodeceptJS 3.6.7 e Node.js 20.12.2. Il lavoro è completato quando il browser Playwright configurato si apre in modo affidabile massimizzato, senza richiedere un browser avviato separatamente né la sostituzione manuale della pagina.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I want to maximize the window where my app fit to the entire screen perfectly
By using the option (windowSize = "maximize") in conf.js file does not work.
- CodeceptJS version: 3.6.7
- NodeJS Version: 20.12.2
- Operating System: Windows 11
- playwright
- Configuration file:
const { default: test } = require("playwright/test");
exports.config = {
output: './output',
tests: './other_tests/**.test.js',
helpers: {
Playwright: {
browser: 'chromium',
url: 'localhost:3000',
show: true,
getPageTimeout: 180000,
waitForTimeout: 180000,
waitForNavigation: "networkidle0",
restart: "session",
keepBrowserState: true,
keepCookies: true,
windowSize: "maximize",
chromium: {
args: ['--start-maximized'],
viewport: null
}
},
Generics: {
require: "./helpers/generics.js"
},
ExpectHelper: {}
},
include: {
I: './steps_file.js'
},
timeout: 560,
gherkin: {
features: './features/*.feature',
steps: ['./step_definitions/steps.js'],
},
plugins: {
screenshotOnFail: {
enabled: true
},
tryTo: {
enabled: true
},
allure: {
enabled: true,
require: '@codeceptjs/allure-legacy',
}
},
name: 'test_Automation'
}
I even tried to extend playwright method where I able to maximize the window but not sure how to reuse the new context as I need to close the one created by codeceptjs fixture.
const { chromium } = require('playwright');
Feature('Maximize Browser Window');
Scenario('Maximize window using Playwright', async ({ I }) => {
I.amOnPage('http://localhost'); // Replace with your URL
I.usePlaywrightTo('maximize browser window', async ({ page }) => {
// Close the existing browser context
const browser = page.context().browser();
await browser.close();
// Launch a new browser instance with the --start-maximized argument
const newBrowser = await chromium.launch({
headless: false,
args: ["--start-maximized"],
});
// Create a new browser context with a maximized viewport
const context = await newBrowser.newContext({ viewport: null });
const newPage = await context.newPage();
// Navigate to the specified URL
await newPage.goto('http://localhost'); // Replace with your URL
// Set the new page for further CodeceptJS steps
I._setPage(newPage);
});
// Continue with your test steps using the new page
I.see('Welcome');
});
- Lingua principale
- JavaScript
- Stelle
- 4.2k
- Fork
- 756
- Merge medio
- 2g 9h
- PR unite (30g)
- 16
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codeceptjs/CodeceptJS
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
codeceptjs/CodeceptJS#5420 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
codeceptjs/CodeceptJS#5358 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
codeceptjs/CodeceptJS#4958 · 10 commenti · 2 reazioni ·
-
stale
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
codeceptjs/CodeceptJS#4778 · 3 commenti ·
-
stale
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
codeceptjs/CodeceptJS#5618 · 1 commento ·
Tutte le issue di codeceptjs/CodeceptJS
Issue simili
-
bug customer-eng Durable Agents Inngest status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
optimization optimization:agents-md-curator
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AOSSIE-Org/OrgExplorer#253 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100