Writing Page Interaction Tests
Click, fill forms, and assert DOM state using Playwright's powerful API.
Basic Test
Each test imports test and expect from Playwright.
import { test, expect } from "@playwright/test";
test("homepage", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveTitle(/My App/);
});Navigation
Use page.goto(url) to visit pages and page.click() to navigate via clicks.
All lessons in this course
- Playwright Setup in SvelteKit
- Writing Page Interaction Tests
- Testing Forms and Navigation
- CI Integration