ci(smoke): wait for the keychain strip before judging #105 step 2 #47
@@ -406,11 +406,16 @@ record(
|
||||
try {
|
||||
await page.evaluate(([k, f]) => localStorage.setItem(k, JSON.stringify(f)), [KEY, fake]);
|
||||
await page.reload();
|
||||
const moved = await until(async () => {
|
||||
// Step 2 mirrors the tokens, reads them back to verify, and only then strips
|
||||
// them from localStorage, all in the same boot. Wait for the strip rather
|
||||
// than stopping at the first "mirrored" sighting (that in-between state made
|
||||
// a step-2 build look like a step-1 one).
|
||||
const stripped = await until(async () => {
|
||||
const st = await state();
|
||||
return st.tokensIn === 'keychain' || (st.blobHasToken && st.kcToken === fake.accessToken) ? st : undefined;
|
||||
return st.tokensIn === 'keychain' ? st : undefined;
|
||||
}, 30_000);
|
||||
if (moved && moved.tokensIn !== 'keychain') {
|
||||
const moved = stripped ?? (await state());
|
||||
if (!stripped && moved.blobHasToken && moved.kcToken === fake.accessToken) {
|
||||
record(name, 'n/a', 'build mirrors the tokens but keeps them in localStorage (before step 2)');
|
||||
} else {
|
||||
await page.reload();
|
||||
|
||||
Reference in New Issue
Block a user