Skip to content

page.screenshot is extremely low resolution with a large viewport #9124

@KaelWD

Description

@KaelWD

Describe the bug

Running browser tests with playwright and viewport: { width: 1280, height: 800 }

This is unusable, the page is taller than 800px so everything else gets cropped off:

await page.viewport(600, 800)
await page.screenshot()

This captures the full page but #6512 scales it down to only 42px wide when the scrollHeight is 9300:

await page.viewport(600, document.body.scrollHeight)
await page.screenshot()

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-tszdoqkx

System Info

System:
    OS: Linux 6.17 Ubuntu 25.10 25.10 (Questing Quokka)
    CPU: (16) x64 AMD Ryzen 7 5700X3D 8-Core Processor
    Memory: 9.52 GB / 31.27 GB
    Container: Yes
    Shell: 4.0.6 - /usr/bin/fish
  Binaries:
    Node: 24.11.1 - /run/user/1000/fnm_multishells/437459_1764264127836/bin/node
    npm: 11.6.2 - /run/user/1000/fnm_multishells/437459_1764264127836/bin/npm
    pnpm: 10.23.0 - /run/user/1000/fnm_multishells/437459_1764264127836/bin/pnpm
  Browsers:
    Chrome: 142.0.7444.175
    Firefox: 145.0.1
    Firefox Developer Edition: 145.0.1

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions