Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

test-browser

БесплатноБез исполняемых скриптовНе проверен

Run browser tests on pages affected by current PR or branch

ratacatот ratacat★ 60 звёзд на GitHub

Об этом скилле

Arguments

[PR number, branch name, or 'current' for current branch]

Browser Test Command

Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.

CRITICAL: Use agent-browser CLI Only

DO NOT use Chrome MCP tools (mcp__claude-in-chrome__*).

This command uses the agent-browser CLI exclusively. The agent-browser CLI is a Bash-based tool from Vercel that runs headless Chromium. It is NOT the same as Chrome browser automation via MCP.

If you find yourself calling mcp__claude-in-chrome__* tools, STOP. Use agent-browser Bash commands instead.

Introduction

QA Engineer specializing in browser-based end-to-end testing

This command tests affected pages in a real browser, catching issues that unit tests miss:

  • JavaScript integration bugs
  • CSS/layout regressions
  • User workflow breakages
  • Console errors

Prerequisites

- Local development server running (e.g., `bin/dev`, `rails server`, `npm run dev`) - agent-browser CLI installed (see Setup below) - Git repository with changes to test

Setup

Check installation:

command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"

Install if needed:

npm install -g agent-browser
agent-browser install  # Downloads Chromium (~160MB)

See the agent-browser skill for detailed usage.

Main Tasks

0. Verify agent-browser Installation

Before starting ANY browser testing, verify agent-browser is installed:

command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing..." && npm install -g agent-browser && agent-browser install)

If installation fails, inform the user and stop.

1. Ask Browser Mode

Before starting tests, ask user if they want to watch the browser:

Use AskUserQuestion with:

  • Question: "Do you want to watch the browser tests run?"
  • Options:
    1. Headed (watch) - Opens visible browser window so you can see tests run
    2. Headless (faster) - Runs in background, faster but invisible

Store the choice and use --headed flag when user selects "Headed".

2. Determine Test Scope

$ARGUMENTS

If PR number provided:

gh pr view [number] --json files -q '.files[].path'

If 'current' or empty:

git diff --name-only main...HEAD

If branch name provided:

git diff --name-only main...[branch]

3. Map Files to Routes

Map changed files to testable routes:

File Pattern Route(s)
app/views/users/* /users, /users/:id, /users/new
app/controllers/settings_controller.rb /settings
app/javascript/controllers/*_controller.js Pages using that Stimulus controller
app/components/*_component.rb Pages rendering that component
app/views/layouts/* All pages (test homepage at minimum)
app/assets/stylesheets/* Visual regression on key pages
app/helpers/*_helper.rb Pages using that helper
src/app/* (Next.js) Corresponding routes
src/components/* Pages using those components

Build a list of URLs to test based on the mapping.

4. Verify Server is Running

Before testing, verify the local server is accessible:

agent-browser open http://localhost:3000
agent-browser snapshot -i

If server is not running, inform user:

**Server not running**

Please start your development server:
- Rails: `bin/dev` or `rails server`
- Node/Next.js: `npm run dev`

Then run `/test-browser` again.

5. Test Each Affected Page

For each affected route, use agent-browser CLI commands (NOT Chrome MCP):

Step 1: Navigate and capture snapshot

agent-browser open "http://localhost:3000/[route]"
agent-browser snapshot -i

Step 2: For headed mode (visual debugging)

agent-browser --headed open "http://localhost:3000/[route]"
agent-browser --headed snapshot -i

Step 3: Verify key elements

  • Use agent-browser snapshot -i to get interactive elements with refs
  • Page title/heading present
  • Primary content rendered
  • No error messages visible
  • Forms have expected fields

Step 4: Test critical interactions

agent-browser click @e1  # Use ref from snapshot
agent-browser snapshot -i

Step 5: Take screenshots

agent-browser screenshot page-name.png
agent-browser screenshot --full page-name-full.png  # Full page

6. Human Verification (When Required)

Pause for human input when testing touches:

Flow Type What to Ask
OAuth "Please sign in with [provider] and confirm it works"
Email "Check your inbox for the test email and confirm re
Полный SKILL.md на GitHub

Установить test-browser в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл test-browser?

Run browser tests on pages affected by current PR or branch

Как установить скилл test-browser?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл test-browser запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить test-browser с