0Pricing
Angular Academy · Lesson

Writing Playwright Tests

Automate browser flows with Playwright.

Your First Playwright Test

A Playwright test is an async function that receives fixtures like page. You import test and expect from @playwright/test and describe a user scenario.

import { test, expect } from '@playwright/test';

test('opens the home page', async ({ page }) => {
  await page.goto('/');
  await expect(page).toHaveURL(/.*localhost/);
});

The page Fixture

The page object represents a single browser tab. Every test gets a fresh, isolated page in a clean context, so tests never share cookies or storage by accident.

All lessons in this course

  1. E2E Testing Overview
  2. Writing Playwright Tests
  3. Selectors and Assertions
  4. CI Integration
← Back to Angular Academy