upskill-event-manager/test-final-manage-event.js
ben 16acf2c8e7 docs: comprehensive deprecation of legacy event creation system
- Create authoritative DEPRECATED-FILES.md documenting 27+ deprecated files
- Add deprecation notices to legacy templates (page-create-event.php, page-manage-event.php, page-edit-event.php)
- Mark deprecated JavaScript files (hvac-event-form-templates.js) with migration paths
- Add deprecation notices to 8 legacy test files with comprehensive explanations
- Update Status.md to reflect completion of comprehensive event creation system v3.2.0
- Automated deprecation script for consistent messaging across files

All deprecated functionality has been replaced by:
- page-tec-create-event.php with AI assistance and native TEC integration
- Comprehensive E2E testing framework with Page Object Model
- Integrated template system with enhanced user experience
- Modern responsive design with role-based permissions

Scheduled for removal in v3.3 after transition period

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 20:55:13 -03:00

85 lines
No EOL
3.6 KiB
JavaScript

#!/usr/bin/env node
/**
* ⛔ DEPRECATED - January 2025
* This test file has been deprecated and replaced by comprehensive E2E testing framework
*
* Reasons for deprecation:
* - Tests old event creation/management forms that have been replaced
* - Individual test files replaced by comprehensive test suites
* - Page Object Model (POM) architecture provides better test organization
* - Modern test framework with better error handling and reporting
*
* Replacement: test-master-trainer-e2e.js + test-comprehensive-validation.js
* - Comprehensive E2E testing covering all event workflows
* - Page Object Model for maintainable tests
* - Better test organization and reporting
* - Docker-based testing environment
*
* See: DEPRECATED-FILES.md for full migration details
*/
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);