Comprehensive Playwright tests for the Wheels CFML framework.
| File | Description |
|---|---|
example.spec.ts |
Basic smoke tests - quick verification that the app is running |
wheels-framework.spec.ts |
Complete tests for all Wheels framework endpoints |
mailer-jobs.spec.ts |
Tests for mailer and background job functionality |
configuration.spec.ts |
Tests for configuration, settings, and security |
api-endpoints.spec.ts |
API-focused tests with various response formats |
- Ensure your Wheels application is running on
http://127.0.0.1:8082 - Install Playwright dependencies:
npm install
npx playwright installnpx playwright testnpx playwright test e2e/wheels-framework.spec.tsnpx playwright test e2e/api-endpoints.spec.tsnpx playwright test --uinpx playwright test --headednpx playwright test -g "System Information"npx playwright test --project=chromium
npx playwright test --project=firefoxnpx playwright codegen http://127.0.0.1:8082The base URL is configured in playwright.config.ts:
use: {
baseURL: 'http://127.0.0.1:8082',
navigationTimeout: 30000,
actionTimeout: 15000,
}/wheels/info- System information/wheels/routes- Route listing/wheels/build- Build information/wheels/guides- Documentation guides/wheels/migrator- Database migrator/wheels/plugins- Plugin management/wheels/app/tests- Test runner/wheels/api- API endpoint
- Page loading and titles
- Response formats (HTML, JSON, TXT, XML)
- Wildcard routing
- CSRF protection
- Error handling
- Layout and view rendering
- Configuration settings
- Security headers
Add to your CI pipeline:
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run E2E Tests
run: npx playwright testIncrease timeout in playwright.config.ts:
timeout: 60000, // Global timeout
expect: { timeout: 30000 } // Expect timeoutEnsure your Wheels server is running:
# Check if server is running
curl http://127.0.0.1:8082/wheels/infoAll tests run against the same base URL, so CORS should not be an issue.
After running tests, generate an HTML report:
npx playwright show-reportReports are saved to playwright-report/ by default.
- Create a new
.spec.tsfile ine2e/ - Use the
test.describe()pattern for grouping related tests - Use
test.beforeEach()for common setup - Run tests with
npx playwright test
Example:
import { test, expect } from '@playwright/test';
test.describe('My Feature', () => {
test('should do something', async ({ page }) => {
await page.goto('/my-page');
await expect(page).toHaveTitle(/My Page/);
});
});