Agent skill

Write and Verify Playwright Tests

by appsmithorg in appsmithorg/appsmith

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.

Apache-2.0Auto-check: notesTesting & QA

Install Write and Verify Playwright Tests

skills CLI
$ npx skills add appsmithorg/appsmith --skill write-and-verify-pw-test -a claude-code

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

GitHub CLI
$ gh skill install appsmithorg/appsmith write-and-verify-pw-test --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/appsmithorg/appsmith.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/write-and-verify-pw-test .claude/skills/write-and-verify-pw-test && 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
write-and-verify-pw-test
GitHub stars
41k
Token cost
~2.9k tokens
SKILL.md length
1,136 words
Files
2 (incl. scripts)
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

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.

  • Works in 8 steps: Configure Environment → Read Project Conventions → Determine Placement → …
  • Writing a new Playwright end-to-end test for an Appsmith feature
  • SKILL.md covers Prerequisites, Step 1 — Configure Environment, Step 2 — Read Project… and Step 3 — Determine Placement, plus 5 more sections
  • Runs JavaScript scripts from its folder; calls npx and node; reaches target-dp.appsmith.com; needs GITEA_API_TOKEN

What it does

The agent first makes sure Chromium is available for Playwright, then runs a configure-env.js script that creates or merges the app/client/playwright/.env file. The script takes only the variables you supply, such as the target deployment URL, login credentials, a datasource host, Gitea settings for git tests and JSON feature-flag overrides, and keeps existing values for everything else. The skill is tied to the Appsmith repository layout and to a deployment that is actually running.

Before writing a spec it reads the project's Playwright conventions. Imports come from the local fixtures instead of @playwright/test, locators prefer getByRole, then getByLabel, then getByTestId, then shared selector constants, never raw CSS. Hard waits and networkidle are out, assertions must auto-retry, API paths, selectors and routes come from constants, and page objects take a Page, hold no assertions and keep methods short. Before any API request it greps the server controller for exact parameter names. It then decides where the test belongs, writes the spec, runs it and auto-fixes failures up to three times.

When your agent uses it

  • Writing a new Playwright end-to-end test for an Appsmith feature
  • Verifying a user flow against a deployed Appsmith instance
  • Creating a spec that follows the project's page object and selector conventions

Example prompts

  • “Write a Playwright test for creating a REST API datasource and verify it on our deployment.”
  • “Create and run an e2e test for query editor autocomplete against https://target-dp.appsmith.com.”
  • “Verify the app export flow with Playwright and fix the spec if it fails.”

Requirements

  • The Appsmith repository with its app/client folder
  • Chromium installed through Playwright
  • A live Appsmith deployment URL and login credentials
  • Node.js

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Configure Environment
  2. Read Project Conventions
  3. Determine Placement
  4. Write the Spec
  5. Lint Check
  6. Run the Test
  7. Retry Loop (max 3 attempts)
  8. Summary

What it can do on your machine

Read from SKILL.md and the folder at commit 552488b. 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

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npx
    • node

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • target-dp.appsmith.com

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

  • Credentials

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

    • GITEA_API_TOKEN

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

Context cost

Write and Verify Playwright Tests loads about 2.9k tokens when it runs. Until then it costs about 97 tokens; SKILL.md has 1,136 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:23
    script to set up `app/client/playwright/.env`. It creates the file if missing and merges new values with any existing o
  • NoteMentions a .env fileSKILL.md:37
    | `USERNAME` | If no `.env` exists | Login credentials |
  • NoteMentions a .env fileSKILL.md:38
    | `PASSWORD` | If no `.env` exists | Login credentials |
  • NoteMentions a .env fileSKILL.md:45
    `PW_FLAG_OVERRIDES` can go in `.env` via the script, or be passed inline when running tests (see Step 6).

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); the scripts in this folder are not scanned.

SKILL.md

The full file from appsmithorg/appsmith at commit 552488b, republished under its Apache-2.0 licence (© appsmithorg). 1,136 words, ~2,914 tokens.

Download SKILL.mdSave it as .claude/skills/write-and-verify-pw-test/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
write-and-verify-pw-test
description
Write a Playwright E2E test from a prompt and verify it passes against a live Appsmith deployment. Configures environment variables, writes the spec following project conventions, runs it, and auto-fixes up to 3 times. Use when asked to "write a playwright test", "test this feature on a dp", "create and run an e2e test", or "verify this flow with playwright".

Write & Verify Playwright Test

Prerequisites

Before starting, ensure Chromium is available:

bash
cd app/client && npx playwright install chromium 2>/dev/null

Step 1 — Configure Environment

Run the configure-env.sh script to set up app/client/playwright/.env. It creates the file if missing and merges new values with any existing ones.

bash
node .cursor/skills/write-and-verify-pw-test/scripts/configure-env.js \
  --PLAYWRIGHT_BASE_URL=https://target-dp.appsmith.com \
  --USERNAME=user@example.com \
  --PASSWORD=secret

Pass only the variables the caller provided. The script preserves existing values for anything not overridden. Supported variables:

VariableRequiredNotes
PLAYWRIGHT_BASE_URLYesTarget deployment URL
USERNAMEIf no .env existsLogin credentials
PASSWORDIf no .env existsLogin credentials
DATASOURCE_HOSTNoFor datasource tests
GITEA_BASE_URLNoFor git tests
GITEA_API_TOKENNoFor git tests
GIT_CLONE_URLNoFor git tests
PW_FLAG_OVERRIDESNoJSON string, e.g. '{"flag": true}'

PW_FLAG_OVERRIDES can go in .env via the script, or be passed inline when running tests (see Step 6).

Step 2 — Read Project Conventions

Before writing any spec, read these files for conventions (they are auto-applied when editing playwright/**/*.ts, but read them explicitly here):

  • .cursor/rules/playwright.mdc — full conventions (POM rules, selectors, assertions, wait strategy)

Key rules to internalize:

  1. Imports: import { test, expect } from "../../fixtures" (not @playwright/test)
  2. Selectors: Use getByRole() > getByLabel() > getByTestId() > SELECTORS from constants. Never raw CSS.
  3. No hard waits: No waitForTimeout, no networkidle. Wait for meaningful elements.
  4. Auto-retrying assertions: await expect(locator).toBeVisible(), not expect(await locator.isVisible()).toBe(true)
  5. Constants: API paths from playwright/constants/api-routes.ts, selectors from playwright/constants/selectors.ts, routes from playwright/constants/routes.ts. Never hardcode.
  6. POMs: Constructor takes Page. No assertions in POMs. 1-5 lines per method.
  7. API contract verification: Before any request.get/request.post, grep the server for the controller to confirm exact parameter names.

Step 3 — Determine Placement

Pick the tier
TierDirectoryWhen
smokeplaywright/tests/smoke/Login, create app, basic alive checks
sanityplaywright/tests/sanity/<feature>/Core flows for a feature area
regressionplaywright/tests/regression/<feature>/Edge cases, complex interactions
eeplaywright/tests/ee/{sanity,regression}/<feature>/EE-only features

If the caller specifies a tier, use it. Otherwise, default to sanity.

Feature subdirectories are mandatory under sanity/ and regression/.

Decide: existing project, new project, or multiple specs

Read playwright.config.ts to understand the current projects and their setup chains.

Use an existing project when the new spec:

  • Lives in a directory already covered by a project's testDir
  • Doesn't need setup beyond what that project's dependency chain provides
  • Example: a new widget test at tests/sanity/widgets/chart.spec.ts → use the sanity project

Create a new project when the new spec:

  • Needs an expensive shared precondition not covered by existing setups (e.g., importing an app via API, connecting a specific datasource, seeding test data)
  • Would slow down unrelated tests if its setup ran in a shared project
  • Follow the setup/teardown/state-reader pattern from playwright.mdc (Parallelization section):
    1. Setup file in playwright/fixtures/<name>.setup.ts — performs the operation, writes state to playwright/.state/<name>.json
    2. Teardown file in playwright/fixtures/<name>.teardown.ts — cleans up
    3. State reader in playwright/helpers/<name>-state.ts — typed accessor for test files
    4. New project entry in playwright.config.ts with dependencies, testDir, and teardown

Split into multiple spec files when:

  • The prompt describes multiple independent pages or concerns — one spec per page/concern
  • Tests within a shared-setup project should be parallelizable — each file runs independently, reads shared state, navigates directly to its target
  • A single spec would exceed ~10 tests — split by sub-feature
  • Example: Git migration tests are split into migration-mysql.spec.ts, migration-postgres.spec.ts, migration-modal-form.spec.ts — all under regression/git/, all share the migration-setup project, each focused on one page

Rule of thumb: One test.describe per spec file, one concern per test(). If the prompt covers multiple concerns, prefer multiple small specs over one large one.

Step 4 — Write the Spec

Write the spec file following these patterns. Reference existing examples:

Simple spec (smoke-level):

typescript
import { test, expect } from "../../fixtures";
import { ROUTES } from "../../constants/routes";

test.describe("Smoke — Feature Name", () => {
  test("behavior description in lowercase", async ({ page }) => {
    await page.goto(ROUTES.applications);
    await expect(page.getByRole("button", { name: /new/i })).toBeVisible();
  });
});

Spec with fixture workspace/app (sanity/regression):

typescript
import { test, expect } from "../../fixtures";
import { SELECTORS } from "../../constants/selectors";

test.describe("Feature — Specific Area", () => {
  test("filters table by country", async ({ page, app }) => {
    await page.goto(app.url);
    await expect(page.locator(SELECTORS.widgetInDeployed("textwidget")).first()).toBeVisible();
    // test logic here
  });
});

If a POM is needed, create it under playwright/page-objects/ (or components/ for reusable widgets). Follow existing patterns like home.page.ts.

Step 5 — Lint Check

After writing each file, run:

bash
cd app/client && npx eslint <spec-file-path> --ext .ts

Fix any issues before proceeding.

Step 6 — Run the Test

Auth chain (automatic — do not skip)

The config chains setup projects: signup-setup → setup → your test project. This handles fresh deployments automatically:

  • signup-setup: Creates the user if needed (handles empty instance onboarding, legacy signup, and "already exists" gracefully)
  • setup: Logs in and saves auth state to playwright/auth/user.json
  • test project: Runs your specs with the saved auth state

This chain runs automatically when you use --project. Never bypass it by running test files directly without a project flag.

Show full SKILL.md (450 more words)Show less
Determine the correct project

Critical: Each project in playwright.config.ts has its own testDir, dependencies, and sometimes testIgnore. The spec must be run under the project whose testDir matches and whose dependency chain includes the required setup.

Read playwright.config.ts and match your spec's directory to a project. Current mapping:

Spec directory--project flagSetup chain
tests/smoke/smokesignup → auth
tests/sanity/sanitysignup → auth
tests/regression/ (non-git)regressionsignup → auth
tests/regression/git/regression-gitsignup → auth → migration-setup (+ teardown)

Why this matters: Some projects have extra setup phases (e.g., regression-git depends on migration-setup which imports a Git app and creates datasources). Specs in those directories read shared state produced by the setup (e.g., loadMigrationState()). Running them under the wrong project skips that setup and they fail immediately.

When writing a new spec that needs a custom setup project (e.g., it relies on pre-imported data, a connected datasource, or shared app state):

  1. Check if an existing setup project covers the need
  2. If not, create a new setup/teardown pair following the pattern in playwright.mdc (Parallelization section)
  3. Add the new project to playwright.config.ts with proper dependencies and testDir
  4. Update this mapping table

If the config has changed since this skill was written, always read playwright.config.ts to get the current project list. Don't rely on this table alone.

Run command
bash
cd app/client && npx playwright test <spec-file-path> --project=<project>

If PW_FLAG_OVERRIDES was provided:

bash
cd app/client && PW_FLAG_OVERRIDES='{"flag_name": true}' npx playwright test <spec-file-path> --project=<project>

Timeout: Set block_until_ms to at least 120000 (2 min). Tests can take 60s+ with signup + auth setup on first run against a fresh deployment.

Step 7 — Retry Loop (max 3 attempts)

If the test fails, classify the failure:

Test bug signals (fix the spec):
  • locator.click: Target closed → wrong selector or premature navigation
  • Timeout + element exists in DOM but not visible → missing wait or wrong locator
  • strict mode violation → locator matches multiple elements, needs .first() or refinement
  • Error: expect(received).toHaveText(expected) where expected value is clearly wrong → bad test data
  • Import errors, TypeScript errors → code issue in the spec
  • waiting for locator → selector doesn't match anything, check the actual page

Action: Read the error output, fix the spec, re-run. This is attempt N+1.

Product bug signals (stop and diagnose):
  • expect(received).toHaveText(expected) where expected is correct but received shows clearly wrong app behavior
  • net::ERR_CONNECTION_REFUSED → deployment is down
  • 401 / 403 after successful auth setup → permission regression
  • Visual mismatch where the test selector is correct but the UI renders wrong content
  • Server returns 500 on API calls

Action: Stop retrying. Switch to the diagnose-pw-failure skill. See .cursor/skills/diagnose-pw-failure/SKILL.md.

Ambiguous failures:

Default to "fix the spec" for the first 2 attempts. If the same assertion fails 3 times with the same received value, it's likely a product bug — switch to diagnosis.

Step 8 — Summary

After the test passes (or after exhausting retries), provide a summary:

On success:

## Playwright Test Result: PASS

**Spec**: playwright/tests/sanity/widgets/table-filter.spec.ts
**Deployment**: https://my-dp.appsmith.com
**Project**: sanity
**Attempts**: 2 (1 fix applied: wrong selector for filter button)

### What was tested
- Table widget renders with data
- Filtering by country "Ba" shows Bangladesh

On failure (product bug):

## Playwright Test Result: FAIL (product bug suspected)

**Spec**: playwright/tests/sanity/widgets/table-filter.spec.ts
**Deployment**: https://my-dp.appsmith.com
**Attempts**: 3 (spec verified correct)

### Failure
- Table filter returns empty results when filtering by "Ba"
- Expected: rows containing "Bangladesh"
- Received: 0 rows
- Screenshot: playwright/results/<test-name>/screenshot.png

### Diagnosis
[See diagnose-pw-failure output]

© appsmithorg, 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 1 other file (scripts) in .cursor/skills/write-and-verify-pw-test of appsmithorg/appsmith.

  • SKILL.md
  • scripts/configure-env.js

Open the folder on GitHubat commit 552488b

Compare with similar skills

Write and Verify Playwright Tests 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.

Write and Verify Playwright Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write and Verify Playwright Tests this skillappsmithorg/appsmith41k—~2.9kAutomated safety check: NotesApache-2.0
Dev Webtest Planclassmethod/tsumiki974—~4.2kAutomated safety check: PassMIT
Record E2E Giflablup/backend.ai-webui133—~907Automated safety check: NotesLGPL-3.0
Replica TestJakeschincariol/replica-skill908—~819Automated safety check: PassMIT
Playwright Testingaehrc/pathling137—~1.5kAutomated safety check: PassApache-2.0
Senior QAalirezarezvani/claude-skills28k1 repos~2.1kAutomated safety check: PassMIT

Similar skills

  • Dev Webtest Plan

    classmethod/tsumiki

    This skill should be used when the user asks to "dev-webtest-plan", "Webテスト計画を生成", "テスト計画を作成", "webtest plan", "E2Eテスト計画", "画面テスト計画", "generate webtest plan", "create test plan from requirements"…

    974 GitHub stars~4.2k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Record E2E Gif

    lablup/backend.ai-webui

    Record Playwright e2e tests as one GIF per test case (video → ffmpeg palette GIF) and return a markdown table for a PR description.

    133 GitHub stars~907 tokensUpdated today
    Testing & QAAuto-check: notes
  • Replica Test

    Jakeschincariol/replica-skill

    Clicks through every flow of an app clone and tests it for bugs: a test plan generated from the recon flows with happy paths and edge cases, Playwright end-to-end tests where possible, a browser…

    908 GitHub stars~819 tokensUpdated 5 days ago
    Testing & QAAuto-check passed
  • Playwright Testing

    aehrc/pathling

    Expert guidance for writing end-to-end tests with Playwright Test framework.

    137 GitHub stars~1.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Senior QA

    alirezarezvani/claude-skills

    Generates unit tests, integration tests, and E2E tests for React/Next.js applications.

    28k GitHub starsUsed in 1 repo~2.1k tokens
    Testing & QAAuto-check passed
  • Generate

    alirezarezvani/claude-skills

    Generate Playwright tests. An agent skill from alirezarezvani/claude-skills.

    28k GitHub starsUsed in 1 repo~1.1k tokens
    Testing & QAAuto-check passed

More from appsmithorg/appsmith

  • Investigates a stubbornly failing Playwright test as a possible product bug, using error output, screenshots, traces and server code, and writes a structured bug report.

    41k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Fix Failing Playwright Spec

    appsmithorg/appsmith

    Fixes failing Playwright specs by reading the error, classifying the cause in the test code and applying corrections that follow project conventions.

    41k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Write and Verify Playwright Tests

What does Write and Verify Playwright Tests do?

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. env file. The script takes only the variables you supply, such as the target deployment URL, login credentials, a datasource host, Gitea settings for git tests and JSON feature-flag overrides, and keeps existing values for everything else.

When should I use Write and Verify Playwright Tests?

Write and Verify Playwright Tests fits situations like: writing a new Playwright end-to-end test for an Appsmith feature; verifying a user flow against a deployed Appsmith instance; creating a spec that follows the project's page object and selector conventions.

How do I install Write and Verify Playwright Tests in Claude Code?

Run `npx skills add appsmithorg/appsmith --skill write-and-verify-pw-test -a claude-code`. Or copy the skill folder (.cursor/skills/write-and-verify-pw-test in appsmithorg/appsmith) into .claude/skills/write-and-verify-pw-test in your project. Claude Code loads it when a task matches its description.

How do I install Write and Verify Playwright Tests in Codex?

Run `npx skills add appsmithorg/appsmith --skill write-and-verify-pw-test -a codex`. Or copy the skill folder (.cursor/skills/write-and-verify-pw-test in appsmithorg/appsmith) into .agents/skills/write-and-verify-pw-test in your project. Codex loads it when a task matches its description.

Can I use Write and Verify Playwright Tests 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 appsmithorg/appsmith --skill write-and-verify-pw-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-and-verify-pw-test, .gemini/skills/write-and-verify-pw-test, .github/skills/write-and-verify-pw-test and .opencode/skills/write-and-verify-pw-test in your project.

What does Write and Verify Playwright Tests need to run?

Going by SKILL.md and its folder, Write and Verify Playwright Tests needs JavaScript for the scripts in its folder, the command-line tools its instructions call (npx and node) and credentials named GITEA_API_TOKEN. Our summary lists: The Appsmith repository with its app/client folder; Chromium installed through Playwright; A live Appsmith deployment URL and login credentials; Node.js.

Does Write and Verify Playwright Tests access the network?

SKILL.md names 1 domain. In commands or code: target-dp.appsmith.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Write and Verify Playwright Tests safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Write and Verify Playwright Tests use?

Write and Verify Playwright Tests 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 Write and Verify Playwright Tests use?

About 2.9k 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 Write and Verify Playwright Tests?

Skills that share tags, products or a category with Write and Verify Playwright Tests: Dev Webtest Plan (classmethod/tsumiki, 974 stars), Record E2E Gif (lablup/backend.ai-webui, 133 stars), Replica Test (Jakeschincariol/replica-skill, 908 stars) and Playwright Testing (aehrc/pathling, 137 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write and Verify Playwright Tests?

appsmithorg (a GitHub organization) maintains it in appsmithorg/appsmith, which has 41,030 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 8, 2026.

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