- Add 26 documentation files including test reports, deployment guides, and troubleshooting documentation - Include 3 CSV data files for trainer imports and user registration tracking - Add 43 JavaScript test files covering mobile optimization, Safari compatibility, and E2E testing - Include 18 PHP utility files for debugging, geocoding, and data analysis - Add 12 shell scripts for deployment verification, user management, and database operations - Update .gitignore with whitelist patterns for development files, documentation, and CSV data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
No EOL
2.8 KiB
JavaScript
60 lines
No EOL
2.8 KiB
JavaScript
const { chromium } = require('playwright');
|
|
|
|
async function testDashboardNavigation() {
|
|
console.log('🔍 TESTING DASHBOARD NAVIGATION SYSTEM');
|
|
console.log('================================================================================');
|
|
|
|
const browser = await chromium.launch({ headless: false });
|
|
const context = await browser.newContext();
|
|
const page = await context.newPage();
|
|
|
|
try {
|
|
// Login as regular trainer
|
|
console.log('📝 Logging in as regular trainer...');
|
|
await page.goto('https://upskill-staging.measurequick.com/wp-login.php');
|
|
await page.fill('#user_login', 'test_trainer');
|
|
await page.fill('#user_pass', 'TestTrainer123!');
|
|
await page.click('#wp-submit');
|
|
await page.waitForURL('**/trainer/dashboard/**', { timeout: 15000 });
|
|
console.log('✅ Regular trainer login successful');
|
|
|
|
// Analyze dashboard navigation
|
|
console.log('🔍 Analyzing dashboard navigation...');
|
|
const dashboardNavResult = await page.evaluate(() => {
|
|
return {
|
|
url: window.location.href,
|
|
hasMenuSystem: document.querySelector('.hvac-trainer-menu-wrapper') !== null,
|
|
hasTrainerMenu: document.querySelector('.hvac-trainer-menu') !== null,
|
|
hasSimpleNav: document.querySelector('.hvac-trainer-nav') !== null,
|
|
navMenuItems: document.querySelectorAll('.hvac-trainer-menu li').length,
|
|
navLinks: Array.from(document.querySelectorAll('.hvac-trainer-menu a, .hvac-nav-link')).map(a => ({
|
|
text: a.textContent.trim(),
|
|
href: a.href,
|
|
classes: a.className
|
|
})),
|
|
hasDropdowns: document.querySelectorAll('.sub-menu, .dropdown-arrow').length > 0,
|
|
menuHTML: document.querySelector('nav')?.outerHTML?.slice(0, 500) || 'none',
|
|
allNavElements: Array.from(document.querySelectorAll('nav, .menu, .navigation')).map(el => ({
|
|
tagName: el.tagName,
|
|
classes: el.className,
|
|
id: el.id
|
|
}))
|
|
};
|
|
});
|
|
|
|
console.log('📊 Dashboard navigation analysis:', dashboardNavResult);
|
|
|
|
await page.screenshot({ path: 'dashboard-navigation-analysis.png', fullPage: true });
|
|
|
|
console.log('================================================================================');
|
|
console.log('🎯 DASHBOARD NAVIGATION ANALYSIS COMPLETE');
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error during dashboard navigation analysis:', error);
|
|
await page.screenshot({ path: 'dashboard-nav-analysis-error.png', fullPage: true });
|
|
} finally {
|
|
await browser.close();
|
|
}
|
|
}
|
|
|
|
testDashboardNavigation(); |