feat/welcome-letter integration (#2)
CI / Generate Certificates (push) Successful in 42s
CI / Frontend CI (push) Successful in 1m8s
CI / Backend CI (push) Successful in 1m7s
CI / E2E Tests (push) Has been skipped

Co-authored-by: me <ramvignesh-b@github.com>
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-05-06 16:46:53 +00:00
parent 8449377b6d
commit 8d0ab979f5
13 changed files with 361 additions and 89 deletions
+29 -1
View File
@@ -54,6 +54,34 @@ async function registerAndLogin(
await page.getByRole("button", { name: /sign in/i }).click();
await expect(page).toHaveURL(/\/drawer/);
await handleWelcomeLetter(page);
logger.info(`[Auth] Successfully authenticated ${email}`);
}
export const AuthHelper = { registerAndLogin };
/**
* Handles and dismisses the first welocme letter
*/
async function handleWelcomeLetter(page: Page) {
logger.info("[Auth] Handling Welcome Letter...");
// Click envelope to flip
const envelope = page.locator("#env-front");
await envelope.waitFor({ state: "visible", timeout: 10000 });
await envelope.click();
// Click seal to open flap
const seal = page.getByAltText("Seal");
await seal.waitFor({ state: "visible" });
await seal.click();
// Click letter to reveal
await page.locator("#letter").click({ position: { x: 30, y: 15 } });
// Click "I'll see you" button
const completeButton = page.getByRole("button", { name: /I'll see you/i });
await completeButton.waitFor({ state: "visible", timeout: 10000 });
await completeButton.click();
await expect(completeButton).toBeHidden();
}
export const AuthHelper = { registerAndLogin, handleWelcomeLetter };