upskill-event-manager/test-joe-access.js
bengizmo 993a820a84 feat: Add comprehensive development artifacts to repository
- 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>
2025-08-11 12:26:11 -03:00

73 lines
No EOL
2.4 KiB
JavaScript

const { chromium } = require('playwright');
async function testJoeAccounts() {
console.log('🔐 Testing Joe account access to master trainer functionality...');
const browser = await chromium.launch();
const joeAccounts = [
{
username: 'joe@measurequick.com',
password: 'JoeTrainer2025@',
name: 'Joe MeasureQuick'
},
{
username: 'joe@upskillhvac.com',
password: 'JoeTrainer2025@',
name: 'Joe UpskillHVAC'
}
];
for (const account of joeAccounts) {
console.log(`\n🧪 Testing ${account.name} (${account.username})...`);
const page = await browser.newPage();
try {
// Test login
await page.goto('https://upskill-staging.measurequick.com/training-login/');
await page.waitForLoadState('networkidle');
await page.fill('#user_login', account.username);
await page.fill('#user_pass', account.password);
await page.click('#wp-submit');
await page.waitForURL('**/trainer/dashboard/**', { timeout: 10000 });
console.log('✅ Login successful');
// Test regular trainer dashboard access
const trainerDashboard = page.url().includes('/trainer/dashboard/');
console.log(`📊 Trainer dashboard access: ${trainerDashboard}`);
// Test master trainer dashboard access
await page.goto('https://upskill-staging.measurequick.com/master-trainer/dashboard/');
await page.waitForLoadState('networkidle');
// Check if we're still on the master dashboard (not redirected due to permissions)
const masterDashboard = page.url().includes('/master-trainer/dashboard/');
console.log(`🎯 Master trainer dashboard access: ${masterDashboard}`);
// Take screenshot for verification
await page.screenshot({
path: `test-results/joe-${account.username.replace('@', '-at-')}-master-dashboard.png`,
fullPage: true
});
if (masterDashboard) {
console.log(`${account.name} has master trainer access!`);
} else {
console.log(`${account.name} lacks master trainer access`);
}
} catch (error) {
console.error(`❌ Test failed for ${account.name}:`, error.message);
} finally {
await page.close();
}
}
await browser.close();
console.log('\n✅ Joe account testing completed!');
}
testJoeAccounts();