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

64 lines
No EOL
2.9 KiB
JavaScript

const { chromium } = require('playwright');
async function testManageEventFinal() {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
console.log('=== Final Test: Manage Event Page ===\n');
// Login
console.log('1. Logging in...');
await page.goto('https://upskill-staging.measurequick.com/training-login/');
await page.fill('#user_login', 'ben+test44@measurequick.com');
await page.fill('#user_pass', 'MQtrainer2024!');
await page.locator('input[type="submit"], #wp-submit').first().click();
// Wait for redirect
await page.waitForURL('**/trainer/dashboard/**', { timeout: 10000 }).catch(() => {});
// Navigate to manage event page
console.log('2. Navigating to manage event page...');
await page.goto('https://upskill-staging.measurequick.com/trainer/event/manage/');
await page.waitForLoadState('networkidle');
// Check for HTML comments
console.log('\n3. Checking for HTML comments...');
const pageContent = await page.content();
const hasWpShortcodeComment = pageContent.includes('<!-- wp:shortcode');
const hasClosingComment = pageContent.includes('<!-- /wp:shortcode');
// Check page text content
const textContent = await page.textContent('body');
const hasVisibleComment = textContent.includes('<!-- wp:shortcode') || textContent.includes('<\\!-- wp:shortcode');
console.log(` - HTML contains wp:shortcode comment: ${hasWpShortcodeComment ? '❌ YES' : '✅ NO'}`);
console.log(` - HTML contains closing comment: ${hasClosingComment ? '❌ YES' : '✅ NO'}`);
console.log(` - Visible text contains comment: ${hasVisibleComment ? '❌ YES' : '✅ NO'}`);
// Check for form presence
console.log('\n4. Checking for event form...');
const hasForm = await page.locator('form#event-community-form, .tribe-community-events').count() > 0;
console.log(` - Event form present: ${hasForm ? '✅ YES' : '❌ NO'}`);
// Check navigation
console.log('\n5. Checking navigation...');
const navCount = await page.locator('.hvac-dashboard-nav').count();
console.log(` - Navigation sections: ${navCount} ${navCount === 1 ? '✅' : '❌'}`);
// Take screenshot
await page.screenshot({ path: 'manage-event-final-test.png', fullPage: false });
console.log('\n6. Screenshot saved as manage-event-final-test.png');
// Summary
console.log('\n=== Summary ===');
if (!hasWpShortcodeComment && !hasClosingComment && !hasVisibleComment && hasForm && navCount === 1) {
console.log('✅ ALL TESTS PASSED! The page is working correctly.');
} else {
console.log('❌ Some issues remain. Please check the details above.');
}
await browser.close();
}
testManageEventFinal().catch(console.error);