upskill-event-manager/test-final-deployment.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

117 lines
No EOL
4.9 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');
const BASE_URL = 'https://upskill-staging.measurequick.com';
async function testFinalDeployment() {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({ viewport: { width: 1920, height: 1080 } });
const page = await context.newPage();
console.log('🚀 Final Deployment Test - HVAC Trainer Features\n');
console.log('=' . repeat(60));
try {
// 1. Test Registration Form with HQ fields
console.log('\n1⃣ Testing Registration Form Headquarters Fields...');
await page.goto(`${BASE_URL}/trainer-registration/`);
await page.waitForLoadState('networkidle');
// Check for HQ fields
const hqCity = await page.locator('#org_headquarters_city').isVisible();
const hqState = await page.locator('#org_headquarters_state').isVisible();
const hqCountry = await page.locator('#org_headquarters_country').isVisible();
console.log(` Headquarters City field: ${hqCity ? '✅ VISIBLE' : '❌ NOT FOUND'}`);
console.log(` Headquarters State field: ${hqState ? '✅ VISIBLE' : '❌ NOT FOUND'}`);
console.log(` Headquarters Country field: ${hqCountry ? '✅ VISIBLE' : '❌ NOT FOUND'}`);
await page.screenshot({ path: 'screenshots/final-01-registration-hq-fields.png', fullPage: true });
// 2. Login
console.log('\n2⃣ Logging in as test_trainer...');
await page.goto(`${BASE_URL}/training-login/`);
await page.fill('#user_login', 'test_trainer');
await page.fill('#user_pass', 'TestTrainer123!');
await page.click('#wp-submit');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(3000);
const loginSuccess = page.url().includes('/trainer/');
console.log(` Login: ${loginSuccess ? '✅ SUCCESS' : '❌ FAILED'}`);
// 3. Test Navigation and Breadcrumbs on each page
console.log('\n3⃣ Testing Navigation and Breadcrumbs...');
const pagesToTest = [
{ name: 'Dashboard', url: '/trainer/dashboard/' },
{ name: 'Venues List', url: '/trainer/venue/list/' },
{ name: 'Venue Manage', url: '/trainer/venue/manage/' },
{ name: 'Profile', url: '/trainer/profile/' },
{ name: 'Organizers List', url: '/trainer/organizer/list/' },
];
for (const pageInfo of pagesToTest) {
console.log(`\n Testing ${pageInfo.name}...`);
await page.goto(`${BASE_URL}${pageInfo.url}`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(2000);
const hasNav = await page.locator('.hvac-trainer-nav').isVisible();
const hasBreadcrumb = await page.locator('.hvac-breadcrumb').isVisible();
const pageTitle = await page.title();
console.log(` URL: ${page.url()}`);
console.log(` Title: ${pageTitle}`);
console.log(` Navigation: ${hasNav ? '✅ VISIBLE' : '❌ NOT FOUND'}`);
console.log(` Breadcrumbs: ${hasBreadcrumb ? '✅ VISIBLE' : '❌ NOT FOUND'}`);
if (hasNav || hasBreadcrumb) {
await page.screenshot({
path: `screenshots/final-nav-${pageInfo.name.toLowerCase().replace(/\s+/g, '-')}.png`,
fullPage: true
});
}
}
// 4. Test Form Functionality
console.log('\n4⃣ Testing Form Elements...');
await page.goto(`${BASE_URL}/trainer/venue/manage/`);
await page.waitForLoadState('networkidle');
const hasVenueForm = await page.locator('form').first().isVisible();
const hasSubmitButton = await page.locator('button[type="submit"]').isVisible();
console.log(` Venue form: ${hasVenueForm ? '✅ FOUND' : '❌ NOT FOUND'}`);
console.log(` Submit button: ${hasSubmitButton ? '✅ FOUND' : '❌ NOT FOUND'}`);
// Summary
console.log('\n' + '=' . repeat(60));
console.log('📊 DEPLOYMENT STATUS SUMMARY');
console.log('=' . repeat(60));
console.log('\n✅ Completed Features:');
console.log(' - Registration form refactored');
console.log(' - Authentication system working');
console.log(' - Test users created and functional');
console.log(' - All code deployed to staging');
console.log('\n⚠ Pending Verification:');
console.log(' - Headquarters fields visibility');
console.log(' - Navigation/breadcrumb display');
console.log(' - Some page creation on staging');
console.log('\n📝 Next Steps:');
console.log(' 1. Deploy latest changes to see nav/breadcrumbs');
console.log(' 2. Manually create any missing pages in WP admin');
console.log(' 3. Clear all caches on staging');
console.log(' 4. Run full E2E test suite');
} catch (error) {
console.error('\n❌ Test Error:', error.message);
await page.screenshot({ path: 'screenshots/final-error.png', fullPage: true });
} finally {
await browser.close();
}
}
testFinalDeployment().catch(console.error);