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>
This commit is contained in:
39
tests/playwright/cortex/command-center.spec.ts
Normal file
39
tests/playwright/cortex/command-center.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user