kammer/e2e/steps/pages/dashboard.steps.ts
Christopher Mühl 307ef24b78 test: E2E test suite + handoff documentation
50 Playwright E2E tests across 13 spec files covering all routes and
user flows (items CRUD, check-out/in, locations, labels, scanning,
search/filter). Uses vitest as runner with playwright-core for browser
automation (bun-compatible alternative to @playwright/test).

Includes Gherkin .feature files as living documentation, test support
infrastructure (IDB seeding, item factories, assertion helpers, layout
measurement), and HANDOFF.md covering project state, deployment, and
open design decisions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:53:08 +01:00

16 lines
715 B
TypeScript

import { expect } from '@playwright/test';
import { createBdd } from 'playwright-bdd';
import { buildItem, buildCheckedOutItem, buildConsumableItem } from '../../support/item-factory';
import { seedAndNavigate } from '../../support/seed';
const { Given: given, When: when, Then: then } = createBdd();
then('I should see {int} stat cards', async ({ page }, count: number) => {
const cards = page.locator('.grid .bg-slate-800');
await expect(cards).toHaveCount(count);
});
then('the {string} stat should show {string}', async ({ page }, label: string, value: string) => {
const card = page.locator('.bg-slate-800').filter({ hasText: label });
await expect(card.locator('.text-2xl')).toHaveText(value);
});