[Codecept Playwright] - Not able to maximize the window. windowSize = "maximize" not working properly
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js, playwright
- 領域
- testing
調査の方向性
conf.js の Playwright ヘルパー設定、特に windowSize、chromium.args、viewport から始め、CodeceptJS 3.6.7 と Node.js 20.12.2 を使用して Windows 11 で動作を再現します。設定した Playwright ブラウザーが、別途起動したブラウザーやページの手動置換を必要とせず、確実に最大化された状態で開けば完了です。
索引モデルが issue の本文から書いたものです。
説明
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');
});
- 主要言語
- JavaScript
- スター
- 4.2k
- フォーク
- 756
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
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 ·
-
automated broken-link
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
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 ·