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:
35
tests/cypress/cortex/command-center.cy.ts
Normal file
35
tests/cypress/cortex/command-center.cy.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
describe('Cortex Command Center - UI', () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
cy.visit('/epd/cortex');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('be.visible');
|
||||
});
|
||||
|
||||
it('laadt de command center interface', () => {
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('be.visible');
|
||||
cy.contains('Welkom bij Cortex Assistent').first().should('be.visible');
|
||||
});
|
||||
|
||||
it('chat input accepteert tekst', () => {
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('test invoer');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('have.value', 'test invoer');
|
||||
});
|
||||
|
||||
it('keyboard shortcut ⌘K focust de input', () => {
|
||||
cy.get('body').click();
|
||||
cy.get('body').type('{meta}k');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('be.focused');
|
||||
});
|
||||
|
||||
it('escape wist de input', () => {
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('iets typen');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('{esc}');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('have.value', '');
|
||||
});
|
||||
|
||||
it('toont voorbeeldcommandos in de empty state', () => {
|
||||
cy.contains('Dagnotitie maken').first().should('be.visible');
|
||||
cy.contains('Patiënt zoeken').first().should('be.visible');
|
||||
cy.contains('Overdracht maken').first().should('be.visible');
|
||||
});
|
||||
});
|
||||
44
tests/cypress/cortex/dagnotitie-flow.cy.ts
Normal file
44
tests/cypress/cortex/dagnotitie-flow.cy.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
describe('Cortex - Demo flows', () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
cy.visit('/epd/cortex');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('be.visible');
|
||||
});
|
||||
|
||||
it('dagnotitie flow: bericht → AI response → artifact verschijnt', () => {
|
||||
cy.mockDagnotitieChat('Jan de Vries');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('notitie jan de vries voelt zich goed vandaag{enter}');
|
||||
cy.contains('notitie jan de vries voelt zich goed vandaag').first().should('be.visible');
|
||||
cy.contains('Genoteerd.').first().should('be.visible');
|
||||
});
|
||||
|
||||
it('dagnotitie flow: input is leeg na verzenden', () => {
|
||||
cy.mockDagnotitieChat();
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('notitie jan medicatie gegeven{enter}');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').should('have.value', '');
|
||||
});
|
||||
|
||||
it('zoeken flow: bericht → zoek-artifact verschijnt', () => {
|
||||
cy.mockZoekenChat('Marie');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('zoek marie{enter}');
|
||||
cy.contains('Even kijken.').first().should('be.visible');
|
||||
});
|
||||
|
||||
it('onbekende intent: AI vraagt om verduidelijking', () => {
|
||||
cy.mockOnbekendChat();
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('xyz{enter}');
|
||||
cy.contains('snap niet helemaal wat je bedoelt').first().should('be.visible');
|
||||
});
|
||||
|
||||
it('meerdere berichten: chat history groeit', () => {
|
||||
cy.mockDagnotitieChat();
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('notitie jan medicatie gegeven{enter}');
|
||||
cy.contains('Genoteerd.').first().should('be.visible');
|
||||
|
||||
cy.mockDagnotitieChat('Marie');
|
||||
cy.get('textarea[placeholder="Typ of spreek wat je wilt doen..."]:first').type('notitie marie slaapt slecht{enter}');
|
||||
|
||||
cy.contains('notitie jan medicatie gegeven').first().should('be.visible');
|
||||
cy.contains('notitie marie slaapt slecht').first().should('be.visible');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user