E2E testing
End-to-end tests for Resuma apps with Playwright.
Approach
- Spin up the app with
cargo runorresuma devin CI - Use Playwright (Node) or
fantoccini(Rust WebDriver) against real HTTP - Assert SSR HTML, form POSTs to
/_resuma/submit/:name, and resumability markers
Playwright example
// tests/e2e/home.spec.ts
import { test, expect } from '@playwright/test';
test('landing renders h1', async ({ page }) => {
await page.goto('http://127.0.0.1:3000/');
await expect(page.locator('h1')).toContainText('Resuma');
});
test('form submit without JS', async ({ page }) => {
await page.goto('http://127.0.0.1:3000/contact');
await page.fill('input[name=email]', 'a@b.co');
await page.click('button[type=submit]');
await expect(page).toHaveURL(/thanks/);
});CI
# GitHub Actions
- run: cargo build -p my-app
- run: cargo run -p my-app &
- run: npx playwright test