import AxeBuilder from '@axe-core/playwright'; import { test, expect } from '../fixtures'; import { DEFAULT_ADMIN_BASE_URL } from '../env-defaults'; /** * Lightweight a11y smoke. * Viewer gallery still has known unlabeled filter comboboxes (tracked in * ADMIN_UX_REVIEW) — we only assert the skip link there until those are fixed. * Admin login is held to critical/serious axe. */ test.describe('a11y smoke @smoke', () => { test('viewer home exposes skip link', async ({ page }) => { await page.goto('/'); await expect(page.getByRole('link', { name: /skip to main content/i })).toBeAttached(); }); test('admin login has no critical axe violations', async ({ page }) => { const adminBaseUrl = process.env.PLAYKIT_ADMIN_BASE_URL || DEFAULT_ADMIN_BASE_URL; await page.goto(`${adminBaseUrl}/login`); await expect(page.getByRole('button', { name: /sign in/i })).toBeVisible({ timeout: 20_000 }); const results = await new AxeBuilder({ page }) .withTags(['wcag2a', 'wcag2aa']) .analyze(); const bad = results.violations.filter((v) => v.impact === 'critical' || v.impact === 'serious'); expect(bad, JSON.stringify(bad, null, 2)).toEqual([]); }); });