Files
CapaKraken/apps/web/e2e/estimates.spec.ts
T
Hartmut cd78f72f33 chore: full technical rename planarchy → capakraken
Complete rename of all technical identifiers across the codebase:

Package names (11 packages):
- @planarchy/* → @capakraken/* in all package.json, tsconfig, imports

Import statements: 277 files, 548 occurrences replaced

Database & Docker:
- PostgreSQL user/db: planarchy → capakraken
- Docker volumes: planarchy_pgdata → capakraken_pgdata
- Connection strings updated in docker-compose, .env, CI

CI/CD:
- GitHub Actions workflow: all filter commands updated
- Test database credentials updated

Infrastructure:
- Redis channel: planarchy:sse → capakraken:sse
- Logger service name: planarchy-api → capakraken-api
- Anonymization seed updated
- Start/stop/restart scripts updated

Test data:
- Seed emails: @planarchy.dev → @capakraken.dev
- E2E test credentials: all 11 spec files updated
- Email defaults: @planarchy.app → @capakraken.app
- localStorage keys: planarchy_* → capakraken_*

Documentation: 30+ .md files updated

Verification:
- pnpm install: workspace resolution works
- TypeScript: only pre-existing TS2589 (no new errors)
- Engine: 310/310 tests pass
- Staffing: 37/37 tests pass

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-27 13:18:09 +01:00

79 lines
2.9 KiB
TypeScript

import { expect, test } from "@playwright/test";
test.describe("Estimates", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/auth/signin");
await page.fill('input[type="email"]', "admin@capakraken.dev");
await page.fill('input[type="password"]', "admin123");
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/\/(dashboard|resources)/);
await page.goto("/estimates");
});
test("estimate list loads", async ({ page }) => {
await page.waitForLoadState("networkidle");
await expect(
page.locator("h1").filter({ hasText: /Estimates/i }),
).toBeVisible({ timeout: 10000 });
// Should show either a table/list or an empty state
await expect(
page.locator("table").or(page.locator("text=No estimates")).or(page.locator("[data-estimate-id]")),
).toBeVisible({ timeout: 10000 });
});
test("new estimate wizard opens with setup step", async ({ page }) => {
await page.waitForLoadState("networkidle");
const newBtn = page.locator("button", { hasText: /New Estimate/i });
await expect(newBtn).toBeVisible({ timeout: 10000 });
await newBtn.click();
// Wizard step 1 should appear: "Setup"
await expect(
page.locator("text=Setup").or(page.locator("text=Estimate Name")),
).toBeVisible({ timeout: 5000 });
});
test("estimate wizard navigates through steps", async ({ page }) => {
await page.waitForLoadState("networkidle");
await page.locator("button", { hasText: /New Estimate/i }).click();
// Step 1: Setup — fill a name
await expect(page.locator("text=Setup")).toBeVisible({ timeout: 5000 });
const nameInput = page.locator('input[placeholder*="name"]').or(page.locator('input[name="name"]')).first();
if ((await nameInput.count()) > 0) {
await nameInput.fill(`E2E Estimate ${Date.now()}`);
}
// Click Next to go to step 2
const nextBtn = page.locator("button", { hasText: "Next" });
if ((await nextBtn.count()) > 0) {
await nextBtn.click();
await page.waitForTimeout(500);
// Step 2: Assumptions
await expect(
page.locator("text=Assumptions").or(page.locator("text=Scope")),
).toBeVisible({ timeout: 5000 });
}
// Close the wizard without completing
const cancelBtn = page.locator("button", { hasText: /Cancel|Close/i }).first();
if ((await cancelBtn.count()) > 0) {
await cancelBtn.click();
} else {
await page.keyboard.press("Escape");
}
});
test("estimate wizard shows all step labels", async ({ page }) => {
await page.waitForLoadState("networkidle");
await page.locator("button", { hasText: /New Estimate/i }).click();
// The wizard header should show step labels
const steps = ["Setup", "Assumptions", "Scope", "Staffing", "Review"];
for (const step of steps) {
await expect(page.locator(`text=${step}`).first()).toBeVisible({ timeout: 5000 });
}
await page.keyboard.press("Escape");
});
});