Files
phaseflow/e2e/smoke.spec.ts
Petru Paler 6bd5eb663b Add Playwright E2E testing infrastructure
- Add playwright-web-flake to flake.nix for NixOS browser support
- Pin @playwright/test@1.56.1 to match nixpkgs version
- Create playwright.config.ts with Chromium-only, auto-start dev server
- Add e2e/smoke.spec.ts with initial smoke tests
- Add .mcp.json for Claude browser control via MCP
- Update .gitignore for playwright artifacts
- Remove E2E test skip from spec.md Known Limitations
- Update specs/testing.md to require three-tier testing approach

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 21:43:24 +00:00

37 lines
1.1 KiB
TypeScript

// ABOUTME: Smoke tests to verify basic application functionality.
// ABOUTME: Tests that the app loads and critical pages are accessible.
import { expect, test } from "@playwright/test";
test.describe("smoke tests", () => {
test("app loads with correct title", async ({ page }) => {
await page.goto("/");
// Verify the app loads by checking the page title
await expect(page).toHaveTitle("PhaseFlow");
});
test("login page is accessible", async ({ page }) => {
await page.goto("/login");
// Verify login page loads
await expect(page).toHaveURL(/\/login/);
});
test("unauthenticated root redirects or shows login option", async ({
page,
}) => {
await page.goto("/");
// The app should either redirect to login or show a login link
// Check for either condition
const url = page.url();
const hasLoginInUrl = url.includes("/login");
const loginLink = page.getByRole("link", { name: /login|sign in/i });
// At least one should be true: either we're on login page or there's a login link
if (!hasLoginInUrl) {
await expect(loginLink).toBeVisible();
}
});
});