upskill-event-manager/wordpress-dev/tests/e2e
bengizmo 353d951ba7 test: Optimize E2E testing infrastructure for certificates
- Add CertificatePage for certificate operations
- Create BasePage for common page object functionality
- Implement CertificateTestData for test data generation
- Create optimized certificate tests with improved stability
- Add test-certificate-filter.sh script for testing certificate filtering
- Improve test organization and reliability
2025-05-21 09:53:36 -03:00
..
archived docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
pages test: Optimize E2E testing infrastructure for certificates 2025-05-21 09:53:36 -03:00
utils test: Optimize E2E testing infrastructure for certificates 2025-05-21 09:53:36 -03:00
certificate-generation-checked-in.test.ts feat: Add comprehensive certificate E2E tests 2025-05-20 20:44:42 -03:00
certificate-generation-manual.test.ts docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
certificate-generation-non-checked-in.test.ts docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
certificate-generation.test.ts test: Add certificate generation tests and deployment tools 2025-05-20 15:32:29 -03:00
certificate-management-manual.test.ts docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
certificate-management.test.ts docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
CERTIFICATE_TESTING_GUIDE.md docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
certificates.test.ts test: Optimize E2E testing infrastructure for certificates 2025-05-21 09:53:36 -03:00
COMMIT_MESSAGE.md docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
email-attendees.test.ts feat: Add Email Attendees functionality (Phase 2) 2025-05-20 10:33:03 -03:00
event-summary.spec.ts test: Improve Event Summary authentication tests 2025-05-20 09:28:49 -03:00
global-setup.ts feat(testing): Implement comprehensive trainer journey test suite with Page Object Model 2025-05-18 15:42:00 -03:00
global-teardown.ts feat(testing): Implement comprehensive trainer journey test suite with Page Object Model 2025-05-18 15:42:00 -03:00
optimized-certificate-tests.ts test: Optimize E2E testing infrastructure for certificates 2025-05-21 09:45:00 -03:00
order-summary.test.ts feat: Implement Order Summary page functionality 2025-05-20 09:56:28 -03:00
page-rendering-verification.test.ts fix: Correct template path for dashboard shortcode 2025-05-20 10:41:18 -03:00
playwright.config.ts feat(testing): Implement comprehensive trainer journey test suite with Page Object Model 2025-05-18 15:42:00 -03:00
README.md docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
TESTING-STRATEGY.md test: Optimize E2E testing infrastructure for certificates 2025-05-21 09:45:00 -03:00
trainer-journey-final.test.ts feat: Add comprehensive test data setup and extended trainer journey tests 2025-05-18 20:14:28 -03:00
trainer-journey-with-certificates.test.ts docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00
trainer-profile-edit.spec.ts feat: Add trainer profile editing functionality 2025-05-20 09:47:22 -03:00
TRAINER_JOURNEY_TEST_SUMMARY.md docs: Update certificate testing documentation and methodology 2025-05-20 23:10:19 -03:00

HVAC Community Events - E2E Tests

Trainer Journey Testing

This directory contains end-to-end tests for the complete Trainer User Journey as defined in the project requirements.

Quick Start

  1. Verify your setup:

    cd tests/e2e
    ./verify-setup.sh
    
  2. Run the trainer journey tests:

    cd ../..  # Go to wordpress-dev directory
    ./bin/run-tests.sh --trainer-journey
    
  3. Run certificate tests (manual guided testing):

    cd ../..  # Go to wordpress-dev directory
    ./bin/run-certificate-tests.sh generation  # Test certificate generation
    ./bin/run-certificate-tests.sh reports     # Test certificate reports
    

Test Coverage

The test suite covers the following trainer journey steps:

  • Login & Authentication (Steps 1-2)
  • Dashboard Access (Step 3)
  • Event Management (Step 4)
    • Create events (Step 4a)
    • View event list (Step 4b)
    • Modify events (Step 4c)
    • Delete events (Step 4d)
  • Event Details View (Step 5)
  • Event Statistics (Step 6 - In Progress)
  • Order & Attendee Details (Steps 7-8 - Pending)
  • Email Communication (Step 9 - Phase 2)
  • Attendee Check-in (Step 10)
  • Certificate Generation (Step 11 - Now Implemented!)
    • Generate certificates for attendees
    • View and manage certificates
    • Email and revoke certificates

Project Structure

tests/e2e/
├── pages/              # Page Object Model classes
│   ├── BasePage.ts
│   ├── LoginPage.ts
│   ├── DashboardPage.ts
│   ├── CreateEventPage.ts
│   ├── EventSummaryPage.ts
│   ├── ModifyEventPage.ts
│   └── CertificatePage.ts     # NEW!
├── utils/               # Utility classes
│   ├── Config.ts         # NEW! Centralized configuration
│   └── CertificateTestData.ts # NEW! Certificate test data
├── data/               # Test data
│   ├── test-users.ts
│   └── test-events.ts
├── docs/               # Documentation
│   └── trainer-journey-testing.md
├── test-plan/          # Test planning documents
│   └── trainer-journey-verification.md
├── trainer-journey.test.ts  # Main test suite
├── certificate-generation-manual.test.ts  # NEW! Manual certificate tests
├── certificate-management-manual.test.ts  # NEW! Manual certificate tests
├── CERTIFICATE_TESTING_GUIDE.md  # NEW! Certificate testing documentation
├── verify-setup.sh     # Setup verification script
└── README.md          # This file

Running Specific Tests

# Run all E2E tests
./bin/run-tests.sh --e2e

# Run only trainer journey tests
./bin/run-tests.sh --trainer-journey

# Run specific test scenarios
./bin/run-tests.sh --e2e --grep @login
./bin/run-tests.sh --e2e --grep @dashboard
./bin/run-tests.sh --e2e --grep @create-event

# Run certificate tests
./bin/run-certificate-tests.sh generation
./bin/run-certificate-tests.sh reports

Test Results

  • Console output shows real-time test progress
  • Screenshots saved in test-results/screenshots/
  • Test reports generated in test-results/

Latest Test Summary (2025-05-20)

The trainer journey tests are now PASSING with the following coverage:

  1. Login and Dashboard Access: Successfully tests trainer login and dashboard navigation
  2. Event Management: Complete coverage of event CRUD operations:
    • Create new events with all required fields
    • View events in My Events page (both upcoming and past)
    • Modify existing events
    • Delete events with confirmation
  3. Event Details: Views individual event pages
  4. Certificate Generation: Now implemented!
    • Generate certificates for event attendees
    • Manage certificates (view, email, revoke)
    • Filter and paginate certificate lists

Key findings:

  • Events created during testing appear in My Events but not in main dashboard (application issue)
  • TinyMCE editor requires special handling in tests
  • Multiple fallback strategies implemented for form fields
  • Certificate generation properly handles checked-in vs. non-checked-in attendees

For complete details on certificate testing, see the Certificate Testing Guide.

Prerequisites

  1. Environment Setup

    • .env file with staging server credentials
    • Node.js and npm installed
    • Playwright dependencies installed
  2. Staging Server Requirements

    • Test user test_trainer exists
    • Required plugins activated
    • HVAC Community Events plugin deployed

Troubleshooting

If tests fail, check:

  1. Network Issues

    • Staging server is accessible
    • No proxy/firewall blocking
  2. Authentication Issues

    • Test user credentials are correct
    • User has proper role assigned
  3. Element Not Found

    • Page structure may have changed
    • Update selectors in page objects
  4. Certificate Generation Issues

    • Verify events have attendees
    • Check if attendees have proper check-in status
    • Review certificate storage permissions

Contributing

When adding new tests:

  1. Use the Page Object Model pattern
  2. Add test data to centralized files
  3. Update documentation
  4. Follow existing naming conventions
  5. Use the Config utility for environment variables

Support

For issues or questions:

  • Check the troubleshooting guide above
  • Review test output and screenshots
  • Check staging server logs
  • Contact the development team