Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome 128 - window-size is ignored (chrome-for-testing, headless, linux) #638

Open
yblatti opened this issue Aug 27, 2024 · 4 comments
Open

Comments

@yblatti
Copy link

yblatti commented Aug 27, 2024

I have a Symfony app (7.1).
For e2e tests I use phpunit + symfony/panther + Chrome for Testing headless (on Debian Linux bullseye).

Since Chrome 128 has been released, my CI fails as the --window-size chrome argument is ignored.

I wrote a reproducer here : https://github.com/yblatti/repro-panther-screen-size-chrome

It seems to indicates that this has been introduced with Chrome 128.0.6575.0.

I have tried to have a look at https://chromium.googlesource.com/chromium/src/+log/128.0.6542.0..128.0.6543.0?pretty=fuller&n=10000
... but this way out of my league.

@yblatti
Copy link
Author

yblatti commented Aug 27, 2024

I found that : https://chromium.googlesource.com/chromium/src/+/b9b39a430f71c710d16aafcc67278ef77440c18d

[headless] Change --headless switch default to 'new'

Specifying the --headless switch will activate new Headless mode.
Old Headless mode is still available if requested explicitly with --headless=old.

It seems that headless mode is changing, and we can use --headless=old to keep the previous behavior (for how long tho..)

Any hint on how to set size with new headless ?

@dunglas
Copy link
Member

dunglas commented Aug 28, 2024

According to their docs, the --window-size flag is supported by both the old and the new mode: https://developer.chrome.com/docs/chromium/new-headless

It's maybe a bug in Chrome?

@yblatti
Copy link
Author

yblatti commented Aug 28, 2024

Thanks for your time and feedback @dunglas :)

I reported it here : https://issues.chromium.org/issues/362522328

@Chris53897
Copy link

This worked for me. Just in case, someone is looking for a quick solution. I am not sure if the bug is solved.

$browser = Client::createChromeClient(
            arguments: [
                '--window-size=1400,800',
                '--headless=new',
            ],
 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants