- Add XSS protection with DOMPurify sanitization in rich text editor - Implement comprehensive file upload security validation - Enhance server-side content sanitization with wp_kses - Add comprehensive security test suite with 194+ test cases - Create security remediation plan documentation Security fixes address: - CRITICAL: XSS vulnerability in event description editor - HIGH: File upload security bypass for malicious files - HIGH: Enhanced CSRF protection verification - MEDIUM: Input validation and error handling improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
No EOL
1 KiB
JavaScript
35 lines
No EOL
1 KiB
JavaScript
// 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; |