upskill-event-manager/test-map-markers-fix.js
Ben c3e7fe9140 feat: comprehensive HVAC plugin development framework and modernization
## Major Enhancements

### 🏗️ Architecture & Infrastructure
- Implement comprehensive Docker testing infrastructure with hermetic environment
- Add Forgejo Actions CI/CD pipeline for automated deployments
- Create Page Object Model (POM) testing architecture reducing test duplication by 90%
- Establish security-first development patterns with input validation and output escaping

### 🧪 Testing Framework Modernization
- Migrate 146+ tests from 80 duplicate files to centralized architecture
- Add comprehensive E2E test suites for all user roles and workflows
- Implement WordPress error detection with automatic site health monitoring
- Create robust browser lifecycle management with proper cleanup

### 📚 Documentation & Guides
- Add comprehensive development best practices guide
- Create detailed administrator setup documentation
- Establish user guides for trainers and master trainers
- Document security incident reports and migration guides

### 🔧 Core Plugin Features
- Enhance trainer profile management with certification system
- Improve find trainer functionality with advanced filtering
- Strengthen master trainer area with content management
- Add comprehensive venue and organizer management

### 🛡️ Security & Reliability
- Implement security-first patterns throughout codebase
- Add comprehensive input validation and output escaping
- Create secure credential management system
- Establish proper WordPress role-based access control

### 🎯 WordPress Integration
- Strengthen singleton pattern implementation across all classes
- Enhance template hierarchy with proper WordPress integration
- Improve page manager with hierarchical URL structure
- Add comprehensive shortcode and menu system

### 🔍 Developer Experience
- Add extensive debugging and troubleshooting tools
- Create comprehensive test data seeding scripts
- Implement proper error handling and logging
- Establish consistent code patterns and standards

### 📊 Performance & Optimization
- Optimize database queries and caching strategies
- Improve asset loading and script management
- Enhance template rendering performance
- Streamline user experience across all interfaces

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:26:10 -03:00

116 lines
No EOL
4.1 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { chromium } = require('playwright');
console.log('🗺️ MAP MARKERS FIX VERIFICATION');
console.log('===============================');
const BASE_URL = process.env.BASE_URL || 'https://upskill-staging.measurequick.com';
(async () => {
let browser;
try {
browser = await chromium.launch({
headless: process.env.HEADLESS !== 'false',
timeout: 30000
});
const page = await browser.newPage();
console.log('🌐 Loading Find a Trainer page...');
await page.goto(`${BASE_URL}/find-a-trainer/`);
await page.waitForLoadState('networkidle', { timeout: 20000 });
// Check for MapGeo safety fallback
console.log('\n🛡 Checking MapGeo safety system...');
const fallbackExists = await page.locator('#hvac-map-fallback').count();
console.log(`MapGeo fallback container exists: ${fallbackExists > 0}`);
// Check map container
console.log('\n🗺 Checking map container...');
const mapContainer = await page.locator('#hvac-trainer-map, .hvac-map-container, #map, .igmp-map-container').count();
console.log(`Map containers found: ${mapContainer}`);
// Wait for map initialization
console.log('\n⏳ Waiting for map initialization (15 seconds)...');
await page.waitForTimeout(15000);
// Check for map elements after loading
const mapElements = await page.evaluate(() => {
const elements = {
amcharts: document.querySelectorAll('[id*="amchart"], [class*="amchart"]').length,
interactive: document.querySelectorAll('.igmp-map-container, .igm-map').length,
fallback: document.getElementById('hvac-map-fallback'),
fallbackVisible: false
};
if (elements.fallback) {
const style = window.getComputedStyle(elements.fallback);
elements.fallbackVisible = style.display !== 'none' && style.visibility !== 'hidden';
}
return elements;
});
console.log(`AmCharts elements found: ${mapElements.amcharts}`);
console.log(`Interactive map elements found: ${mapElements.interactive}`);
console.log(`Fallback visible: ${mapElements.fallbackVisible}`);
// Check console for MapGeo safety messages
console.log('\n🔍 Monitoring console messages...');
let mapgeSuccessMessages = [];
let mapgeoErrors = [];
page.on('console', msg => {
const text = msg.text();
if (text.includes('[MapGeo Safety]')) {
if (text.includes('fallback') || text.includes('Map loaded successfully')) {
mapgeSuccessMessages.push(text);
console.log(`${text}`);
} else {
mapgeoErrors.push(text);
console.log(` ⚠️ ${text}`);
}
}
});
// Force a CDN failure simulation if possible
console.log('\n🔄 Testing CDN failure scenario...');
try {
await page.route('**/amcharts.com/**', route => route.abort());
await page.reload();
await page.waitForTimeout(10000);
const fallbackAfterBlock = await page.locator('#hvac-map-fallback').isVisible();
console.log(`Fallback shows after CDN block: ${fallbackAfterBlock}`);
} catch (e) {
console.log(`CDN blocking test failed: ${e.message}`);
}
// Final results
console.log('\n📊 TEST RESULTS');
console.log('===============');
const success = mapElements.interactive > 0 || mapElements.fallbackVisible;
console.log(`Map System Status: ${success ? '✅ WORKING' : '❌ FAILED'}`);
console.log(`Safety System Active: ${fallbackExists > 0 ? '✅ YES' : '❌ NO'}`);
console.log(`Map Elements Present: ${mapElements.amcharts + mapElements.interactive}`);
if (mapgeSuccessMessages.length > 0) {
console.log('\n✅ MapGeo Safety Success Messages:');
mapgeSuccessMessages.forEach(msg => console.log(`${msg}`));
}
if (mapgeoErrors.length > 0) {
console.log('\n⚠ MapGeo Warnings/Errors:');
mapgeoErrors.forEach(msg => console.log(`${msg}`));
}
} catch (error) {
console.error('\n💥 Error:', error.message);
} finally {
if (browser) {
await browser.close();
}
}
})();