fix(funkwhale): click through Funkwhale's own log-out confirmation

Variant 2 of the swarm matrix fails the sign-out assertion for both personas,
and variant 0 fails the same assertion for a different reason. The artefacts of
run 31658241728 separate the two states. Variant 0's snapshot at failure is the
universal-logout terminal page (`- text: You have been logged out.`): the
session is gone and the test only had to return to the app, which f683d18b8
does.

Variant 2 stops one step earlier, for administrator and for biber alike:

  - heading "Are you sure you want to log out?" [level=2]
  - paragraph: You are currently logged in as administrator
  - button "Yes, log me out!"

Clicking the sidebar control routes Funkwhale to its own confirmation view, and
the session survives until that button is pressed. Returning to the app base and
asserting a sign-in offer therefore fails, and it would keep failing with
f683d18b8 alone -- that commit navigates away from the dialog without answering
it.

The new block presses the confirmation when it appears. One click covers both
personas, and the artefact lists no other failing test in the job.

Variant 0 is unaffected: its terminal page carries no button at all, so the probe
expires and the flow continues as before, at the cost of ten idle seconds.

The name regex is measured against the observed strings rather than assumed. It
matches "Yes, log me out!", "Log out", "Sign out" and "Logout", and rejects
"Log in" and "Sign in", so it cannot re-select the sign-in affordance that the
next assertion looks for.

Not verified: the click has not been run against a live instance. What is proven
is that the button is there and that the selector selects it, not that Funkwhale
ends the session afterwards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-08-14 02:02:30 +02:00
1 parent a30fb79a79
commit b6e3368a21
1 file changed
+9
@@ -100,6 +100,15 @@ for (const persona of PERSONAS) {
await gotoOnion(page, `${appBaseUrl}/logout`, { waitUntil: "domcontentloaded" });
}
const confirmSignOut = page.getByRole("button", { name: /(log|sign)\s?(me\s?)?out/i }).first();
const confirmReachable = await confirmSignOut
.waitFor({ state: "visible", timeout: resolveTimeout(10_000) })
.then(() => true)
.catch(() => false);
if (confirmReachable) {
await confirmSignOut.click();
}
await gotoOnion(page, appBaseUrl, { waitUntil: "domcontentloaded" });
await expect(