jdobosz / testcafe-browser-provider-puppeteer

This is the puppeteer browser provider plugin for testcafe
MIT License
49 stars 24 forks source link

How to set screen size? #6

Open kot-lex opened 6 years ago

kot-lex commented 6 years ago

Hello! My tests fails in headless chrome due to smaller window size than I have in regular chrome. Is there any way to configure default window size? Thanks

kot-lex commented 6 years ago

As I see from the source code there is no other way to set puppeteer's viewport other than calling resizeWindow before each test. https://github.com/jdobosz/testcafe-browser-provider-puppeteer/blob/master/src/index.js#L50

It would be great to have an ability to set the viewport size right in openBrowser method. Or at least provide reasonable defaults.

mokone91 commented 6 years ago

+1

sduduzog commented 4 years ago

Here's another gem I just ran into The window maximization functionality is not supported by the "puppeteer" browser provider.

Asuza commented 4 years ago

I believe await t.resizeWindow(1366, 768); is working for me. Have you tried changing the browser size that way? Perhaps it can be used early enough in your code for your needs.