Files
triqura-ecd/tests/playwright/cortex/command-center.spec.ts
colinislit 9195eb9fed test: Cypress en Playwright e2e-suites voor login, agenda, cortex en verpleegrapportage
Configs voor beide runners, login via session caching, AI-chat
mocks (SSE) voor deterministische Cortex-tests. Supabase local
config toegevoegd. Auth-state en reports zijn gitignored.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 23:16:17 +02:00

40 lines
1.5 KiB
TypeScript

import { test, expect, type Page } from '@playwright/test';
// De pagina heeft twee textareas (desktop + mobiel layout). .first() pakt de zichtbare desktop-versie.
const input = (page: Page) => page.getByPlaceholder('Typ of spreek wat je wilt doen...').first();
test.describe('Cortex Command Center - UI', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/epd/cortex');
await expect(input(page)).toBeVisible({ timeout: 10_000 });
});
test('laadt de command center interface', async ({ page }) => {
await expect(input(page)).toBeVisible();
await expect(page.locator('text=Welkom bij Cortex Assistent').first()).toBeVisible();
});
test('chat input accepteert tekst', async ({ page }) => {
await input(page).fill('test invoer');
await expect(input(page)).toHaveValue('test invoer');
});
test('keyboard shortcut ⌘K focust de input', async ({ page }) => {
await page.click('body');
await page.keyboard.press('Meta+k');
await expect(input(page)).toBeFocused();
});
test('escape wist de input', async ({ page }) => {
await input(page).fill('iets typen');
await input(page).press('Escape');
await expect(input(page)).toHaveValue('');
});
test('toont voorbeeldcommandos in de empty state', async ({ page }) => {
await expect(page.locator('text=Dagnotitie maken').first()).toBeVisible();
await expect(page.locator('text=Patiënt zoeken').first()).toBeVisible();
await expect(page.locator('text=Overdracht maken').first()).toBeVisible();
});
});