본문 바로가기
Frontend2024년 12월 13일1분 읽기

Playwright E2E 테스트 실전 가이드

YS
김영삼
조회 268

Playwright 시작하기

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

test("로그인 플로우", async ({ page }) => {
  await page.goto("/login");
  await page.fill("[name=email]", "test@example.com");
  await page.fill("[name=password]", "password123");
  await page.click("button[type=submit]");
  await expect(page).toHaveURL("/dashboard");
  await expect(page.locator("h1")).toContainText("대시보드");
});

CI 통합

GitHub Actions에서 3개 브라우저(Chromium, Firefox, WebKit)로 병렬 실행할 수 있습니다.

댓글 0

아직 댓글이 없습니다.
Ctrl+Enter로 등록