/** * @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')); }); });