Files
clawmates/frontend/tests/e2e/p0-shell.spec.ts
T
Omar SobhandClaude Fable 5 add4f79fed Rebrand: TeamClaw -> Clawmates (clawmates.work)
Full-depth rename per the approved plan; the 'claw' product vocabulary
(claws, /claws routes, clawId, Claw Chat) stays — it is now the brand.

- Display brand: Clawmates (manifest, titles, hero, login/rail logo
  'clawmates'); default host app.clawmates.work; registry
  ghcr.io/clawmates
- Crates tc-* -> cm-* (16 crates + all imports); binaries
  clawmates-server/broker/bundler; images clawmates/*; env prefix
  CLAWMATES_* (+ CM_TEST_DATABASE_URL / CM_LIVE_LLM); config
  clawmates.toml; helm chart deploy/helm/clawmates with clawmates-*
  resources; db names clawmates*; sockets /run/clawmates; cookie
  cm_session; kind cluster clawmates-test; seccomp node profile
  clawmates-agent-profile.json
- All 9 Playwright brand assertions updated in lockstep; historical
  spec document left untouched as the only remaining 'TeamClaw'
- Local env migrated: dev pg clawmates-dev-pg/clawmates_dev, shared
  test server clawmates-test-pg, kind cluster recreated with image +
  profile, compose images rebuilt under clawmates/*

Verified end to end: 161 Rust + 68 frontend tests, 29 Playwright
journeys, 4 live kind tests, helm/install/LOC/placeholder gates, and
the clean-room install rehearsal serving the clawmates login page from
a signed bundle of the rebuilt images.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-10 12:31:25 -05:00

82 lines
2.9 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.getByLabel("Password").fill(OWNER_PASSWORD);
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page.getByRole("heading", { name: "Clawmates" })).toBeVisible();
}
test("unauthenticated visitors are redirected to login", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveURL(/\/login$/);
await expect(page.getByRole("button", { name: "Sign in" })).toBeVisible();
});
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.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.getByText("1,250")).toBeVisible();
});
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$/);
await page.goto("/");
await expect(page).toHaveURL(/\/login$/);
});