Füge Cypress Konfiguration und Testumgebung hinzu

- Fügt cypress.config.ts für E2E und Komponenten Tests hinzu
- Fügt Cypress Testskripte und Docker-Compose Konfiguration hinzu
- Ermöglicht automatische E2E-Tests mit separater Testumgebung

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-03-28 10:40:15 +01:00
parent 4e0fa33dee
commit 27e1b2d82c
9 changed files with 433 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
// -- This is a parent command --
Cypress.Commands.add('login', () => {
// Simulate logged in user without OAuth
window.localStorage.setItem('myp:user', JSON.stringify({
id: 'test-user-id',
name: 'Test User',
email: 'test@example.com',
role: 'user'
}))
})
// -- This is a child command --
Cypress.Commands.add('createPrintJob', (printerId, duration) => {
cy.intercept('POST', `/api/printers/${printerId}/reserve`, {
id: 'test-job-id',
printerId,
userId: 'test-user-id',
startTime: new Date().toISOString(),
endTime: new Date(Date.now() + duration * 60000).toISOString(),
status: 'active'
}).as('createJob')
return cy.wrap('test-job-id')
})
declare global {
namespace Cypress {
interface Chainable {
login(): Chainable<void>
createPrintJob(printerId: string, duration: number): Chainable<string>
}
}
}