Files
clawmates/frontend/tests/e2e/p0-shell.spec.ts
T
Omar SobhandClaude Opus 4.8 5638006eb6
ci / gates (push) Has been cancelled
ci / rust (push) Has been cancelled
ci / sandbox-k8s (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / e2e (push) Has been cancelled
feat(marketing): trim landing to hero, crew, hierarchy, security
Remove the Pitch, One-click, Works, Always-on and Skills sections and the
"Build your AI crew" footer CTA banner. Page is now Hero → CrewStrip →
Hierarchy → Security → FAQ → footer (dark tier kept). Prune the now-dead
section functions, consts, and imports (Image, skills icons). Repoint the
"marketing rendered" heading assertion (p0/p7/visual) from the removed
Pitch heading to the hero h1 (/agentic systems/); refresh the @visual baseline.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-15 16:06:05 -07:00

92 lines
3.4 KiB
TypeScript

import { expect, test } from "@playwright/test";
// P0 exit criterion (spec §17): an authenticated empty shell against the
// real backend. Seed data comes from clawmates-server's e2e mode.
const OWNER_EMAIL = "[email protected]";
const OWNER_PASSWORD = "e2e-password";
async function signIn(page: import("@playwright/test").Page) {
await page.goto("/login");
await page.getByLabel("Email").fill(OWNER_EMAIL);
await page.getByRole("button", { name: /Continue with work email/ }).click();
await page.getByLabel("Password").fill(OWNER_PASSWORD);
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
}
test("unauthenticated visitors see the marketing landing", async ({ page }) => {
await page.goto("/");
// "/" rewrites to the public marketing site for logged-out visitors.
await expect(
page.getByRole("heading", { name: /agentic systems/i }),
).toBeVisible();
// Sign-in is a link from the marketing nav.
await page.getByRole("link", { name: "Sign in" }).first().click();
await expect(page).toHaveURL(/\/login$/);
});
test("wrong password shows an error and stays on login", async ({ page }) => {
await page.goto("/login");
await page.getByLabel("Email").fill(OWNER_EMAIL);
await page.getByRole("button", { name: /Continue with work email/ }).click();
await page.getByLabel("Password").fill("wrong-password");
await page.getByRole("button", { name: "Sign in" }).click();
// Next.js's route announcer is also role="alert"; scope to the form's.
await expect(
page.getByRole("alert").filter({ hasText: "Invalid" }),
).toHaveText("Invalid email or password.");
await expect(page).toHaveURL(/\/login$/);
});
test("signing in reveals the shell: rail, roster, and current user", async ({
page,
}) => {
await signIn(page);
const rail = page.getByRole("complementary");
await expect(rail.getByText("clawmates")).toBeVisible();
await expect(
rail.getByRole("list", { name: "Your claws" }).getByText("Scout"),
).toBeVisible();
await expect(
rail.getByRole("status", { name: "Scout is online" }),
).toBeVisible();
await expect(rail.getByText("Avery Owner")).toBeVisible();
});
test("team page lists workspace members from the real API", async ({
page,
}) => {
await signIn(page);
await page.getByRole("link", { name: "Team" }).click();
await expect(
page.getByRole("heading", { name: "Team", exact: true }),
).toBeVisible();
await expect(page.getByText("1 member in your workspace")).toBeVisible();
const row = page.getByRole("row").filter({ hasText: "Avery Owner" });
await expect(row.getByText(OWNER_EMAIL)).toBeVisible();
await expect(row.getByText("Owner", { exact: true })).toBeVisible();
});
test("credits page shows the seeded balance", async ({ page }) => {
await signIn(page);
await page.getByRole("link", { name: "Credits" }).click();
await expect(
page.getByRole("heading", { name: "Credits", exact: true }),
).toBeVisible();
await expect(page.getByTestId("credit-balance")).toHaveText("1,250");
});
test("signing out returns to login and revokes the session", async ({
page,
}) => {
await signIn(page);
await page.getByRole("button", { name: "Sign out" }).click();
await expect(page).toHaveURL(/\/login$/);
// Session revoked: "/" no longer shows the app, it shows marketing.
await page.goto("/");
await expect(
page.getByRole("heading", { name: /agentic systems/i }),
).toBeVisible();
});