Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| * `test.use({ deviceScaleFactor: undefined })` to the `test.describe`. | ||
| * It resets the value to the project's, replacing this fixture. | ||
| */ | ||
| deviceScaleFactor: async ({ deviceScaleFactor, browserName }, use, testInfo) => { |
There was a problem hiding this comment.
Could we add a short note about this to docs/core/testing/usage-instructions.md (under Managing Screenshots)? Right now the 1x behavior and the test.use({ deviceScaleFactor: undefined }) opt-out are only explained here, so someone comparing an ios screenshot to a real device won't know to look for it. #31800 already repeats the explanation in three specs, which suggests it needs a home in the docs.
There was a problem hiding this comment.
Added a "Screen Density in ios Theme Screenshots" section under Managing Screenshots in c3e9efc. It covers why ios tests draw at 1x, what that changes compared to a device, and the deviceScaleFactor: undefined opt-out with scale: 'device'.
…le-factor # Conflicts: # core/src/components/popover/test/position/popover.e2e.ts-snapshots/popover-position-ios-rtl-Mobile-Safari-linux.png # core/src/components/popover/test/reference/popover.e2e.ts-snapshots/popover-reference-event-trigger-ios-rtl-Mobile-Safari-linux.png # core/src/components/popover/test/reference/popover.e2e.ts-snapshots/popover-reference-trigger-trigger-ios-rtl-Mobile-Safari-linux.png
Issue number: internal
What is the current behavior?
Playwright draws Safari at 3x and Chrome at 2.75x, then shrinks each screenshot to 1x. An ios line is one device pixel thick, so it can get lost in the shrink, and the snapshot records the item without it. Nothing fails.
What is the new behavior?
test.use({ deviceScaleFactor: undefined })to its describe, which resets it to the project's value.Does this introduce a breaking change?
Other information
Most ios Safari and Chrome snapshots change slightly, because text drawn at 1x isn't pixel-identical to text shrunk from 3x. ios borders drawn at 0.55px (header, footer, tab bar, inputs) also show up in snapshots where the shrink had dropped them. At 1x each of those borders takes a full pixel instead of a third of one, so elements with several of them grow, and some snapshots get taller by 1 to 25px.