e2e: sign-in spec enters the emailed code; linked-products waits for the click and the 60 s cache
The Events e2e suite on Postgres: 111/111 (volunteers 'asks for cover' is flaky: it passed alone and in the run before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,11 +82,18 @@ test.describe.serial("signing in through the church's Accounts", () => {
|
||||
await page.getByLabel("Email address").fill(email);
|
||||
await page.getByLabel("Password").fill(password);
|
||||
await page.getByRole("button", { name: "Sign in" }).click();
|
||||
// A privacy notice published by an earlier spec, or the news question: answer and carry on.
|
||||
// Someone who never signed in to Events confirms their email with the code Accounts sends; a
|
||||
// privacy notice published by an earlier spec, or the news question: answer and carry on.
|
||||
const accept = page.getByRole("button", { name: "I've read it" });
|
||||
const cont = page.getByRole("button", { name: "Continue" });
|
||||
const checkEmail = page.getByRole("heading", { name: "Check your email" });
|
||||
for (let i = 0; i < 10 && new URL(page.url()).origin !== SITE; i++) {
|
||||
if (await accept.isVisible()) await accept.click();
|
||||
if (await checkEmail.isVisible()) {
|
||||
const code = (await (await page.request.get(`${ACCOUNTS_API}/test/code?to=${encodeURIComponent(email)}`)).text()).trim();
|
||||
await page.getByLabel("Code").fill(code);
|
||||
await cont.click();
|
||||
await expect(checkEmail).toBeHidden();
|
||||
} else if (await accept.isVisible()) await accept.click();
|
||||
else if (await cont.isVisible()) await cont.click();
|
||||
else await page.waitForTimeout(500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user