Files
buzz/desktop/tests/e2e/signout-screenshots.spec.ts
Will Pfleger cf97237965 feat(desktop): add Sign Out to Settings to reset and relaunch (#1842)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-14 16:52:57 -04:00

71 lines
2.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { expect, test } from "@playwright/test";
import { installMockBridge } from "../helpers/bridge";
import { openSettings } from "../helpers/settings";
const SHOTS = "test-results/signout";
test.describe("signout screenshots", () => {
test.use({ viewport: { width: 1280, height: 900 } });
test.beforeEach(async ({ page }) => {
page.on("pageerror", (err) => {
console.error(
"PAGE ERROR:",
err.message,
err.stack?.split("\n").slice(0, 5).join("\n"),
);
});
page.on("console", (msg) => {
if (msg.type() === "error") {
console.error("CONSOLE ERROR:", msg.text().slice(0, 500));
}
});
});
test("signout-section — Sign Out card in Settings › Profile", async ({
page,
}) => {
await installMockBridge(page);
await page.goto("/", { waitUntil: "domcontentloaded" });
await openSettings(page, "profile");
const section = page.getByTestId("settings-signout");
await section.scrollIntoViewIfNeeded();
// Settle animations before capture.
await page.evaluate(() =>
Promise.all(document.getAnimations().map((a) => a.finished)),
);
await page.waitForTimeout(200);
await section.screenshot({ path: `${SHOTS}/signout-section.png` });
});
test("signout-dialog — AlertDialog shown before the wipe runs", async ({
page,
}) => {
await installMockBridge(page);
await page.goto("/", { waitUntil: "domcontentloaded" });
await openSettings(page, "profile");
const section = page.getByTestId("settings-signout");
await section.scrollIntoViewIfNeeded();
// Open the confirmation dialog.
await page.getByTestId("signout-open-dialog").click();
const dialog = page.getByRole("alertdialog");
await expect(dialog).toBeVisible({ timeout: 5_000 });
await expect(dialog.getByText("Sign out and wipe all data?")).toBeVisible();
// Settle animations before capture.
await page.evaluate(() =>
Promise.all(document.getAnimations().map((a) => a.finished)),
);
await page.waitForTimeout(200);
await page.screenshot({ path: `${SHOTS}/signout-dialog.png` });
});
});