test: stabilize assistant e2e

This commit is contained in:
ginnoir
2026-07-08 17:48:06 -05:00
parent 4c82d551ea
commit 1092941c45
2 changed files with 20 additions and 2 deletions
+12 -1
View File
@@ -1,4 +1,13 @@
import { expect, test } from "@playwright/test";
import { expect, test, type Page } from "@playwright/test";
async function ensureSignedIn(page: Page) {
await page.goto("/");
const devLogin = page.getByRole("button", { name: "Dev login" });
if (await devLogin.isVisible().catch(() => false)) {
await devLogin.click();
await page.waitForURL((url) => !url.pathname.startsWith("/login"));
}
}
test("assistant bubble is hidden until opted in", async ({ page }) => {
await page.goto("/");
@@ -6,11 +15,13 @@ test("assistant bubble is hidden until opted in", async ({ page }) => {
});
test("assistant chat smoke after opt-in", async ({ page }) => {
await ensureSignedIn(page);
await page.goto("/settings?s=appearance");
const assistantSwitch = page.getByRole("switch", { name: "AI assistant" });
if (!(await assistantSwitch.isChecked())) {
await assistantSwitch.click();
}
await expect(assistantSwitch).toBeChecked();
await page.goto("/");
await page.getByRole("button", { name: "Open assistant" }).click();