Saltar al contenido
Skillpedia
Pruebas48 mil · #5456

playwright-java

Qué hace

Esta herramienta ayuda a crear pruebas automatizadas para comprobar que un sitio web funciona correctamente. Organiza el código para que sea más fácil de mantener y de trabajar en equipo en proyectos grandes.

Cuándo usarla

  • ✓Cuando empiezas un proyecto nuevo de pruebas de un sitio web.
  • ✓Cuando escribes código para probar funciones concretas de una web.
  • ✓Cuando necesitas informes detallados sobre las pruebas.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/playwright-java/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Crea una prueba automatizada para la página de inicio de sesión usando el patrón Page Object Model.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta usa un patrón llamado 'Page Object Model' para organizar el código. Cada página del sitio web tiene su propia representación en código, y las pruebas interactúan con estas representaciones.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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();

…
Preguntas frecuentes

¿Qué es 'Page Object Model'?

Es una forma de organizar el código de las pruebas en la que cada página de la web (o una parte de ella) se convierte en un objeto dentro del código. Así, las pruebas son más fáciles de leer y de mantener.

¿Qué son las 'pruebas en paralelo'?

Significa ejecutar varias pruebas al mismo tiempo, lo que acelera el proceso de verificación del sitio web.

¿Qué son los 'informes de Allure'?

Son informes visuales y detallados que muestran el resultado de cada prueba, incluyendo los pasos, las capturas de pantalla y los registros.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
48 mil
Posición en el ranking
#5456
Licencia
MIT
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas