Phones in the end-to-end tests
The browser fixture opens phones from Playwright's own device presets (360x800, iPhone SE 375x667, Pixel 7 412x839, and the Pixel 7 held sideways), with touch, a coarse pointer and reduced motion, and a phone session fails at once if the page doesn't see a touch screen. Mobile/fit.js measures a page one screen at a time down its main scroller: sideways scroll, boxes past the screen's sides, open menus and dialogs cut or outside the screen, targets without a 44px hit area (hit-tested at their centre and 21px around it, so a crowding neighbour fails them too) and control text under 12px. RouteSweepTests runs every feed tab, threads of each kind the town holds, profiles, search, Explore, lists, groups, filters, scheduled posts, settings and administration (every section opened) and the login page on the three portrait phones, as client.mobile.fit.* and client.mobile.touch.* cells; screenshots, findings and a contact sheet go to tests/e2e/out/mobile/. DesktopUnchangedTests holds desktop's control sizes. Category=Mobile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
88e55e671c
commit
63d83810d7
8 files changed
+732
-11
No files matched your search
@@ -25,6 +25,22 @@ namespace decePubClient.E2E.Support
|
||||
return session;
|
||||
}
|
||||
|
||||
// on a phone: the state the desktop sign-in saved, and the feed as on a first visit (no FeedFilter), so the globe
|
||||
// banner starts closed as a phone's does
|
||||
public static async Task<Session> As(Browser browser, Pasture.Persona persona, Phone phone)
|
||||
{
|
||||
var state = Path.Combine(StateDir, persona.UserName + ".json");
|
||||
if (!File.Exists(state))
|
||||
await (await As(browser, persona)).DisposeAsync();
|
||||
var session = await browser.Open(state, phone);
|
||||
await session.Page.GotoAsync(Pasture.Site + "/");
|
||||
await session.Page.EvaluateAsync("() => localStorage.removeItem('FeedFilter')");
|
||||
await session.Page.GotoAsync(Pasture.Site + "/");
|
||||
await session.Page.Locator("article[data-uri], [data-feed-empty]").First.WaitForAsync(new() { Timeout = 30000 });
|
||||
await session.AssertPhone();
|
||||
return session;
|
||||
}
|
||||
|
||||
public static async Task Through(IPage page, Pasture.Persona persona)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user