feat/welcome-letter integration #2

Merged
me merged 5 commits from feature/welcome-letter into main 2026-05-06 16:46:53 +00:00
3 changed files with 31 additions and 3 deletions
Showing only changes of commit c0fb7aabf8 - Show all commits
+1 -1
View File
@@ -208,7 +208,7 @@ test.describe("Letter Drafting (Real Backend)", () => {
// Verify it opens the Reader without a hash // Verify it opens the Reader without a hash
logger.info(">> [Drawer] Verifying Reader page..."); logger.info(">> [Drawer] Verifying Reader page...");
// Give it a bit more time for decryption // Give it a bit more time for decryption
await expect(page).toHaveURL(/\/read\/[a-f0-9-]{36}$/, { timeout: 15000 }); // UUID without hash await expect(page).toHaveURL(/\/read\/[a-f0-9-]{36}$/, { timeout: 15000 });
// Reveal and check decrypted content in Reader // Reveal and check decrypted content in Reader
await expect(page.getByText(/breaking the seal/i)).toBeHidden({ await expect(page.getByText(/breaking the seal/i)).toBeHidden({
timeout: 10000, timeout: 10000,
+29 -1
View File
@@ -54,6 +54,34 @@ async function registerAndLogin(
await page.getByRole("button", { name: /sign in/i }).click(); await page.getByRole("button", { name: /sign in/i }).click();
await expect(page).toHaveURL(/\/drawer/); await expect(page).toHaveURL(/\/drawer/);
await handleWelcomeLetter(page);
logger.info(`[Auth] Successfully authenticated ${email}`); 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 };
+1 -1
View File
@@ -15,7 +15,7 @@ const baseUrl = getBaseUrl(
); );
export default defineConfig({ export default defineConfig({
timeout: 60000, timeout: 80000,
expect: { expect: {
timeout: 10000, timeout: 10000,
}, },