upskill-event-manager/wordpress-dev/tests/e2e/debug-modal.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

66 lines
No EOL
2.1 KiB
TypeScript

import { test, expect } from './fixtures/auth';
import { CommonActions } from './utils/common-actions';
test('Debug modal visibility', 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 initial modal state
const modalInitialState = await page.evaluate(() => {
const overlay = document.getElementById('template-form-overlay');
return {
exists: !!overlay,
display: overlay ? getComputedStyle(overlay).display : 'not found',
visibility: overlay ? getComputedStyle(overlay).visibility : 'not found'
};
});
console.log('Modal initial state:', modalInitialState);
// Click create button
const createButton = page.locator('button:has-text("Create New Template")');
await expect(createButton).toBeVisible();
console.log('Clicking create button...');
await createButton.click();
// Wait a moment
await page.waitForTimeout(2000);
// Check modal state after click
const modalAfterClick = await page.evaluate(() => {
const overlay = document.getElementById('template-form-overlay');
return {
exists: !!overlay,
display: overlay ? getComputedStyle(overlay).display : 'not found',
visibility: overlay ? getComputedStyle(overlay).visibility : 'not found'
};
});
console.log('Modal after click:', modalAfterClick);
// Try calling the function directly
const directCall = await page.evaluate(() => {
if (typeof HVACTemplates !== 'undefined' && HVACTemplates.createNewTemplate) {
HVACTemplates.createNewTemplate();
const overlay = document.getElementById('template-form-overlay');
return {
functionExists: true,
display: overlay ? getComputedStyle(overlay).display : 'not found'
};
}
return { functionExists: false };
});
console.log('Direct function call result:', directCall);
// Take a screenshot
await actions.screenshot('modal-debug-final');
});