Some checks failed
CI / Unit & Component Tests (push) Failing after 2m51s
CI / OCR Service Tests (push) Successful in 38s
CI / Backend Unit Tests (push) Failing after 2m55s
CI / Unit & Component Tests (pull_request) Failing after 2m50s
CI / OCR Service Tests (pull_request) Successful in 34s
CI / Backend Unit Tests (pull_request) Failing after 2m54s
- help-popover: replace broad button[aria-expanded] with specific
getByLabel('Lese- und Bearbeitungsmodus'); update role="tooltip" →
role="region"; add afterAll doc cleanup (Sara/Tobias)
- richtlinien: assert .new-tab spans are hidden in print media — the
existing test only checked .app-nav (Sara)
- transcribe-coach: remove 4× redundant page.emulateMedia({reducedMotion})
calls — playwright.config.ts already sets reducedMotion: 'reduce' globally;
add afterAll doc cleanup (Tobias)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.6 KiB
TypeScript
66 lines
2.6 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import AxeBuilder from '@axe-core/playwright';
|
|
import { createEmptyDocument } from './helpers/upload-empty-document.js';
|
|
|
|
function buildAxe(page: Parameters<typeof AxeBuilder>[0]['page']) {
|
|
return new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa']);
|
|
}
|
|
|
|
test.describe('Transcribe coach — empty state', () => {
|
|
let docId: string;
|
|
|
|
test.beforeAll(async ({ request }) => {
|
|
docId = await createEmptyDocument(request);
|
|
});
|
|
|
|
test.afterAll(async ({ request }) => {
|
|
await request.delete(`/api/documents/${docId}`);
|
|
});
|
|
|
|
test('shows coach card (title, preamble, three step bodies, animation region)', async ({
|
|
page
|
|
}) => {
|
|
await page.goto(`/documents/${docId}`);
|
|
await page.getByRole('button', { name: 'Transkribieren' }).click();
|
|
|
|
await expect(page.getByRole('heading', { level: 2, name: /Erste Transkription/ })).toBeVisible({
|
|
timeout: 5000
|
|
});
|
|
await expect(page.getByText(/Kurrent-Erkenner lernt noch/)).toBeVisible();
|
|
await expect(page.getByText(/Rahmen ziehen/)).toBeVisible();
|
|
await expect(page.getByText(/Text eingeben/)).toBeVisible();
|
|
await expect(page.getByText(/Speichert automatisch/)).toBeVisible();
|
|
await expect(page.getByRole('img', { name: /Rahmen ziehen|Animation/i })).toBeVisible();
|
|
});
|
|
|
|
test('training footer is NOT visible on empty doc', async ({ page }) => {
|
|
await page.goto(`/documents/${docId}`);
|
|
await page.getByRole('button', { name: 'Transkribieren' }).click();
|
|
await expect(page.getByText('Für Training vormerken')).not.toBeVisible({ timeout: 3000 });
|
|
});
|
|
|
|
test('axe: panel empty state — light theme — no WCAG 2.1 AA violations', async ({ page }) => {
|
|
await page.goto(`/documents/${docId}`);
|
|
await page.getByRole('button', { name: 'Transkribieren' }).click();
|
|
await expect(page.getByRole('heading', { level: 2, name: /Erste Transkription/ })).toBeVisible({
|
|
timeout: 5000
|
|
});
|
|
|
|
const a11y = await buildAxe(page).analyze();
|
|
expect(a11y.violations, JSON.stringify(a11y.violations, null, 2)).toHaveLength(0);
|
|
});
|
|
|
|
test('axe: panel empty state — dark theme — no WCAG 2.1 AA violations', async ({ page }) => {
|
|
await page.goto(`/documents/${docId}`);
|
|
// Toggle dark theme
|
|
await page.getByRole('button', { name: /Farbmodus|theme/i }).click();
|
|
await page.getByRole('button', { name: 'Transkribieren' }).click();
|
|
await expect(page.getByRole('heading', { level: 2, name: /Erste Transkription/ })).toBeVisible({
|
|
timeout: 5000
|
|
});
|
|
|
|
const a11y = await buildAxe(page).analyze();
|
|
expect(a11y.violations, JSON.stringify(a11y.violations, null, 2)).toHaveLength(0);
|
|
});
|
|
});
|