Files
blackcanyontickets/reactrebuild0825/tests/global-setup.ts
dzinesco aa81eb5adb feat: add advanced analytics and territory management system
- Add comprehensive analytics components with export functionality
- Implement territory management with manager performance tracking
- Add seatmap components for venue layout management
- Create customer management features with modal interface
- Add advanced hooks for dashboard flags and territory data
- Implement seat selection and venue management utilities
- Add type definitions for ticketing and seatmap systems

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 09:25:10 -06:00

40 lines
1.1 KiB
TypeScript

import fs from 'fs';
import path from 'path';
import { chromium } from '@playwright/test';
import type { FullConfig } from '@playwright/test';
async function globalSetup(_config: FullConfig) {
// Ensure screenshots directory exists
const screenshotsDir = path.join(process.cwd(), 'screenshots');
if (!fs.existsSync(screenshotsDir)) {
fs.mkdirSync(screenshotsDir, { recursive: true });
}
// Clear previous screenshots
const files = fs.readdirSync(screenshotsDir);
for (const file of files) {
if (file.endsWith('.png')) {
fs.unlinkSync(path.join(screenshotsDir, file));
}
}
// Optional: Pre-warm the application by visiting it once
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
try {
await page.goto('http://localhost:5173', { waitUntil: 'networkidle' });
console.log('✅ Application pre-warmed successfully');
} catch (error) {
console.warn('⚠️ Could not pre-warm application:', (error as Error).message);
} finally {
await context.close();
await browser.close();
}
}
export default globalSetup;