Skill library

Agent skill Review & testing

Webapp Testing

Exercise local web interfaces with Playwright, inspect interactions and screenshots, and diagnose browser behavior.

  • Playwright
  • Testing
  • Browser

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add anthropics/skills --skill webapp-testing --agent claude-code --yes

Check this file in your project.claude/skills/webapp-testing/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add anthropics/skills --skill webapp-testing

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use npm and npx to install the Skill. To run its browser checks, use a separate Python 3 environment with the Playwright package and Chromium installed, plus a reachable local app and test data.

View operation manual

What this skill helps with

  • Exercise local web interfaces with Playwright.
  • Capture screenshots and inspect browser logs.
  • Reproduce interaction problems and verify user flows.

Good for

  • Checking local UI changes
  • Reproducing frontend interaction bugs
Official entry
Anthropic’s webapp-testing/SKILL.md.
Browser runtime
Synchronous Python Playwright with headless Chromium.
Server startup
Reuse a running local app or wrap your start command with scripts/with_server.py.
Test evidence
Repeatable steps, assertion results, screenshots, and logs.
Skill name
webapp-testing

Wait for the state you need to test

An early screenshot

Open my settings page, wait a second, click Save, and screenshot it.

The form may still be loading. A success message alone can also miss a save that disappears after reload.

A check against the expected behavior

  1. Wait for the test record’s current value and the form controls.
  2. Submit the change and verify the app’s success state.
  3. Reload and assert that the test value is still there.

Webapp Testing operation manual

Use Anthropic’s Webapp Testing skill to check a settings form after a change or review the same local page at phone and desktop widths. Both walkthroughs use Python Playwright and record what the browser actually shows.

Use a disposable profile to check whether its display name saves and survives a reload.

  1. Confirm the local app and test profile

    Identify the settings route, a disposable profile, and the way the page signals a completed save. Reuse a running app or start it with the project’s own command.

    • Use the installed helper’s absolute path and the read-only inspect_form.py created in this step. Replace both paths, the start command, and the port. For step 3, use your save test script as the child command.
    • Run the commands with the Python environment that has Playwright and Chromium. The wrapper waits for a TCP port to open. The browser check still needs a page-ready assertion.
    • The local route opens with a disposable test profile.
    • The save confirmation and expected persisted value are clear.
    Prompt · Step 1
    Use the installed webapp-testing skill to prepare a browser check for the display-name field on my local profile settings page. Find the project’s local run instructions, settings URL, test profile, and the expected save behavior. Use a disposable local profile for the write. If the target or test profile is unclear, ask for that detail before changing any data.
    
    Write a temporary read-only inspect_form.py that opens the URL in headless Chromium and asserts the expected local app and test profile. Reuse an already-running local server when it serves that app. When starting a new one with scripts/with_server.py, read --help and configure the project start command and --port to use the same free port. Run inspect_form.py as the child command after --. Verify that processes started for this check have exited when finished. Report the full URL, the test record, the Python interpreter, and the app indication you’ll check after Save. Keep the test script and its evidence in a writable temporary folder.
    python "[absolute path to with_server.py]" --help
    python "[absolute path to with_server.py]" --server "[project start command configured for port 5173]" --port 5173 -- python "[absolute path to inspect_form.py]"
  2. Inspect the rendered form

    Wait until the test profile has loaded. Find the input by its label and the action by its accessible role and name.

    • The locators each resolve to the intended control.
    • The readiness check confirms the form has loaded the test record.
    Prompt · Step 2
    Use webapp-testing and Python Playwright to inspect the local profile settings route from the setup step. Launch headless Chromium. Wait for the expected test profile and its original display name to show in the form. Use a page-specific Playwright assertion to establish that state.
    
    Identify the field and Save button from the rendered page, preferably with get_by_label and get_by_role. Scope the locators to the correct form. If a label is absent, use a stable field name or an existing test ID. Register console and page-error listeners before navigation for this inspection and repeat the setup in each later script that collects logs. Report the readiness check and locators that matched.
  3. Save a test value and reload

    Run the Python script against the live route, then check the persisted display name after a fresh page load.

    • The test verifies both save confirmation and persistence after reload.
    • The report includes the script’s location and any captured evidence.
    Prompt · Step 3
    Use webapp-testing to run the confirmed display-name regression check against my local app. Create a temporary check_save.py using synchronous Python Playwright and the verified locators. Register console and page-error listeners before navigating. Confirm the disposable test profile and capture its original value. Use a different test value, click Save, and assert the expected confirmation state.
    
    Reload and assert that the field contains the new value once the record loads. If the app promises server-side storage, verify the same record in a fresh context signed in to the test account, or by using the app’s supported persisted read. A reload in the original context alone only establishes that the value is still visible there. Capture the first failure and relevant logs. If a save might have occurred, restore the original value or use the supported reset in a finally block before closing, and report whether cleanup was verified. Give me the exact rerun command and the paths to any evidence.
  4. Record the first point of failure

    Report where the actual behavior diverges from the expected behavior. Include enough context for someone else to rerun it.

    Prompt · Step 4
    Summarize the webapp-testing browser run for the local profile form. For each check, give the observed outcome and its status: passed, failed, or blocked. For a failure, give the URL, test profile, ordered steps, expected outcome, first observed difference, and path to the screenshot or relevant log. Report what was checked after reload, any evidence from a fresh context or persisted read, and whether the test profile was restored.
    
    Include the command to rerun the temporary test. If the browser or an assertion could not run, name the blocker and the exact point reached. Keep this to test evidence and the regression report.

Find the right browser check

Use the bundled helper and examples for the part of the workflow that needs attention.

The front end and API start separatelyLocal servers
Command or reference
scripts/with_server.py --help
Examples
Repeat --server and --port once per process in matching order. Configure each start command for its port. Put your Python command after -- and use --timeout for a per-server startup limit in seconds.
A button or field locator keeps missingLocators
Command or reference
examples/element_discovery.py
Examples
Inspect the rendered controls after confirming that the expected data has appeared. Look for a stable form label, accessible button name, or existing test ID.
A click fails with little visible feedbackBrowser logs
Command or reference
examples/console_logging.py
Examples
Register the console listener before navigation and save the messages from the failing run alongside the screenshot.
The page is a standalone HTML fileStatic HTML
Command or reference
examples/static_html_automation.py
Examples
Use the file’s absolute path as a file URL and choose a writable screenshot directory. Use a local server if the page depends on HTTP routes.

Webapp Testing troubleshooting

Why can’t Python import Playwright or launch Chromium?

Skills CLI installs the Skill files. In an activated Python 3 virtual environment, install the Playwright library and its Chromium browser. Use that interpreter for the check and when invoking the helper.

python -m pip install playwright
python -m playwright install chromium
Why does the wrapper say ready while the page is loading?

with_server.py waits for the local port to accept a TCP connection. After navigation, assert that the record, field value, or other page-specific state you need has appeared before interacting or taking a screenshot.

Why does networkidle time out on my dashboard?

Anthropic’s examples use networkidle before inspecting the rendered page. Polling can keep that wait pending, and Playwright recommends web assertions for readiness. Wait for the specific content you expect, such as the loaded test record or the enabled Save control.