Skip to content

Commit b3263d0

Browse files
djscruggsclaude
andcommitted
Add phone-size test projects and a scrolled-QR gallery shot.
Add emulated iPhone 15 (`iphone`) and Pixel 7 (`android-pixel`) Playwright projects. On a phone the popup is clamped to the screen width and crosses the dialog's 430px "small screen" CSS breakpoint, so these exercise layout branches the 500px desktop projects do not; all invariants hold there too. Also capture an `-expanded-scrolled` gallery shot when the expanded QR code sits below the fold (many wallets on a short/phone viewport), so the gallery shows the QR is reachable by scrolling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f27243e commit b3263d0

4 files changed

Lines changed: 42 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
chooser dialog. A dev-only `/test/wallet-chooser` harness route
2121
renders the dialog with fake state across wallet counts and the
2222
cross-device QR section; `npm run test:e2e` asserts layout invariants
23-
on Chromium, WebKit, and Firefox, and `npm run gallery` produces a
24-
browsable screenshot gallery.
23+
on desktop Chromium, WebKit, and Firefox plus emulated iPhone and
24+
Pixel phone sizes, and `npm run gallery` produces a browsable
25+
screenshot gallery.
2526

2627
## 7.4.3 - 2026-06-12
2728

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,22 @@ Install the browser engines once:
9696

9797
npx playwright install chromium webkit firefox
9898

99-
Run the layout regression suite (Chromium, WebKit, Firefox):
99+
Run the layout regression suite:
100100

101101
npm run test:e2e
102102

103103
This asserts structural invariants — the expected wallets render, no horizontal
104104
or window scrollbar appears, the header stays pinned while the list scrolls, and
105105
the panel fills the popup — rather than comparing pixels. It starts the dev
106-
server automatically.
106+
server automatically and runs five projects: desktop Chromium, WebKit, and
107+
Firefox at the 500px popup width, plus emulated **iPhone 15** and **Pixel 7**.
108+
The phone projects matter because on a phone the popup is clamped to the screen
109+
width and crosses the dialog's 430px "small screen" CSS breakpoint, exercising
110+
layout branches the desktop width does not.
111+
112+
Run a single project with, e.g., `npm run test:e2e -- --project=iphone`. The
113+
project names are `chromium`, `webkit`, `firefox`, `iphone`, and
114+
`android-pixel`.
107115

108116
Generate a browsable screenshot gallery of every state (wallet count × theme ×
109117
engine, collapsed and expanded), with an `index.html` contact sheet:

playwright.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ export default defineConfig({
3434
{
3535
name: 'firefox',
3636
use: {...devices['Desktop Firefox'], viewport: {width: 500, height: 640}}
37+
},
38+
// phone-sized projects: on a phone the popup is clamped to the screen
39+
// width (narrower than the 500px desktop popup) and crosses the
40+
// dialog's 430px "small screen" CSS breakpoint, so these exercise
41+
// layout branches the desktop projects do not. Device descriptors also
42+
// set a touch-capable, mobile-UA context.
43+
{
44+
name: 'iphone',
45+
use: {...devices['iPhone 15']}
46+
},
47+
{
48+
name: 'android-pixel',
49+
use: {...devices['Pixel 7']}
3750
}
3851
],
3952
// start the authn.io dev server automatically; reuse one already running

test/e2e/gallery.spec.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,24 @@ test.describe('gallery', () => {
4848
const toggle = page.locator('.cross-device-toggle');
4949
if(await toggle.count() > 0) {
5050
await toggle.click();
51-
await expect(page.locator('img[alt*="QR"]')).toBeVisible();
51+
const qr = page.locator('img[alt*="QR"]');
52+
await expect(qr).toBeVisible();
5253
await page.screenshot(
5354
{path: path.join(dir, `${state.name}-expanded.png`)});
55+
56+
// when the expanded QR sits below the fold (many wallets on a
57+
// short/phone viewport), also capture a shot scrolled to the
58+
// QR, so the gallery shows it is reachable
59+
const qrInView = await qr.evaluate(el => {
60+
const r = el.getBoundingClientRect();
61+
return r.bottom <= window.innerHeight && r.top >= 0;
62+
});
63+
if(!qrInView) {
64+
await qr.scrollIntoViewIfNeeded();
65+
await expect(qr).toBeInViewport();
66+
await page.screenshot(
67+
{path: path.join(dir, `${state.name}-expanded-scrolled.png`)});
68+
}
5469
}
5570
});
5671
}

0 commit comments

Comments
 (0)