Skip to content

test(fe): run the session-ending scenarios in a browser - #4290

Open
sea-snake wants to merge 138 commits into
test/session-e2e-tabs-and-siblingsfrom
test/session-e2e-ending-a-session
Open

test(fe): run the session-ending scenarios in a browser#4290
sea-snake wants to merge 138 commits into
test/session-e2e-tabs-and-siblingsfrom
test/session-e2e-ending-a-session

Conversation

@sea-snake

@sea-snake sea-snake commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

The "Ending a session" scenarios of docs/ongoing/session-test-scenarios.md — EXIT-1, EXIT-3, EXIT-5 and EXIT-6 — and the silent re-issue that has nothing left to answer from.

Access that can be ended is the point of the design, so this is where it gets ended: by the app signing out, and by the identity's owner signing a whole browser out from settings.

The settings scenario is the one to read: END-5 lets an app keep working until the delegation it holds expires, so nothing shows the moment access is revoked, and it is the next mint that discovers the session is gone. The test therefore ages the delegation and asks for a replacement rather than expecting an instant answer.

@sea-snake
sea-snake marked this pull request as ready for review August 26, 2026 12:56
@sea-snake
sea-snake requested a review from a team as a code owner August 26, 2026 12:56
@sea-snake sea-snake added feature:revocable-app-sessions Design: revocable app sessions feature:silent-reauth-redirect Design: silent re-auth over the redirect transport labels Aug 26, 2026
@sea-snake
sea-snake requested a lite review from Copilot August 26, 2026 12:56
@zeropath-ai

zeropath-ai Bot commented Aug 26, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 37e2025.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► src/frontend/tests/e2e-playwright/routes/authorize/app-sessions/ending-a-session.spec.ts
      Add end-to-end tests for ending a session via various scenarios

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Playwright E2E spec that exercises the “Ending a session” browser scenarios (EXIT-1, EXIT-3, EXIT-5, EXIT-6) to validate session teardown behavior when signing out in-app and when signing the whole browser out from II settings.

Changes:

  • Introduces E2E coverage for sign-out persistence across reload and for silent re-auth failing when there is no session to resume.
  • Verifies that “sign out this browser” from settings revokes access (detected on next delegation refresh after aging).
  • Adds multi-origin checks: signing out of one app/origin doesn’t affect another, and a signed-out browser entry is reused after signing back in.
Suppressed comments (1)

src/frontend/tests/e2e-playwright/routes/authorize/app-sessions/ending-a-session.spec.ts:138

  • locator.count() does not wait for the list to render. If the "Sign out" buttons haven’t appeared yet, listed can be 0 and the later toHaveCount(listed) check becomes vacuous. Also, the "Signed out" visibility check uses the default 5s expect timeout, which can be flaky for a backend-driven sign-out.
    const listed = await settings
      .getByRole("button", { name: "Sign out" })
      .count();
    await settings.getByRole("button", { name: "Sign out" }).first().click();
    await expect(settings.getByText("Signed out")).toBeVisible();

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sea-snake
sea-snake force-pushed the test/session-e2e-ending-a-session branch from ea59096 to f229a79 Compare August 26, 2026 13:07
@sea-snake
sea-snake force-pushed the test/session-e2e-ending-a-session branch from f229a79 to 797d383 Compare August 26, 2026 13:34
@sea-snake
sea-snake force-pushed the test/session-e2e-ending-a-session branch from 797d383 to 4cc006d Compare August 26, 2026 13:36
@sea-snake
sea-snake force-pushed the test/session-e2e-ending-a-session branch from 4cc006d to aeb6fd6 Compare August 26, 2026 13:53
sea-snake and others added 16 commits September 9, 2026 02:50
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVi99RYo2jyi2kCurgovNJ
@sea-snake
sea-snake removed this pull request from stack #4294 September 9, 2026 20:42
@sea-snake
sea-snake added this pull request to stack #4327 September 9, 2026 20:44
test("picks an identity and continues", signInAsFirstIdentity);
});

test.describe("signing the browser out from settings ends the app's access", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this sign into two apps before signing the browser out? With one app this only proves that one session was revoked. EXIT-3 is meant to prove that the browser-wide action removes every app session for that browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:revocable-app-sessions Design: revocable app sessions feature:silent-reauth-redirect Design: silent re-auth over the redirect transport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants