Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

test(playwright): draw ios theme tests at 1x in Safari and Chrome - #31817

Open
thetaPC wants to merge 7 commits into
FW-6848from
FW-7047-device-scale-factor
Open

thetaPC wants to merge 7 commits into
FW-6848from
FW-7047-device-scale-factor

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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?

  • Every ios theme test draws at 1x in Safari and Chrome, so there is nothing to shrink and ios lines show as a full pixel. No spec has to opt in.
  • md and ionic tests keep their device density, and Firefox already runs at 1x.
  • A spec that needs the real density can add test.use({ deviceScaleFactor: undefined }) to its describe, which resets it to the project's value.

Does this introduce a breaking change?

  • Yes
  • No

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.

@thetaPC
thetaPC added this pull request to stack #31816 November 24, 2026 19:17
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Dec 5, 2026 3:58am UTC

Request Review

@thetaPC
thetaPC marked this pull request as ready for review November 25, 2026 01:16
@thetaPC
thetaPC requested a review from a team as a code owner November 25, 2026 01:16
@thetaPC
thetaPC requested a review from ShaneK November 25, 2026 01:16

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

* `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) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

This branch was successfully deployed

1 active deployment
Preview — 722ed856 Deployed Dec 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants