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

51 lines
No EOL
1.7 KiB
TypeScript

import { test, expect } from './fixtures/auth';
import { CommonActions } from './utils/common-actions';
test('Simple modal test', 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');
// Try to show modal directly with JavaScript
const modalResult = await page.evaluate(() => {
// Force show modal
const overlay = document.getElementById('template-form-overlay');
if (overlay) {
overlay.style.display = 'block';
overlay.style.visibility = 'visible';
overlay.style.opacity = '1';
return {
success: true,
display: getComputedStyle(overlay).display,
visibility: getComputedStyle(overlay).visibility
};
}
return { success: false, error: 'Modal not found' };
});
console.log('Manual modal show result:', modalResult);
// Take screenshot
await actions.screenshot('modal-manually-shown');
// Check if it's visible now
const modalVisibility = await page.locator('#template-form-overlay').isVisible();
console.log('Modal visible after manual show:', modalVisibility);
// If it's visible, try to interact with it
if (modalVisibility) {
// Try to fill the title field
const titleField = page.locator('#hvac_template_title');
await expect(titleField).toBeVisible();
await titleField.fill('Manual Test Template');
console.log('Successfully interacted with modal form');
await actions.screenshot('modal-form-filled');
}
});