Skip to content
Open
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
3345cf2
test(fe): run the tab and sibling-subdomain session scenarios in a br…
sea-snake Aug 26, 2026
c20097b
test(fe): ask the app what it holds, in the tab and sibling scenarios
sea-snake Aug 26, 2026
b027c00
test(fe): say the protocol in the tabs-and-siblings scenarios
sea-snake Aug 26, 2026
afa81b6
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
b6a5280
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
dd5cadd
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
58e7636
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
60e8c45
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
4f15be1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Aug 31, 2026
e74886b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 1, 2026
195685a
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 1, 2026
ca71914
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 1, 2026
a19a3e1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 1, 2026
bb749e5
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 1, 2026
8df8510
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 2, 2026
f336c33
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
1ea4217
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
59b8360
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
c270816
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
a054b79
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
ef00979
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
8d1febc
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 4, 2026
7820161
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
ac4224e
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
db8ab04
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
710fc9b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
a1de8ea
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
e40fc0b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
c1426a5
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
a181172
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
285d049
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
5f6d700
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
5ca2bee
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
36a35c3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
dbfdc79
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
577d41d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
f411026
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
75aa722
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
349e80f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
1f2e1e4
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
e0691a0
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
6de973e
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
4c0df99
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
38ac553
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
5bfab49
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
8473193
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
eba504d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
9867ec2
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
00b530b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
4ee8ecf
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
c4ac676
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
52421da
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
58b799a
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
bc29939
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
89f0fcf
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
bb3771f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
623739f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
9d8adad
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
1db89ed
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
182ea35
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
f2710cf
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
0d1f7ef
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
28bee6b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
8250df3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
7bfa59f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 5, 2026
09e37ed
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
895e839
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
370ea05
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
df1d6dc
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
4a47f65
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
69e99a3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
4a3a1c7
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
5d46a35
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
8f5e7f3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
919d7f1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
701b164
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
58dcedb
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
1c6ded4
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
53e37b2
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
d2e18d0
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
b0ab0a3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
11cdfe6
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 6, 2026
3a1e2a4
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
5fd81fc
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
c03b5d4
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
a6be9e0
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
65a753d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
78107eb
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
1984ce1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
8086bc6
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
679aebc
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
3afd87d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
0651b9a
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
ac5c1f3
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 7, 2026
a9458d7
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 8, 2026
1aea857
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 8, 2026
512487f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 8, 2026
ac3f26d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 8, 2026
4e25845
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
724f579
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
8798ce5
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
a26d010
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
02c9324
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
3c1e15d
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
12d020a
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
3178244
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
f861d62
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 8, 2026
6dd92b1
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 9, 2026
b67bc23
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 9, 2026
b51c2f5
chore: merge test/session-e2e-staying-signed-in
sea-snake Sep 9, 2026
f840d07
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
2b4d949
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
b580857
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
9bcf603
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
28f263a
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
adc2d0b
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
8386b38
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
6eac12d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
02e4395
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
be61cbb
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
5f672db
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
233b2af
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
5d00a3a
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
461bd44
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
610a5ec
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 9, 2026
7aa7716
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
1a18e5e
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
07315d8
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
681f71f
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
09e29c2
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
7cd90b1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
0231562
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
408bc28
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
d49d385
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
1ae5094
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
2002845
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 10, 2026
f7dbd97
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
cf4bb0d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
7ff3d15
test(fe): a sibling holds nothing, which is not being signed out
sea-snake Sep 11, 2026
e081743
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
8d53295
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
35337e1
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
f353fe2
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
4c84947
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
7187e0c
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
c26cc50
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
3ee2aee
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
40f6b3d
Merge branch 'test/session-e2e-staying-signed-in' into test/session-e…
sea-snake Sep 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import { test } from "../../../fixtures";
import {
TEST_APP_DERIVATION_ORIGIN,
TEST_APP_SIBLING_A_URL,
TEST_APP_SIBLING_B_URL,
} from "../../../utils";
import { continueAs, SHARED_DOMAIN, signInAsFirstIdentity } from "./helpers";

/**
* One sign-in serves every tab of an origin, and every subdomain of a domain
* that announces it. These scenarios are about that reach: a tab or a sibling
* that was never signed in to arrives working, and loses it when the one that
* signed in signs out.
*
* Runs the "More than one tab, and sibling subdomains" scenarios of
* `docs/ongoing/session-test-scenarios.md` — SHARE-1, SHARE-2, SHARE-3, SHARE-5
* and SHARE-6.
*/
test.describe("more than one tab, and sibling subdomains", () => {
test.use({ authorizeConfig: { protocol: "icrc25" } });

test.describe("a second tab of the origin is already signed in", () => {
test.afterEach(async ({ signedInApp, openTestApp, context }) => {
const account = await signedInApp.accountPrincipal();

const second = openTestApp(await context.newPage());
await second.visit();

await second.waitUntilSignedIn();
await second.expectAccount(account);
await second.close();
});

test("picks an identity and continues", signInAsFirstIdentity);
});

test.describe("signing out in one tab is noticed in the other", () => {
test.afterEach(async ({ signedInApp, openTestApp, context }) => {
const second = openTestApp(await context.newPage());
await second.visit();
await second.waitUntilSignedIn();

await signedInApp.signOut();

await second.expectSignedOut();
await second.close();
});

test("picks an identity and continues", signInAsFirstIdentity);
});

test.describe("closing a tab does not disturb the others", () => {
test.afterEach(async ({ signedInApp, openTestApp, context }) => {
const second = openTestApp(await context.newPage());
await second.visit();
await second.waitUntilSignedIn();
await second.close();

await signedInApp.replaceDelegation();
await signedInApp.waitUntilSignedIn();
await signedInApp.expectHoldsDelegation();
});

test("picks an identity and continues", signInAsFirstIdentity);
});

// The two below configure the app per subdomain — a derivation origin and the
// domain to announce the session across — which `authorizeConfig` has no field
// for, so they drive the app themselves.

test("a sibling subdomain resumes from what the domain shares", async ({
testApp,
openTestApp,
context,
identities,
signInWithIdentity,
}) => {
await testApp.visit();
await testApp.declareAlternativeOrigins([
TEST_APP_SIBLING_A_URL,
TEST_APP_SIBLING_B_URL,
]);

await testApp.open({
url: TEST_APP_SIBLING_A_URL,
derivationOrigin: TEST_APP_DERIVATION_ORIGIN,
cookieDomain: SHARED_DOMAIN,
});
await testApp.signIn(
continueAs(identities[0].identityNumber, signInWithIdentity),
);
const account = await testApp.accountPrincipal();

// HINT-1: the domain announces the session to its subdomains.
await testApp.expectSharesSession();

const other = openTestApp(await context.newPage());
await other.open({
url: TEST_APP_SIBLING_B_URL,
derivationOrigin: TEST_APP_DERIVATION_ORIGIN,
cookieDomain: SHARED_DOMAIN,
});
// Never signed in here, but the domain announces that a session exists. That
// is its own state rather than signed out: there is something to resume
// from, and this origin simply holds nothing for it yet.
await other.expectSharesSession();
await other.expectSharedButNotHeld();

// SIL-5: it re-issues its own chain from the same session.
await other.silentReauth();
await other.expectSilentReauthSucceeded();
await other.expectAccount(account);
await other.close();
});

test("signing out on one subdomain signs the siblings out", async ({
testApp,
openTestApp,
context,
identities,
signInWithIdentity,
}) => {
await testApp.visit();
await testApp.declareAlternativeOrigins([
TEST_APP_SIBLING_A_URL,
TEST_APP_SIBLING_B_URL,
]);

await testApp.open({
url: TEST_APP_SIBLING_A_URL,
derivationOrigin: TEST_APP_DERIVATION_ORIGIN,
cookieDomain: SHARED_DOMAIN,
});
await testApp.signIn(
continueAs(identities[0].identityNumber, signInWithIdentity),
);

const other = openTestApp(await context.newPage());
await other.open({
url: TEST_APP_SIBLING_B_URL,
derivationOrigin: TEST_APP_DERIVATION_ORIGIN,
cookieDomain: SHARED_DOMAIN,
});
await other.silentReauth();
await other.expectSilentReauthSucceeded();

// HINT-3: signing out retracts what the domain shares, so the sibling has
// nothing to resume from and asks the user instead.
await testApp.focus();
await testApp.signOut();
await testApp.expectSignedOut();

await other.focus();
await other.reload();
await other.expectSharesNothing();
await other.expectSignedOut();
await other.close();
});
});
Loading