본문으로 건너뛰기
Skillpedia
테스트48k · #5456

playwright-java

하는 일

이 도구는 웹사이트가 올바르게 작동하는지 확인하는 자동화된 테스트를 만들도록 돕습니다. 대규모 프로젝트에서 유지보수와 협업이 쉽도록 코드를 정리합니다.

사용하는 경우

  • ✓새 웹사이트 테스트 프로젝트를 시작할 때.
  • ✓특정 웹사이트 기능을 테스트하는 코드를 작성할 때.
  • ✓테스트에 대한 자세한 보고서가 필요할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/playwright-java/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/playwright-java/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“페이지 객체 모델(Page Object Model) 패턴을 사용해 로그인 페이지의 자동 테스트를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 ‘페이지 객체 모델(Page Object Model)’ 패턴을 사용해 코드를 정리합니다. 웹사이트의 각 페이지가 코드 속 객체로 표현되고, 테스트는 그 객체와 상호작용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/config.md
  • <support-root>/references/page-objects.md
  • <support-root>/references/assertions.md
  • <support-root>/references/fixtures.md
  • <support-root>/templates/BaseTest.java
  • <support-root>/templates/BasePage.java
  • src/test/resources/junit-platform.properties

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Playwright Java – Advanced Test Automation

Overview

This skill produces production-quality, enterprise-grade Playwright Java test code. It enforces the Page Object Model (POM), strict locator strategies, thread-safe parallel execution, and full Allure reporting integration. Targets Java 17+ and Playwright 1.44+.

Supporting reference files are available for deeper topics:

Topic File
Maven POM, ConfigReader, Docker/CI setup references/config.md
Component pattern, dropdowns, uploads, waits references/page-objects.md
Full assertion API, soft assertions, visual testing references/assertions.md
Fixtures, test data factory, auth state, retry references/fixtures.md
Drop-in base class templates templates/BaseTest.java, templates/BasePage.java

When to Use This Skill

  • Use when scaffolding a new Playwright Java project from scratch
  • Use when writing Page Object classes or JUnit 5 test classes
  • Use when the user asks about cross-browser testing, parallel execution, or Allure reports
  • Use when fixing flaky tests or replacing Thread.sleep() with proper waits
  • Use when setting up Playwright in CI/CD pipelines (GitHub Actions, Jenkins, Docker)
  • Use when combining API calls and UI assertions in a single test (hybrid testing)
  • Use when the user mentions "POM pattern", "BrowserContext", "Playwright fixtures", or "traces"

How It Works

Step 1: Decide the Approach

Use this matrix to pick the right pattern before writing any code:

User Request Approach
New project from scratch Full scaffold — see references/config.md
Single feature test POM page class + JUnit5 test class
API + UI hybrid APIRequestContext alongside Page
Cross-browser @MethodSource parameterized over browser names
Flaky test fix Replace sleep with waitFor / waitForResponse
CI integration playwright install --with-deps in pipeline
Parallel execution junit-platform.properties + ThreadLocal
Rich reporting Allure + Playwright trace + video recording

Step 2: Scaffold the Project Structure

Always use this layout when creating a new project:

src/
├── test/
│   ├── java/com/company/tests/
│   │   ├── base/
│   │   │   ├── BaseTest.java        ← templates/BaseTest.java
│   │   │   └── BasePage.java        ← templates/BasePage.java
│   │   ├── pages/
│   │   │   └── LoginPage.java
│   │   ├── tests/
│   │   │   └── LoginTest.java
│   │   ├── utils/
│   │   │   ├── TestDataFactory.java
│   │   │   └── WaitUtils.java
│   │   └── config/
│   │       └── ConfigReader.java
│   └── resources/
│       ├── test.properties
│       ├── junit-platform.properties
│       └── testdata/users.json
pom.xml

Step 3: Set Up Thread-Safe BaseTest

public class BaseTest {
    protected static ThreadLocal<Playwright>     playwrightTL = new ThreadLocal<>();
    protected static ThreadLocal<Browser>        browserTL    = new ThreadLocal<>();
    protected static ThreadLocal<BrowserContext> contextTL    = new ThreadLocal<>();
    protected static ThreadLocal<Page>           pageTL       = new ThreadLocal<>();

    protected Page page() { return pageTL.get(); }

    @BeforeEach
    void setUp() {
        Playwright playwright = Playwright.create();

…
자주 묻는 질문

‘페이지 객체 모델’이란 무엇인가요?

테스트 코드를 정리하는 방식으로, 웹사이트의 각 페이지(또는 일부)가 코드 속 객체가 됩니다. 그래서 테스트를 읽고 유지보수하기 쉬워집니다.

‘병렬 테스트’란 무엇인가요?

여러 테스트를 동시에 실행하는 것을 뜻하며, 웹사이트 검증 과정을 빠르게 만듭니다.

‘Allure 보고서’란 무엇인가요?

단계, 스크린샷, 로그를 포함해 각 테스트의 결과를 보여 주는 시각적이고 자세한 보고서입니다.

상세 정보

작성자의 원본 설명

Scaffold, write, debug, and enhance enterprise-grade Playwright E2E tests in Java using Page Object Model, JUnit 5, Allure reporting, and parallel execution.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5456
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬