- 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 |
||
|---|---|---|
| .. | ||
| archived | ||
| pages | ||
| utils | ||
| certificate-generation-checked-in.test.ts | ||
| certificate-generation-manual.test.ts | ||
| certificate-generation-non-checked-in.test.ts | ||
| certificate-generation.test.ts | ||
| certificate-management-manual.test.ts | ||
| certificate-management.test.ts | ||
| CERTIFICATE_TESTING_GUIDE.md | ||
| certificates.test.ts | ||
| COMMIT_MESSAGE.md | ||
| email-attendees.test.ts | ||
| event-summary.spec.ts | ||
| global-setup.ts | ||
| global-teardown.ts | ||
| optimized-certificate-tests.ts | ||
| order-summary.test.ts | ||
| page-rendering-verification.test.ts | ||
| playwright.config.ts | ||
| README.md | ||
| TESTING-STRATEGY.md | ||
| trainer-journey-final.test.ts | ||
| trainer-journey-with-certificates.test.ts | ||
| trainer-profile-edit.spec.ts | ||
| TRAINER_JOURNEY_TEST_SUMMARY.md | ||
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
-
Verify your setup:
cd tests/e2e ./verify-setup.sh -
Run the trainer journey tests:
cd ../.. # Go to wordpress-dev directory ./bin/run-tests.sh --trainer-journey -
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:
- Login and Dashboard Access: Successfully tests trainer login and dashboard navigation
- 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
- Event Details: Views individual event pages
- 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
-
Environment Setup
.envfile with staging server credentials- Node.js and npm installed
- Playwright dependencies installed
-
Staging Server Requirements
- Test user
test_trainerexists - Required plugins activated
- HVAC Community Events plugin deployed
- Test user
Troubleshooting
If tests fail, check:
-
Network Issues
- Staging server is accessible
- No proxy/firewall blocking
-
Authentication Issues
- Test user credentials are correct
- User has proper role assigned
-
Element Not Found
- Page structure may have changed
- Update selectors in page objects
-
Certificate Generation Issues
- Verify events have attendees
- Check if attendees have proper check-in status
- Review certificate storage permissions
Contributing
When adding new tests:
- Use the Page Object Model pattern
- Add test data to centralized files
- Update documentation
- Follow existing naming conventions
- 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