Agent skill

Playwright Testing

by openkaiden in openkaiden/kaiden

Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern.

Apache-2.0Auto-check passedTesting & QA

Install Playwright Testing

skills CLI
$ npx skills add openkaiden/kaiden --skill playwright-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openkaiden/kaiden playwright-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openkaiden/kaiden.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/playwright-testing .claude/skills/playwright-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
playwright-testing
GitHub stars
110
Token cost
~3k tokens
SKILL.md length
495 words
Files
4
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern.

  • Works in 6 steps: Page Object Model (POM): Every… → Resilient locators: Use accessible… → Explicit waits: Use expect with… → …
  • Tasks that involve Browser testing
  • SKILL.md covers Core Principles, Project Structure, Naming Conventions and Page Object Conventions, plus 8 more sections
  • Calls pnpm and npx; needs GEMINI_API_KEY and OPENAI_API_KEY

What it does

Playwright Testing is an agent skill from openkaiden/kaiden. Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern. Workspace provider lifecycle and sandbox matrix tests are documented in workspace-provider-e2e.md.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `examples.md`, `reference.md` and `workspace-provider-e2e.md`).

It sits in Testing & QA, covering Browser testing and End-to-end testing. It works with Playwright. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Browser testing
  • Tasks that involve End-to-end testing

Example prompts

  • “/playwright-testing”

Requirements

  • Node.js
  • A credential in GEMINI_API_KEY
  • A credential in OPENAI_API_KEY

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Page Object Model (POM): Every page/component gets its own class. Tests never touch raw locators directly.
  2. Resilient locators: Use accessible selectors — getByRole, getByLabel, getByText — before falling back to getByTestId or CSS.
  3. Explicit waits: Use expect with auto-retry or expect.poll() for async operations. Never use arbitrary setTimeout delays.
  4. Serial execution: Use test.describe.serial() for interdependent tests (e.g., create → verify → delete flows).
  5. Fixture-based setup/teardown: Resources, MCP servers, and Goose are managed via Playwright fixtures with automatic cleanup.
  6. Clear failures: Every assertion should produce a readable error. Use descriptive test IDs ([FEATURE-NUM]).

What it can do on your machine

Read from SKILL.md and the folder at commit 5a3f5af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm and npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GEMINI_API_KEY
    • OPENAI_API_KEY
    • GITHUB_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Playwright Testing loads about 3k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 495 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from openkaiden/kaiden at commit 5a3f5af, republished under its Apache-2.0 licence (© openkaiden). 495 words, ~2,993 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-testing/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
playwright-testing
description
Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern. Workspace provider lifecycle and sandbox matrix tests are documented in workspace-provider-e2e.md.

Playwright Test Automation Guide for Kaiden

Core Principles

  1. Page Object Model (POM): Every page/component gets its own class. Tests never touch raw locators directly.
  2. Resilient locators: Use accessible selectors — getByRole, getByLabel, getByText — before falling back to getByTestId or CSS.
  3. Explicit waits: Use expect with auto-retry or expect.poll() for async operations. Never use arbitrary setTimeout delays.
  4. Serial execution: Use test.describe.serial() for interdependent tests (e.g., create → verify → delete flows).
  5. Fixture-based setup/teardown: Resources, MCP servers, and Goose are managed via Playwright fixtures with automatic cleanup.
  6. Clear failures: Every assertion should produce a readable error. Use descriptive test IDs ([FEATURE-NUM]).

Project Structure

tests/playwright/
├── playwright.config.ts              # Test projects, timeouts, reporters
├── package.json
├── tsconfig.json
├── src/
│   ├── fixtures/
│   │   ├── electron-app.ts           # Core Electron app + page object fixtures
│   │   └── provider-fixtures.ts      # Provider resource/MCP/Goose setup (worker-scoped)
│   ├── model/
│   │   ├── core/
│   │   │   └── types.ts              # Enums, constants, interfaces, TIMEOUTS
│   │   ├── navigation/
│   │   │   └── navigation.ts         # NavigationBar — navigates to all major pages
│   │   └── pages/
│   │       ├── base-page.ts          # Abstract base: waitForLoad(), openTab()
│   │       ├── base-table-page.ts    # Table operations: row lookup, polling, counting
│   │       ├── chat-page.ts          # Chat UI interactions (40+ methods)
│   │       ├── flows-page.ts         # Flow management with table operations
│   │       ├── flows-create-page.ts  # Flow creation workflow
│   │       ├── flows-details-page.ts # Flow details view
│   │       ├── settings-page.ts      # Main settings hub
│   │       ├── mcp-page.ts           # MCP server management
│   │       ├── extensions-page.ts    # Extension browsing
│   │       ├── agent-workspaces-page.ts      # Workspace list + lifecycle entry
│   │       ├── agent-workspace-create-page.ts # Create wizard (FS + network steps)
│   │       ├── agent-workspace-details-page.ts # Workspace details shell
│   │       ├── agent-workspace-overview-page.ts # Overview tab
│   │       ├── agent-workspace-terminal-page.ts
│   │       └── *-tab-page.ts         # Sub-page/tab objects
│   ├── specs/
│   │   ├── dashboard.spec.ts         # App startup and navigation
│   │   ├── extensions-smoke.spec.ts  # Extension management
│   │   ├── settings-smoke.spec.ts    # Settings pages
│   │   ├── workspaces-smoke.spec.ts  # Workspace wizard UI (Kaiden-App-Core, @smoke)
│   │   └── provider-specs/           # Provider-specific tests
│   │       ├── chat-smoke.spec.ts    # Chat functionality (gold standard)
│   │       ├── mcp-smoke.spec.ts     # MCP servers
│   │       └── workspaces/           # Coding Agent Workspace lifecycle (Workspace-Provider)
│   └── utils/
│       ├── app-ready.ts              # waitForAppReady(), waitForNavigationReady(), handleDialogIfPresent()
│       └── test-artifacts.ts         # Trace, screenshot, video capture on failure
└── output/                           # Generated reports and artifacts

Naming Conventions

ArtifactPatternExample
Page object*-page.tschat-page.ts
Tab sub-page*-tab-page.tssettings-resources-tab-page.ts
Spec file*-smoke.spec.ts or *.spec.tsextensions-smoke.spec.ts
Test ID[FEATURE-SCENARIO-NUM][CHAT-HIST-01], [EXT-03]
Provider specsprovider-specs/*.spec.tschat-smoke.spec.ts
Workspace IDs[{STEP}] {action} under {SCENARIO-ID} describe[01] creation under FS-NONE-NET-DEVELOPER
FixturescamelCase with purposeresourceSetup, mcpSetup

Page Object Conventions

Extending BasePage

All page objects extend BasePage and must implement waitForLoad():

typescript
import { BasePage } from './base-page';

export class MyPage extends BasePage {
  readonly heading: Locator;

  constructor(page: Page) {
    super(page);
    this.heading = this.page.getByRole('heading', { name: 'My Page' });
  }

  async waitForLoad(): Promise<void> {
    await expect(this.heading).toBeVisible({ timeout: TIMEOUTS.PAGE_LOAD });
  }
}
Extending BaseTablePage

For pages with data tables, extend BaseTablePage to get row lookup, polling, and counting for free:

typescript
import { BaseTablePage } from './base-table-page';

export class MyTablePage extends BaseTablePage {
  constructor(page: Page) {
    super(page, 'My Table'); // aria-label of the table
  }

  async waitForLoad(): Promise<void> {
    await expect(this.table).toBeVisible({ timeout: TIMEOUTS.PAGE_LOAD });
  }
}

Inherited methods: getTableRowByName(), countRowsFromTable(), ensureRowExists(), ensureRowDoesNotExist(), getRowLocatorByName(), getRowLocatorByIndex().

Tab Navigation via openTab()

Use openTab() to switch between tabs and return the new page object:

typescript
async openInstalledTab(): Promise<InstalledTabPage> {
  return this.openTab(this.installedTabButton, InstalledTabPage);
}

Locator Priority

Use this order when selecting elements:

  1. getByRole('button', { name: 'Submit' }) — accessibility-focused, preferred
  2. getByLabel('Email') — form elements
  3. getByText('Welcome') — visible content
  4. getByTestId('submit-btn') — semantic fallback
  5. CSS selectors — last resort only

Fixture System

Core Fixtures (electron-app.ts)
typescript
interface ElectronFixtures {
  electronApp: ElectronApplication;
  page: Page;
  navigationBar: NavigationBar;
  settingsPage: SettingsPage;
  flowsPage: FlowsPage;
  mcpPage: McpPage;
  extensionsPage: ExtensionsPage;
  chatPage: ChatPage;
}

Import as: import { test, expect } from '../fixtures/electron-app';

Provider Fixtures (provider-fixtures.ts)

Worker-scoped fixtures for provider-specific tests:

  • resource: Selectable provider ID (gemini, openai, ollama, ramalama)
  • resourceSetup: Auto-creates/deletes inference provider resources (auto: true)
  • mcpSetup: Configures MCP servers with env-var-based credentials (auto: false)
  • gooseSetup: Installs Goose CLI tool (auto: false)

Import as: import { test, expect } from '../../fixtures/provider-fixtures';

Show full SKILL.md (200 more words)Show less
When to use which fixture file
  • Core app tests (extensions, settings, dashboard): Use electron-app.ts
  • Provider-specific tests (chat, flows, MCP): Use provider-fixtures.ts

Timeout Constants

Defined in src/model/core/types.ts:

typescript
const TIMEOUTS = {
  PAGE_LOAD: 90_000, // Page initial load
  STANDARD: 30_000, // Standard operations
  SHORT: 10_000, // Quick checks
  MODEL_RESPONSE: 90_000, // LLM responses (especially local models)
  DEFAULT: 120_000, // App startup / general default
  INITIALIZING_SCREEN: 180_000, // App initialization
  NON_DEVTOOLS_WINDOW: 60_000, // Electron window detection
  RETRY_DELAY: 1_000, // Retry interval
  MAX_RETRIES: 3, // Max retry attempts
} as const;

App Readiness Utilities

Located in src/utils/app-ready.ts:

FunctionPurpose
waitForAppReady(page)Waits for main element, initialization screen, title bar
waitForNavigationReady(page)Waits for app + navigation bar to be visible
handleDialogIfPresent(page, options)Safely handles optional confirmation dialogs
clearAllToasts(page, toastLocator)Dismisses all toast notifications

Always call waitForNavigationReady(page) in beforeEach for specs that navigate.

Test Configuration

Playwright Config (playwright.config.ts)
  • Workers: 1 (serial execution for Electron)
  • Timeout: 180 seconds per test
  • Retries: 1 in CI, 0 locally
  • Action timeout: 15 seconds
  • Reporters: HTML, JSON, JUnit, list
Test Projects
ProjectTestsCondition
Kaiden-App-CoreAll specs except provider-specsAlways runs
Gemini-Providerprovider-specsRequires GEMINI_API_KEY
OpenAI-Providerprovider-specsRequires OPENAI_API_KEY
Workspace-Providerprovider-specs/workspaces/PODMAN_ENABLED + API keys; not PR smoke — see workspace-provider-e2e.md
Ollama-Providerprovider-specs (except flows)Requires OLLAMA_ENABLED
RamaLama-Providerprovider-specs (except flows)Requires RAMALAMA_ENABLED
OpenShift-AI-Providerprovider-specsCurrently disabled

Running Tests

bash
# Run all E2E tests (build + test)
pnpm run test:e2e

# Run tests only (must build first)
pnpm run test:e2e:run

# Run specific project
npx playwright test --project="Kaiden-App-Core"

# Run specific spec
npx playwright test tests/playwright/src/specs/extensions-smoke.spec.ts

# Debug mode
npx playwright test --debug

# Show report
pnpm run test:e2e:report

# Workspace provider tests (OpenShell; not PR smoke)
pnpm run test:e2e:workspaces:run

See workspace-provider-e2e.md for sandbox matrix structure, tags, env vars, and coverage notes.

Conditional Test Skipping

typescript
// Skip based on resource type
test.skip(resource === 'ollama', 'Flows not supported for Ollama');

// Skip based on available data
if (modelCount < 2) {
  test.skip(true, 'Skipping test: Less than 2 models available');
  return;
}

// Skip based on environment
test.skip(!hasGithubToken, 'GITHUB_TOKEN not set');
test.skip(isLinux, 'safeStorage issues on Linux');

// Mark as expected failure
if (!isCI) {
  test.fail();
}

// Mark as slow (3x timeout)
test.slow();

Artifact Capture

On test failure, saveTestArtifacts() automatically captures:

  • Trace: trace.zip — full Playwright trace with screenshots, snapshots, and sources
  • Screenshot: failure.png — full-page screenshot at failure point
  • Video: video.webm — recording of the test run

© openkaiden, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files in .agents/skills/playwright-testing of openkaiden/kaiden.

  • SKILL.md
  • examples.md
  • reference.md
  • workspace-provider-e2e.md

Open the folder on GitHubat commit 5a3f5af

Compare with similar skills

Playwright Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Playwright Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Testing this skillopenkaiden/kaiden110—~3kAutomated safety check: PassApache-2.0
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
playwright-cli Browser Automationgithub/gh-aw5.3k23 repos~2.8kAutomated safety check: PassMIT
Write and Verify Playwright Testsappsmithorg/appsmith41k—~2.9kAutomated safety check: NotesApache-2.0
Cucumber and Playwright E2E Testslanggenius/dify158k—~682Automated safety check: PassCustom licence
E2E Testinglangflow-ai/langflow156k—~3.3kAutomated safety check: PassMIT

Similar skills

  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Official

    Drives a real browser from the command line with playwright-cli to open pages, interact, mock requests, save state and work with Playwright tests.

    5.3k GitHub starsUsed in 23 repos~2.8k tokens
    Testing & QAAuto-check passed
  • Writes a Playwright end-to-end test from a prompt, runs it against a live Appsmith deployment and retries with fixes up to three times until it passes.

    41k GitHub stars~2.9k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Guides changes and reviews of the Cucumber and Playwright end-to-end suite under `e2e/`: feature files, step definitions, support code, tags, locators and assertions.

    158k GitHub stars~682 tokensUpdated today
    Testing & QAAuto-check passed
  • E2E Testing

    langflow-ai/langflow

    Write and review Playwright E2E tests for Langflow. An agent skill from langflow-ai/langflow.

    156k GitHub stars~3.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Handsontable Playwright E2E Tests

    handsontable/handsontable

    Guides writing and changing Playwright end-to-end tests for Handsontable using page objects, data-testid hooks and deterministic waits.

    22k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed

More from openkaiden/kaiden

  • Create GitHub Issue

    openkaiden/kaiden

    Create GitHub issues using the gh CLI. An agent skill from openkaiden/kaiden.

    110 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • UI Components

    openkaiden/kaiden

    UI Component Development Guide for Kaiden. An agent skill from openkaiden/kaiden.

    110 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Playwright Testing

What does Playwright Testing do?

Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern. Playwright Testing is an agent skill from openkaiden/kaiden. Guide for writing, organizing, and maintaining Playwright end-to-end tests using the Page Object Model pattern.

When should I use Playwright Testing?

Playwright Testing fits situations like: tasks that involve Browser testing; tasks that involve End-to-end testing.

How do I install Playwright Testing in Claude Code?

Run `npx skills add openkaiden/kaiden --skill playwright-testing -a claude-code`. Or copy the skill folder (.agents/skills/playwright-testing in openkaiden/kaiden) into .claude/skills/playwright-testing in your project. Claude Code loads it when a task matches its description.

How do I install Playwright Testing in Codex?

Run `npx skills add openkaiden/kaiden --skill playwright-testing -a codex`. Or copy the skill folder (.agents/skills/playwright-testing in openkaiden/kaiden) into .agents/skills/playwright-testing in your project. Codex loads it when a task matches its description.

Can I use Playwright Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openkaiden/kaiden --skill playwright-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/playwright-testing, .gemini/skills/playwright-testing, .github/skills/playwright-testing and .opencode/skills/playwright-testing in your project.

What does Playwright Testing need to run?

Going by SKILL.md and its folder, Playwright Testing needs the command-line tools its instructions call (pnpm and npx) and credentials named GEMINI_API_KEY, OPENAI_API_KEY and GITHUB_TOKEN. Our summary lists: Node.js; A credential in GEMINI_API_KEY; A credential in OPENAI_API_KEY.

Does Playwright Testing access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Playwright Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Playwright Testing use?

Playwright Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Testing use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Playwright Testing?

Skills that share tags, products or a category with Playwright Testing: Web Application Testing (anthropics/skills, 180k stars), playwright-cli Browser Automation (github/gh-aw, 5.3k stars), Write and Verify Playwright Tests (appsmithorg/appsmith, 41k stars) and Cucumber and Playwright E2E Tests (langgenius/dify, 158k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Testing?

openkaiden (a GitHub organization) maintains it in openkaiden/kaiden, which has 110 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.

Source: openkaiden/kaiden on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.