# Playwriter

Browser automation via Playwriter (remorses) using persistent Chrome sessions and the...

- Repository: https://github.com/mikeyobrien/ralph-orchestrator (3190 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -g -a claude-code -y`
Codex: `npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -g -a codex -y`
Cursor: `npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -g -a cursor -y`
Gemini CLI: `npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add mikeyobrien/ralph-orchestrator`

## Description

Browser automation via Playwriter (remorses) using persistent Chrome sessions and the full Playwright Page API.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Playwriter

## Overview

Use Playwriter to run Playwright Page scripts against your local Chrome session. This preserves logins, cookies, and extensions, which is ideal for web dashboard testing and authenticated flows.

## When to Use

- Validating the Ralph web dashboard UI
- Navigating authenticated pages without re-logging in
- Testing flows that require browser extensions or saved state
- Capturing accessibility snapshots for element discovery

## Prerequisites

- Install the CLI:
  ```bash
  npm i -g playwriter
  ```
- Install the Playwriter Chrome extension (see the Playwriter repo instructions)
- Ensure Chrome is running and the extension is enabled

## Core Workflow

1. Create a session:
   ```bash
   playwriter session new
   ```
2. List sessions and copy the session id:
   ```bash
   playwriter session list
   ```
3. Execute Playwright code against that session:
   ```bash
   playwriter -s <session_id> -e "await page.goto('https://example.com')"
   ```

## Execution Environment

Within `-e`, these are available in scope:
- `page` (Playwright Page)
- `context` (BrowserContext)
- `state` (persistent object across calls in the same session)
- `require` (for loading helper modules)

Example state persistence:
```bash
playwriter -s <session_id> -e "state.lastUrl = page.url()"
playwriter -s <session_id> -e "console.log(state.lastUrl)"
```

## Common Patterns

### Navigate + click
```bash
playwriter -s <session_id> -e "await page.goto('http://localhost:3000'); await page.getByRole('button', { name: 'Run' }).click();"
```

### Fill forms
```bash
playwriter -s <session_id> -e "await page.getByLabel('Email').fill('qa@example.com'); await page.getByLabel('Password').fill('secret'); await page.getByRole('button', { name: 'Sign in' }).click();"
```

The rest: https://github.com/mikeyobrien/ralph-orchestrator/blob/HEAD/.claude/skills/playwriter/SKILL.md
