Implement comprehensive frontend integration testing with Playwright
- Add Playwright E2E testing framework with cross-browser support (Chrome, Firefox) - Create authentication helpers for CalDAV server integration - Implement calendar interaction helpers with event creation, drag-and-drop, and view switching - Add comprehensive drag-and-drop test suite with event cleanup - Configure CI/CD integration with Gitea Actions for headless testing - Support both local development and CI environments with proper dependency management - Include video recording, screenshots, and HTML reporting for test debugging - Handle Firefox-specific timing and interaction challenges with force clicks and timeouts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
		
							
								
								
									
										44
									
								
								frontend/e2e/tests/auth.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								frontend/e2e/tests/auth.spec.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| import { test, expect } from '@playwright/test'; | ||||
|  | ||||
| test.describe('Authentication', () => { | ||||
|   test('should show login form initially', async ({ page }) => { | ||||
|     await page.goto('/'); | ||||
|      | ||||
|     // Should redirect to login page | ||||
|     await expect(page).toHaveURL(/.*\/login/); | ||||
|      | ||||
|     // Check for login form elements | ||||
|     await expect(page.getByLabel('CalDAV Server URL')).toBeVisible(); | ||||
|     await expect(page.getByRole('textbox', { name: 'Username' })).toBeVisible(); | ||||
|     await expect(page.getByLabel('Password')).toBeVisible(); | ||||
|     await expect(page.getByRole('button', { name: 'Sign In' })).toBeVisible(); | ||||
|   }); | ||||
|  | ||||
|   test('should show validation errors for empty form', async ({ page }) => { | ||||
|     await page.goto('/login'); | ||||
|      | ||||
|     // Try to submit empty form | ||||
|     await page.getByRole('button', { name: 'Sign In' }).click(); | ||||
|      | ||||
|     // Should show validation errors | ||||
|     await expect(page.getByText('Please fill in all fields')).toBeVisible(); | ||||
|   }); | ||||
|  | ||||
|   test('should handle invalid credentials', async ({ page }) => { | ||||
|     await page.goto('/login'); | ||||
|      | ||||
|     // Fill in invalid credentials | ||||
|     await page.getByLabel('CalDAV Server URL').fill('https://invalid-server.com'); | ||||
|     await page.getByRole('textbox', { name: 'Username' }).fill('invalid-user'); | ||||
|     await page.getByLabel('Password').fill('invalid-password'); | ||||
|      | ||||
|     // Submit form | ||||
|     await page.getByRole('button', { name: 'Sign In' }).click(); | ||||
|      | ||||
|     // Should show error message (wait for loading to finish first) | ||||
|     await expect(page.getByRole('button', { name: 'Sign In' })).toBeVisible(); // Wait for loading to finish | ||||
|      | ||||
|     // Check for any error message in the error-message div | ||||
|     await expect(page.locator('.error-message')).toBeVisible(); | ||||
|   }); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user
	 Connor Johnstone
					Connor Johnstone