feat(test): extract anchor iPhone device descriptors to shared fixture
Move the four iPhone viewport descriptors (SE, 15/16, 16/17 Pro, Pro Max) into tests/e2e/fixtures/devices.ts so the upcoming visual spec (Task 23) can share the same anchors. The mobile-audit spec now spreads each descriptor and adds a slug `name` plus a human `label` for the run header. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
44
tests/e2e/fixtures/devices.ts
Normal file
44
tests/e2e/fixtures/devices.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Shared device descriptors for mobile/tablet Playwright runs.
|
||||
*
|
||||
* Anchors per docs/superpowers/specs/2026-04-29-mobile-optimization-design.md §2.1:
|
||||
* narrowest, common, current Pro, current Pro Max.
|
||||
*/
|
||||
export const IPHONE_DEVICES = {
|
||||
iphoneSe: {
|
||||
name: 'iPhone SE 3 (375×667)',
|
||||
viewport: { width: 375, height: 667 },
|
||||
deviceScaleFactor: 2,
|
||||
isMobile: true,
|
||||
hasTouch: true,
|
||||
userAgent:
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
|
||||
},
|
||||
iphone16: {
|
||||
name: 'iPhone 15/16 (393×852)',
|
||||
viewport: { width: 393, height: 852 },
|
||||
deviceScaleFactor: 3,
|
||||
isMobile: true,
|
||||
hasTouch: true,
|
||||
userAgent:
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
|
||||
},
|
||||
iphone16Pro: {
|
||||
name: 'iPhone 16/17 Pro (402×874)',
|
||||
viewport: { width: 402, height: 874 },
|
||||
deviceScaleFactor: 3,
|
||||
isMobile: true,
|
||||
hasTouch: true,
|
||||
userAgent:
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
|
||||
},
|
||||
iphoneProMax: {
|
||||
name: 'iPhone 16/17 Pro Max (440×956)',
|
||||
viewport: { width: 440, height: 956 },
|
||||
deviceScaleFactor: 3,
|
||||
isMobile: true,
|
||||
hasTouch: true,
|
||||
userAgent:
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
|
||||
},
|
||||
} as const;
|
||||
Reference in New Issue
Block a user