Files
openworker/surfaces/gui/e2e/cloud-signin-placement.spec.ts
T
Rohit C PrasadandDevika 2b45018ffa OpenWorker: initial import
Imported from andrewyng/aisuite@1b4bbf303e
(contents of its platform/ directory, hoisted to the repo root).
Development history prior to this commit lives in that repository.

Co-authored-by: Devika <devikaverma11@gmail.com>
2026-07-21 11:09:41 -07:00

44 lines
1.8 KiB
TypeScript

// Regression guard (shipped once, 2026-07-09; reshaped by §26): cloud sign-in must be
// reachable by a FRESH user. The sidebar account row is the permanent sign-in home —
// always visible, never below any fold — and every signed-out one-click pane carries a
// real Sign-in button, not a hint pointing at another page.
import { expect } from "@playwright/test";
import { test } from "./fixtures";
async function openConnectors(page) {
await page.goto("/");
await page.getByTestId("account-row").click();
await page.getByTestId("account-menu").getByRole("button", { name: "Connectors", exact: true }).click();
}
test("the account row is always visible and signs in from its menu", async ({ page }) => {
await page.goto("/");
const row = page.getByTestId("account-row");
await expect(row).toBeVisible();
await expect(row).toContainText("Not signed in");
await row.click();
await page.getByTestId("account-sign-in").click();
await expect(row).toContainText("Rohit", { timeout: 10_000 });
// Sign out is right there in the same menu once signed in.
await row.click();
await expect(
page.getByTestId("account-menu").getByRole("button", { name: "Sign out" }),
).toBeVisible();
});
test("signed-out one-click pane signs in inline, then connects", async ({ page }) => {
await openConnectors(page);
// Fresh user path: Available → Connect → the pane must offer sign-in itself.
await page
.getByTestId("connector-gmail")
.getByRole("button", { name: "Connect", exact: true })
.click();
await page.getByTestId("inline-cloud-sign-in").click();
// The mock signs in instantly; the section's poll re-renders the pane armed.
await expect(
page.getByRole("button", { name: /Connect Gmail with one click/i }),
).toBeVisible({ timeout: 10_000 });
});