We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3545fe7 commit b5c6130Copy full SHA for b5c6130
1 file changed
packages/browser-playwright/src/playwright.ts
@@ -434,7 +434,11 @@ export class PlaywrightBrowserProvider implements BrowserProvider {
434
...contextOptions,
435
ignoreHTTPSErrors: true,
436
} satisfies BrowserContextOptions
437
- if (this.project.config.browser.ui) {
+ // A `null` viewport lets the page adopt the real window size, which is only
438
+ // meaningful for a headed UI. In headless mode there is no real window, so it
439
+ // would inherit the host's device scale factor and produce screenshots that
440
+ // differ from non-UI runs on the same machine.
441
+ if (this.project.config.browser.ui && !this.project.config.browser.headless) {
442
options.viewport = null
443
}
444
return options
0 commit comments