kammer/e2e/specs/flows/label-generation.spec.ts
Christopher Mühl ba68fb456a 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

38 lines
1.2 KiB
TypeScript

/**
* @feature Label Generation Flow
* @see e2e/features/flows/label-generation.feature
*/
import { describe, test } from 'vitest';
import { setupBrowser } from '../../support/browser';
import { waitForAppReady } from '../../support/seed';
import { expectVisible } from '../../support/expect';
const { getPage } = setupBrowser();
describe('Label Generation Flow', () => {
test('generate a batch of IDs', async () => {
const page = getPage();
await page.goto('/labels');
await waitForAppReady(page);
await expectVisible(page.locator('.text-xs').filter({ hasText: 'Available IDs' }));
await page.locator('#batchSize').selectOption('10');
await page.getByRole('button', { name: 'Generate' }).click();
// Wait for generation to complete
await page.waitForFunction(() => {
const el = document.querySelector('.text-blue-400.text-2xl');
return el && el.textContent !== '0';
}, { timeout: 10000 });
});
test('labels page shows batch options', async () => {
const page = getPage();
await page.goto('/labels');
await waitForAppReady(page);
await expectVisible(page.getByText('Generate ID Batch'));
await expectVisible(page.getByText('Print Label Sheet'));
});
});