- 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>
70 lines
No EOL
2.6 KiB
JavaScript
70 lines
No EOL
2.6 KiB
JavaScript
const { chromium } = require('playwright');
|
|
|
|
async function testMasterDashboard() {
|
|
console.log('🎯 Testing Master Dashboard with migrated users...');
|
|
|
|
const browser = await chromium.launch({ headless: false });
|
|
const page = await browser.newPage();
|
|
|
|
try {
|
|
// Login as master trainer
|
|
await page.goto('https://upskill-staging.measurequick.com/training-login/');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
console.log('🔐 Logging in as master trainer...');
|
|
await page.fill('#user_login', 'joe@measurequick.com');
|
|
await page.fill('#user_pass', 'JoeTrainer2025@');
|
|
await page.click('#wp-submit');
|
|
|
|
// Should redirect to master dashboard automatically
|
|
await page.waitForTimeout(3000);
|
|
|
|
const currentUrl = page.url();
|
|
console.log(`📍 Current URL: ${currentUrl}`);
|
|
|
|
// Make sure we're on master dashboard
|
|
if (!currentUrl.includes('/master-trainer/dashboard/')) {
|
|
await page.goto('https://upskill-staging.measurequick.com/master-trainer/dashboard/');
|
|
await page.waitForLoadState('networkidle');
|
|
}
|
|
|
|
console.log('📊 Checking master dashboard statistics...');
|
|
|
|
// Wait for page to load completely
|
|
await page.waitForTimeout(3000);
|
|
|
|
// Take screenshot
|
|
await page.screenshot({
|
|
path: 'test-results/master-dashboard-with-migrated-users.png',
|
|
fullPage: true
|
|
});
|
|
|
|
// Check for trainer statistics
|
|
const trainerStatsVisible = await page.locator('text="Total Trainers"').isVisible();
|
|
console.log(`📋 Trainer statistics visible: ${trainerStatsVisible}`);
|
|
|
|
// Try to find the trainer count
|
|
const trainerCountElement = await page.locator('text="Total Trainers"').locator('..').locator('p, span, div').first();
|
|
if (await trainerCountElement.isVisible()) {
|
|
const trainerCount = await trainerCountElement.textContent();
|
|
console.log(`👥 Total Trainers shown: ${trainerCount}`);
|
|
}
|
|
|
|
// Check if we can access the trainer data section
|
|
const trainerDataSection = await page.locator('.trainer-statistics, .trainer-data, [data-tab="trainers"]').isVisible();
|
|
console.log(`📊 Trainer data section visible: ${trainerDataSection}`);
|
|
|
|
// Look for individual trainer entries
|
|
const trainerEntries = await page.locator('tr, .trainer-entry, .trainer-row').count();
|
|
console.log(`📋 Trainer entries found: ${trainerEntries}`);
|
|
|
|
console.log('✅ Master dashboard test completed');
|
|
|
|
} catch (error) {
|
|
console.error('❌ Master dashboard test failed:', error.message);
|
|
} finally {
|
|
await browser.close();
|
|
}
|
|
}
|
|
|
|
testMasterDashboard(); |