upskill-event-manager/wordpress-dev/tests/e2e/debug-scripts.test.ts
bengizmo a0d47b3b3e feat: Implement configurable Communication Schedule system
This commit implements Phase 1 of the Communication Schedule system, providing:

Core Infrastructure:
- HVAC_Communication_Scheduler: Main controller with cron integration and AJAX handlers
- HVAC_Communication_Schedule_Manager: CRUD operations and database interactions
- HVAC_Communication_Trigger_Engine: Automation logic and recipient management
- HVAC_Communication_Logger: Execution logging and performance tracking
- HVAC_Communication_Installer: Database table creation and management

Features:
- Event-based triggers (before/after event, on registration)
- Custom date scheduling with recurring options
- Flexible recipient targeting (all attendees, confirmed, custom lists)
- Template integration with placeholder replacement
- WordPress cron integration for automated execution
- Comprehensive AJAX API for schedule management
- Template quickstart options for common scenarios

UI Components:
- Communication Schedules page with full management interface
- Form-based schedule creation with validation
- Schedule listing with filtering and status management
- Modal recipient preview functionality
- Pre-configured schedule templates for quick setup

Database Design:
- hvac_communication_schedules: Schedule configurations
- hvac_communication_logs: Execution history and statistics
- hvac_event_communication_tracking: Individual email tracking

The system integrates with existing email templates and provides a foundation
for automated communication workflows for HVAC trainers.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 00:07:30 -03:00

38 lines
No EOL
1.4 KiB
TypeScript

import { test, expect } from './fixtures/auth';
import { CommonActions } from './utils/common-actions';
test('Debug loaded scripts', async ({ authenticatedPage: page }) => {
test.setTimeout(30000);
const actions = new CommonActions(page);
// Navigate to templates page
await actions.navigateAndWait('/communication-templates/');
// Wait for scripts
await page.waitForFunction(() => typeof HVACTemplates !== 'undefined');
// Check what scripts are loaded
const scriptInfo = await page.evaluate(() => {
const scripts = Array.from(document.querySelectorAll('script[src]'));
const hvacScripts = scripts.filter(script => script.src.includes('hvac') || script.src.includes('communication'));
return {
totalScripts: scripts.length,
hvacScripts: hvacScripts.map(script => script.src),
hasHVACTemplates: typeof HVACTemplates !== 'undefined',
createNewTemplateFunction: HVACTemplates ? HVACTemplates.createNewTemplate.toString() : 'not found'
};
});
console.log('Script analysis:', JSON.stringify(scriptInfo, null, 2));
// Check if external JS file is also loading and overriding
const jsFile = await page.evaluate(() => {
const scripts = Array.from(document.querySelectorAll('script[src]'));
return scripts.find(script => script.src.includes('communication-templates.js'))?.src;
});
console.log('External JS file found:', jsFile);
await actions.screenshot('scripts-debug');
});