login.spec.ts
1import { test, expect } from "@playwright/test";2 3test.describe("Login Flow", () => {4 test("TC-001: Login Success", async ({ page }) => {5 await page.goto("/login");6 7 await page.getByLabel("Email").fill("[email protected]");8 await page.getByLabel("Password").fill("SecurePass123!");9 await page.getByRole("button", { name: "Login" }).click();10 11 await expect(page).toHaveURL("/dashboard");12 await expect(page.getByText("Welcome back")).toBeVisible();13 });14 15 test("TC-002: Wrong Password", async ({ page }) => {16 await page.goto("/login");17 18 await page.getByLabel("Email").fill("[email protected]");19 await page.getByLabel("Password").fill("wrong-password");20 await page.getByRole("button", { name: "Login" }).click();21 22 await expect(page.getByRole("alert")).toContainText(23 "비밀번호가 올바르지 않습니다"24 );25 });26 27 test("TC-004: Locked Account", async ({ page }) => {28 await page.goto("/login");29 30 await page.getByLabel("Email").fill("[email protected]");31 await page.getByLabel("Password").fill("SecurePass123!");32 await page.getByRole("button", { name: "Login" }).click();33 34 await expect(page.getByRole("alert")).toContainText("계정이 잠겼습니다");35 });36});실행 로그
$ playwright codegen --target=typescript
자동화 요약
생성된 Playwright 스크립트 정보
- 프레임워크
- Playwright
- 언어
- TypeScript
- 생성된 테스트
- 42
- 예상 실행 시간
- 3분 12초