# Automate Browser Testing with Patchright

Local web apps need visual checks after every change. This skill drives Patchright browser sessions for screenshots, navigation, form input, and UI verification.

## Install

```bash
npx skillstore add smallnest/patchright-skill
```

## Metadata

- Status: approved
- Slug: smallnest-patchright-skill
- Skillstore revision: r1
- Version status: missing
- Tree hash: 21d5bdb63ad7a3009fc9a849bea3e2d6d0ff76e81203906e99268d9f99f49242
- Author: smallnest
- GitHub username: smallnest
- License: See LICENSE.txt
- Repository: https://github.com/smallnest/patchright-skill/tree/main/
- Ref: 3e4b6c31a74a3bd1a291c98cf585d720cb9fbc88
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/smallnest-patchright-skill
- Manifest: https://skillstore.pages.dev/api/skills/smallnest-patchright-skill/manifest

## Capabilities

- Launch Chrome through Patchright for browser automation tasks.
- Navigate to localhost, loopback, private network, and external URLs.
- Capture viewport or full-page screenshots to local files.
- Click elements, fill fields, wait for selectors, and read page text.
- Keep a browser session alive through a local helper server.
- Run browser-context JavaScript through the server evaluate tool.

## Use Cases

- Check a local UI change: Open a development server, inspect the rendered page, and capture screenshots after code edits.
- Validate a user flow: Run a repeatable browser flow that fills forms, clicks controls, waits for content, and records page state.
- Verify a preview build: Exercise a private preview URL and collect visual evidence before approving a deployment.

## Prompt Templates

### Capture a Local Page

```
Open my local app on port 3000, capture the home page, and tell me the page title and screenshot path.
```

### Test a Login Flow

```
Navigate to the local login page, enter test credentials, submit the form, and capture the result page.
```

### Debug Dynamic Content

```
Open the app, wait for the dashboard content, read the visible status text, and capture a full-page screenshot.
```

### Run a Multi-Step Review

```
Start a persistent browser session, walk through the main navigation, record each page title, and save screenshots for every step.
```

## Limitations

- Requires Python dependencies and Google Chrome on the host machine.
- The helper server must be started before persistent workflows work.
- Browser automation can expose page content visible in the session.
- Use on third-party sites requires clear authorization and policy review.

## Best Practices

- Use test accounts and non-sensitive data during browser automation.
- Stop the helper server when the workflow is complete.
- Keep screenshots in a dedicated review folder with clear names.

## Anti Patterns

- Do not use the skill to bypass access controls on sites you do not own.
- Do not leave the local browser server running after a task ends.
- Do not store screenshots of sensitive user data in shared folders.

## Security Audit

- Audited at: 2026-07-09T08:01:26.273\+00:00
- Summary: Most static findings are scanner noise from markdown fences, localhost examples, prior audit prose, and local debug output paths. Semantic review found real high-risk design issues: anti-bot bypass capability, an unauthenticated local browser control server, unrestricted screenshot output paths, and bundled self-attesting audit claims. The skill should require remediation and policy review before marketplace publication.

## Stats

- Views: 202
- Downloads: 14
- Favorites: 0
- Popularity score: 0
