This repository contains end-to-end testing for The Events Calendar using TestFlow, a WordPress Plugin Testing Framework with Lando and Playwright.
This project provides automated testing for The Events Calendar plugin across multiple environments and configurations. It uses TestFlow for environment management and Playwright for browser automation.
- π Automated Environment Setup: Uses Lando for consistent WordPress environments
- π Playwright Integration: Modern browser automation for E2E testing
- π Plugin Source Management: Automatic installation of The Events Calendar from WordPress.org
- ποΈ Matrix Testing: Test across different PHP/MySQL/WordPress versions
- π Multi-Configuration Support: Parallel testing with selective execution
- π§ WordPress Helpers: Built-in utilities for WordPress testing tasks
-
Clone the repository:
git clone <repository-url> cd tec-tests
-
Install dependencies:
bun install
-
Verify installation:
bun run status
The project is configured via testflow.yaml:
- WordPress Environment: PHP 8.2, MySQL 8.0, WordPress 6.4
- Plugin Source: The Events Calendar from WordPress.org
- Test Directory:
tests/e2e/ - Matrix Testing: Multiple PHP/WordPress version combinations
# Run tests with default configuration
bun run test
# Run all matrix combinations
bun run test:matrix
# Run with debug mode
bun run test:debug
# Check TestFlow status
bun run status
# List available matrix configurations
bunx testflow matrix list# Start Lando environment (requires Lando installed)
bun run lando:start
# Stop Lando environment
bun run lando:stop
# Destroy Lando environment
bun run lando:destroyThe initial test suite includes:
- β Plugin installation verification
- β Plugin activation confirmation
- β Admin menu presence check
- β Event creation workflow
- β Event management interface
- β Settings page accessibility
- β Calendar view display
- β List view functionality
- β Event search capabilities
The project supports testing across multiple configurations:
- WordPress: 6.8 (latest)
- PHP: 8.2 (current stable)
- MySQL: 8.0 (latest stable)
- Plugin: The Events Calendar (from WordPress.org)
The project uses specific workflows for different testing scenarios:
- Purpose: Tests basic TEC functionality
- Configuration: WordPress 6.8, PHP 8.2, MySQL 8.0
- Triggers: PR to main, daily at 2 AM UTC, manual dispatch
- Features: Comprehensive E2E testing with The Events Calendar
- Manual Triggers: All workflows support manual dispatch with debug mode
- Artifact Collection: Test results and screenshots automatically uploaded
- Clean Environments: Lando environments destroyed after each run
- Debug Mode: Optional verbose logging via workflow dispatch input
# Trigger tests manually with debug mode
# Go to Actions β Basic The Events Calendar Tests β Run workflow β Enable debug
# Tests run automatically on:
# - Pull requests to main branch
# - Daily at 2 AM UTC via scheduled runtec-tests/
βββ .github/
β βββ workflows/
β βββ basic-the-events-calendar.yml # TEC testing workflow
βββ tests/
β βββ e2e/
β βββ events-calendar-installation.test.ts # Main test file
βββ testflow.yaml # TestFlow configuration
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
- Create new test files in
tests/e2e/ - Follow the existing test structure
- Use descriptive test names and documentation
- Include proper assertions and error handling
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
// Setup code
});
test('should do something specific', async ({ page }) => {
// Test implementation
});
});The project includes built-in WordPress testing utilities:
// Login to WordPress admin
await page.goto('/wp-admin/');
await page.fill('#user_login', 'admin');
await page.fill('#user_pass', 'admin123');
await page.click('#wp-submit');# Run tests with debug output
bun run test:debug
# Check Lando logs
lando logs
# View TestFlow status
bun run status- Enable debug mode in GitHub Actions workflow
- Review uploaded artifacts for detailed logs
- Check Lando logs for environment issues
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass locally
- Submit a pull request
- Follow WordPress coding standards for PHP-related tests
- Use ES6+ syntax for JavaScript/TypeScript
- Add proper docblocks with
@since TBD - Include descriptive test names and comments
- Lando not starting: Ensure Docker is running
- Plugin not found: Verify WordPress.org plugin slug
- Test timeouts: Increase timeout values for slow operations
- Permission errors: Check file permissions and Docker access
- Check TestFlow status:
bun run status - Verify Lando environment:
bun run lando:start - Review test output for specific errors
- Check GitHub Actions logs for CI issues
- π TestFlow Documentation
- π Issue Tracker
- π¬ Discussions
MIT License - see LICENSE file for details.