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>
15 lines
594 B
TypeScript
15 lines
594 B
TypeScript
import { expect } from '@playwright/test';
|
|
import { createBdd } from 'playwright-bdd';
|
|
|
|
const { Given: given, When: when, Then: then } = createBdd();
|
|
|
|
then('I should see {int} items at the selected location', async ({ page }, count: number) => {
|
|
const items = page.locator('button.bg-slate-800');
|
|
await expect(items).toHaveCount(count);
|
|
});
|
|
|
|
then('the location tree should show item counts', async ({ page }) => {
|
|
// Item counts appear in the tree nodes
|
|
const counts = page.locator('.text-slate-500').filter({ hasText: /\d+ items?/ });
|
|
await expect(counts.first()).toBeVisible();
|
|
});
|