Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
shipshitdev avatar

Playwright E2e Init

  • 312 installs
  • 31 repo stars
  • Updated August 2, 2026
  • shipshitdev/library

playwright-e2e-init is an agent skill that bootstraps Playwright end-to-end test suites with configs, fixtures, and smoke specs for developers who need CI-ready browser automation on Next.js and React projects.

About

playwright-e2e-init is a version 1.0.0 agent skill from shipshitdev/library that initializes Playwright E2E testing for Next.js and React applications. It performs six setup steps: install @playwright/test and Chromium browsers, create playwright.config.ts with baseURL localhost:3000, CI retries, trace on-first-retry, and a bun run dev webServer; scaffold an e2e/ directory with home.spec.ts, auth.spec.ts, navigation.spec.ts, and fixtures/test-data.ts; add five bun scripts (e2e, e2e:ui, e2e:headed, e2e:debug, e2e:report); and patch GitHub Actions to install browsers, run tests, and upload playwright-report artifacts for 7 days. Best practices recommend data-testid selectors, page objects under e2e/pages/, independent tests, and test.extend fixtures. The library lists playwright-e2e-init among eight Testing-category skills. Use it when a frontend project has unit tests but lacks browser coverage for auth, checkout, or navigation flows.

  • Scaffolds Playwright project structure and config
  • Adds starter specs and fixture patterns
  • Wires CI-friendly headless runs
  • Covers cross-browser smoke coverage
  • Accelerates regression suites before launch

Playwright E2e Init by the numbers

  • 312 all-time installs (skills.sh)
  • +5 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #692 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/shipshitdev/library --skill playwright-e2e-init

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs312
repo stars31
Last updatedAugust 2, 2026
Repositoryshipshitdev/library

How do you initialize Playwright E2E tests in Next.js?

Bootstrap Playwright end-to-end test suites with configs, fixtures, and first smoke specs so web and hybrid apps get reliable CI-ready browser automation fast.

Who is it for?

Frontend developers adding first Playwright E2E coverage to Next.js or React apps who need working config, example specs, and CI integration in one pass.

Skip if: Backend-only APIs without a browser UI, projects already fully covered by an existing Playwright suite, or teams standardized on Cypress without migration intent.

When should I use this skill?

User asks to add Playwright E2E tests, set up browser automation, scaffold e2e specs, or integrate Playwright into CI for a Next.js or React project.

What you get

playwright.config.ts, e2e/*.spec.ts files, bun/npm test scripts, installed Chromium browsers, and CI workflow steps running Playwright with HTML reports.

  • playwright.config.ts
  • e2e test specs
  • CI workflow Playwright steps

By the numbers

  • Skill version 1.0.0 with 6 documented setup steps from install through CI integration
  • Scaffolds 3 example spec files: home, auth, and navigation
  • Adds 5 bun/npm scripts for running and debugging Playwright tests

Files

SKILL.mdMarkdownGitHub ↗

Playwright E2E Testing Initialization

Sets up Playwright for end-to-end testing in Next.js and React applications.

When to Use

This skill should be used when:

  • Adding E2E tests to a Next.js project
  • Setting up browser automation testing
  • Creating user flow tests for critical paths
  • Integrating E2E tests with CI/CD pipeline

What It Does

1. Installs Playwright and browsers 2. Creates configuration (playwright.config.ts) 3. Sets up test directory (e2e/) 4. Creates example tests for common flows 5. Adds Bun scripts for running tests 6. Updates CI/CD to run E2E tests

Quick Start

Example prompt:

Add Playwright E2E tests to this project

Or be specific:

Set up E2E tests for the authentication flow

Installation

bun add -D @playwright/test
bunx playwright install chromium

Configuration

playwright.config.ts

import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
  testDir: "./e2e",
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  reporter: [["html", { open: "never" }], ["list"]],
  use: {
    baseURL: "http://localhost:3000",
    trace: "on-first-retry",
    screenshot: "only-on-failure",
  },
  projects: [
    { name: "chromium", use: { ...devices["Desktop Chrome"] } },
  ],
  webServer: {
    command: "bun run dev",
    url: "http://localhost:3000",
    reuseExistingServer: !process.env.CI,
    timeout: 120 * 1000,
  },
});

Test Structure

e2e/
├── home.spec.ts          # Homepage tests
├── auth.spec.ts          # Authentication flow
├── navigation.spec.ts    # Navigation tests
└── fixtures/
    └── test-data.ts      # Shared test data

Example Tests

Generate project-specific tests for the actual routes in the codebase. Standard Playwright test patterns (navigation, auth flows, form submission, fixtures) are well-documented at https://playwright.dev/docs/writing-tests — focus inline tests on the project's concrete pages and critical user flows rather than generic examples.

Bun Scripts

Add to package.json:

{
  "scripts": {
    "e2e": "playwright test",
    "e2e:ui": "playwright test --ui",
    "e2e:headed": "playwright test --headed",
    "e2e:debug": "playwright test --debug",
    "e2e:report": "playwright show-report"
  }
}

CI/CD Integration

GitHub Actions

Add to your CI workflow:

- name: Install Playwright Browsers
  run: bunx playwright install --with-deps chromium

- name: Run E2E tests
  run: bun run e2e
  env:
    CI: true

- name: Upload Playwright Report
  uses: actions/upload-artifact@v4
  if: always()
  with:
    name: playwright-report
    path: playwright-report/
    retention-days: 7

Best Practices

  • Focus E2E tests on critical user flows: auth, core features, payment/checkout, error handling.
  • Use data-testid attributes for selectors — do not rely on CSS classes or text content.
  • Use Page Object Model for reusable page interactions (e2e/pages/).
  • Keep tests independent: each test sets up and cleans up its own state.
  • Use test.extend fixtures for shared setup (authenticated sessions, seeded data).

Troubleshooting

Tests timing out

Increase timeout in config:

timeout: 60000, // 60 seconds

Elements not found

Use waitFor:

await page.waitForSelector('[data-testid="element"]');

Flaky tests

Add retries and use toPass:

await expect(async () => {
  await expect(page.locator("text=Success")).toBeVisible();
}).toPass({ timeout: 10000 });

Integration with Other Skills

SkillIntegration
testing-cicd-initSets up unit tests first
testing-expertProvides testing patterns
debugInvestigates flaky tests and failing browser flows

Related skills

How it compares

Pick playwright-e2e-init over manual Playwright docs when you want opinionated Next.js defaults, example specs, and CI YAML in one bootstrap pass rather than piecemeal setup.

FAQ

What files does playwright-e2e-init create?

playwright-e2e-init creates playwright.config.ts, an e2e/ folder with home, auth, and navigation spec files plus fixtures/test-data.ts, bun/npm scripts for five test commands, and GitHub Actions steps to install browsers and upload reports.

Which frameworks does playwright-e2e-init target?

playwright-e2e-init targets Next.js and React frontend projects. The default config sets baseURL http://localhost:3000 and starts bun run dev as the webServer before tests execute.

What CI settings does playwright-e2e-init recommend?

The skill enables forbidOnly in CI, sets retries to 2, uses one worker, installs Chromium with deps via bunx playwright install --with-deps, and uploads the HTML playwright-report artifact with 7-day retention.

Testing & QAtestingfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.