feat: Implement Playwright testing setup

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 15:42:28 +00:00
parent 41ae88d1bc
commit 8ac61e01e3
16 changed files with 1700 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/**
* Playwright Global Setup
*
* Runs once before all tests to prepare the test environment.
*/
import { FullConfig } from '@playwright/test';
import { setupAuthStates } from '../fixtures/auth';
import { cleanupTestData } from '../fixtures/database';
async function globalSetup(config: FullConfig) {
console.log('🚀 Starting global setup...');
try {
// Clean up any leftover test data from previous runs
console.log('🧹 Cleaning up leftover test data...');
await cleanupTestData();
// Setup authentication states for all user roles
console.log('🔐 Setting up authentication states...');
await setupAuthStates(config);
console.log('✅ Global setup complete');
} catch (error) {
console.error('❌ Global setup failed:', error);
throw error;
}
}
export default globalSetup;