From b66d7cf5452d552997c27095a753ada342c094e7 Mon Sep 17 00:00:00 2001 From: thepra Date: Wed, 7 Oct 2026 00:20:56 +0200 Subject: [PATCH] Tests click exactly what they mean A card's time is a "Post" button now (its nerd stats open with a tap), so the poll test submits through the composer's own submit button instead of the last button named Post; the feed-memory test opens a thread from the Expand button, not from the first expand/ link, which on a desktop is now the phone-only Thread entry. The Back flow presses Back with history.back(): a Back held to close an overlay loads nothing, which GoBackAsync waited for. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw --- tests/e2e/Actions/ComposerTests.cs | 3 ++- tests/e2e/Actions/FeedMemoryTests.cs | 2 +- tests/e2e/Mobile/FlowTests.cs | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/e2e/Actions/ComposerTests.cs b/tests/e2e/Actions/ComposerTests.cs index ff2adf4..8d3c58e 100644 --- a/tests/e2e/Actions/ComposerTests.cs +++ b/tests/e2e/Actions/ComposerTests.cs @@ -42,7 +42,8 @@ namespace decePubClient.E2E.Actions await choices.Nth(1).FillAsync("coffee"); // and in the language picked await page.Locator("[data-compose-language]").First.SelectOptionAsync("it"); - await page.GetByRole(AriaRole.Button, new() { Name = "Post" }).Last.ClickAsync(); + // (the composer's own submit: a card's time is a "Post" button too, its nerd stats) + await page.Locator("form:has(textarea[data-compose]) button[type=submit]").First.ClickAsync(); JsonNode latest = null; Assert.True(await Pasture.Eventually(async () => (latest = await Latest(persona))?["content"]?.GetValue().Contains(text) == true, 15), "the poll was never published"); diff --git a/tests/e2e/Actions/FeedMemoryTests.cs b/tests/e2e/Actions/FeedMemoryTests.cs index 0a812f8..088f0e1 100644 --- a/tests/e2e/Actions/FeedMemoryTests.cs +++ b/tests/e2e/Actions/FeedMemoryTests.cs @@ -33,7 +33,7 @@ namespace decePubClient.E2E.Actions homeReads++; }; await page.EvalOnSelectorAsync("#feed-scroll", "root => root.scrollTop = 0"); - await page.Locator("article[data-uri] footer a[href^='expand/']").First.ClickAsync(); + await page.Locator("article[data-uri] footer a[title='Expand']").First.ClickAsync(); await page.WaitForURLAsync("**/expand/**"); await page.GoBackAsync(); await page.Locator("article[data-uri]").First.WaitForAsync(new() { Timeout = 10000 }); diff --git a/tests/e2e/Mobile/FlowTests.cs b/tests/e2e/Mobile/FlowTests.cs index 6da7411..f28884c 100644 --- a/tests/e2e/Mobile/FlowTests.cs +++ b/tests/e2e/Mobile/FlowTests.cs @@ -327,10 +327,12 @@ namespace decePubClient.E2E.Mobile await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == "/"); await page.Locator("#feed-scroll article[data-uri]").First.WaitForAsync(); + // (history.back(), as the Back button does: a Back held to close an overlay loads nothing, which GoBackAsync would + // wait for) async Task BackCloses(ILocator open, string what) { await Assertions.Expect(open).ToBeVisibleAsync(); - await page.GoBackAsync(); + await page.EvaluateAsync("() => history.back()"); await Assertions.Expect(open).ToBeHiddenAsync(new() { Timeout = 5000 }); Assert.True(new Uri(page.Url).AbsolutePath == "/", $"Back after the {what} left the feed for {page.Url}"); } @@ -350,7 +352,7 @@ namespace decePubClient.E2E.Mobile await BackCloses(page.Locator("aside[role=dialog]"), "full-screen globe"); // with nothing open, Back leaves the feed as before - await page.GoBackAsync(); + await page.EvaluateAsync("() => history.back()"); await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == "/explore", new() { Timeout = 10000 }); }); }