// Global setup without direct playwright imports to avoid conflicts async function globalSetup(config) { console.log('🔧 Global test setup starting...'); const baseURL = config.use.baseURL || 'http://localhost:8080'; console.log(`🌐 Base URL: ${baseURL}`); // Test server connectivity with simple fetch try { // Use Node.js fetch for basic connectivity test const response = await fetch(baseURL); if (response.ok) { console.log('✅ Test server accessible'); } else { console.log(`⚠️ Server returned status: ${response.status}`); } } catch (error) { console.error('❌ Failed to connect to test server:', error.message); console.log('💡 Make sure the server is running at:', baseURL); // Don't throw error for demo purposes } // Set global test timeout based on environment if (process.env.CI) { config.timeout = 120000; // 2 minutes for CI } else { config.timeout = 60000; // 1 minute for local } console.log('✅ Global test setup completed'); } module.exports = globalSetup;