agentleFS
LucfaceLucface/claude-skills/skills/webapp-testing/SKILL.md

webapp-testing

Skill1 starsChanged 3 days agoMITView on GitHub

Provides Playwright patterns and best practices for web application testing. Covers DOM inspection, screenshot capture, form interaction, and API mocking. Works with the Playwright plugin for browser automation.

197 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use academy-guide, skill-share and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    academy-guide

    Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

    Also in 8 projects that use this

  • ArogyaReddySkill

    skill-share

    A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.

    Also in 23 projects that use this

  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 5 projects that use this

  • ArogyaReddySkill

    raffle-winner-picker

    Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

    Also in 26 projects that use this

  • zephyrwang6Skill

    topic-collector

    AI热点采集工具。从Twitter/X、Product Hunt、Reddit、Hacker News、博客等采集AI相关热点内容。当用户说"开始今日选题"、"采集热点"、"看看今天有什么新闻"、"今日AI热点"时触发。聚焦领域:Vibe Coding、Claude Skill、AI知识管理、AI模型更新、AI新产品、海外热点。

    Also in 4 projects that use this

  • zephyrwang6Skill

    deepl

    Übersetzt Texte, Dokumente und XLIFF-Dateien via DeepL API. Verwende für Übersetzungen mit /deepl translate, /deepl file oder /deepl xliff.

    Also in 4 projects that use this

  • +4 more from zephyrwang6
  • +1 more from ArogyaReddy

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 189 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test local web applications using browser automation.

    line 7
  2. Very specific:

    After snapshot, each element gets a unique ref (@e1, @e2):

    line 55
  3. Distinctive:

    Deterministic: No CSS selector guessing

    line 56
  4. Distinctive:

    Fast: No DOM re-querying

    line 57

“Common” is measured: kept by at least 6 in 10 of the 189 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Application Testing

Test local web applications using browser automation.

Tool Selection

Use CaseToolWhy
AI agent browser interactionagent-browserAI-optimized refs, low token cost
Automated test suites (CI/CD)PlaywrightRich assertions, parallelization
PDF generation from HTMLPuppeteerSpecialized PDF APIs
Visual regression testingPlaywrightScreenshot comparison

Default: Use agent-browser for interactive testing, Playwright for test suites.

Decision Tree

  1. Is this AI-driven exploration or automated test suite?
    • AI exploration: Use agent-browser (refs system, AI-optimized)
    • Automated tests: Use Playwright (assertions, CI/CD)
  2. Is target static HTML or dynamic webapp?
    • Static: Direct page load and inspect
    • Dynamic: Use with_server.py helper for server lifecycle
  3. Do you need visual or programmatic testing?
    • Visual: Screenshots and visual comparison
    • Programmatic: DOM queries and assertions

Agent-Browser (AI Agent Testing)

Install globally: bun add -g agent-browser

Quick Start

# Navigate and get AI-optimized snapshot
agent-browser navigate "http://localhost:3000"
agent-browser snapshot

# Interact using refs from snapshot
agent-browser click @e3
agent-browser fill @e5 "test@example.com"
agent-browser snapshot  # Verify changes

The Refs Advantage

After snapshot, each element gets a unique ref (@e1, @e2):

  • Deterministic: No CSS selector guessing
  • Fast: No DOM re-querying
  • AI-friendly: LLMs parse refs reliably

Common Patterns

# Login flow
agent-browser navigate "http://localhost:3000/login"
agent-browser snapshot
agent-browser fill @e2 "user@example.com"
agent-browser fill @e3 "password123"
agent-browser click @e4
agent-browser wait-for "Dashboard"
agent-browser snapshot

# Form submission
agent-browser navigate "http://localhost:3000/contact"
agent-browser snapshot
agent-browser fill @e1 "John Doe"
agent-browser fill @e2 "john@example.com"
agent-browser type @e3 "Hello, this is my message"
agent-browser click @e4  # Submit button
agent-browser wait-for "Thank you"

See ~/.claude/context/agent-browser.md for full command reference.


Playwright (Automated Test Suites)

Setup

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

Basic Test Structure

import { test, expect } from '@playwright/test';

test('homepage loads correctly', async ({ page }) => {
  await page.goto('http://localhost:3000');

  // Wait for dynamic content
  await page.waitForLoadState('networkidle');

  // Check title
  await expect(page).toHaveTitle(/My App/);

  // Check element exists
  await expect(page.locator('h1')).toContainText('Welcome');
});

Critical Practice

Always wait for network idle on dynamic apps:

await page.waitForLoadState('networkidle');

This prevents testing incomplete page states caused by ongoing JavaScript execution.

Element Selection

// By text
await page.getByText('Submit').click();

// By role
await page.getByRole('button', { name: 'Submit' }).click();

// By test ID (recommended)
await page.getByTestId('submit-button').click();

// By CSS selector
await page.locator('.submit-btn').click();

// By placeholder
await page.getByPlaceholder('Enter email').fill('test@example.com');

Screenshots

// Full page
await page.screenshot({ path: 'screenshot.png', fullPage: true });

// Specific element
await page.locator('.header').screenshot({ path: 'header.png' });

// Hide elements
await page.screenshot({
  path: 'clean.png',
  mask: [page.locator('.ads')]
});

Form Interaction

// Fill form
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('secret123');

// Select dropdown
await page.getByLabel('Country').selectOption('US');

// Checkbox
await page.getByLabel('Remember me').check();

// Submit
await page.getByRole('button', { name: 'Sign In' }).click();

API Mocking

await page.route('**/api/users', async (route) => {
  await route.fulfill({
    status: 200,
    contentType: 'application/json',
    body: JSON.stringify([{ id: 1, name: 'Test User' }])
  });
});

Console Logging

page.on('console', msg => {
  console.log(`Browser console [${msg.type()}]: ${msg.text()}`);
});

page.on('pageerror', err => {
  console.error('Page error:', err.message);
});

Testing Dynamic Content

// Wait for element to appear
await page.waitForSelector('.loading', { state: 'hidden' });
await page.waitForSelector('.content', { state: 'visible' });

// Wait for specific text
await page.waitForFunction(() =>
  document.body.innerText.includes('Data loaded')
);

// Wait for network request
const responsePromise = page.waitForResponse('**/api/data');
await page.click('#load-button');
const response = await responsePromise;

Workflow Pattern

  1. Reconnaissance: Capture screenshots, inspect DOM
  2. Identify: Find selectors from rendered state
  3. Execute: Automate using discovered selectors
  4. Verify: Assert expected outcomes
// Reconnaissance
await page.screenshot({ path: 'before.png' });
console.log(await page.content());

// Find and interact
const buttons = await page.locator('button').all();
for (const btn of buttons) {
  console.log(await btn.textContent());
}

Source

Adapted from https://github.com/anthropics/skills (Apache-2.0, Copyright 2026 Anthropic, PBC.). Changed for this repo by Lucas Cooper-Bey in 2026: routes to agent-browser and Playwright and does not ship the upstream scripts and examples.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.