Skip to content

Add optional screenshot scale support#195

Open
WINBIGFOX wants to merge 1 commit intopestphp:4.xfrom
WINBIGFOX:feature/screenshot-scale-option
Open

Add optional screenshot scale support#195
WINBIGFOX wants to merge 1 commit intopestphp:4.xfrom
WINBIGFOX:feature/screenshot-scale-option

Conversation

@WINBIGFOX
Copy link
Copy Markdown

Add optional screenshot scale support across the page and element APIs, defaulting to css when scale is omitted or null, wire the value into Playwright screenshot options, and add browser tests covering device scale screenshots to keep existing behavior intact.

@mishahawthorn
Copy link
Copy Markdown

+1 on this, I'm currently patching locally to be able to get device scale for screenshots and was about to PR myself.

The majority of users will want css for consistent diffing across platforms, but there are valid use cases to want device scaling. In controlled CI environments I can see a desire for "retina-level" assertions and diffing for apps that call for it.

In my use case, I actually maintain a separate test suite that I use to generate screenshots for marketing and help article content.

@nunomaduro Thoughts on expanding the API in this way? One concern I see as a maintainer is the extent of future customization that will be called for and might warrant thinking about the API a bit differently compared to just adding another param.

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

Successfully merging this pull request may close these issues.

2 participants