Browser UAT
Skill0 starsChanged 49 days agoMITView on GitHub
Run User Acceptance Tests against a real Chrome browser using Playwright via CDP. Use this skill when the user asks to test a web page, verify UI behavior, check that a feature works in the browser, run UAT, do browser testing, or validate a web flow. Also trigger when the user mentions: "test the page", "check if the button works", "verify the login flow", "browser test", "UI test", "e2e test", "acceptance test".
- Reads credentials
In this repository20 other files it gives its agents.
- examples/CLAUDE.mdCLAUDE.md
- Anti-Hallucination VerificationSkill
- backup-snapshotSkill
- Multi-Agent BrainstormSkill
- ci-cd-builderSkill
- Code Patterns ReferenceSkill
- Conventional Commits WorkflowSkill
- Context Curator AdministrationSkill
- email-composerSkill
- git-detectiveSkill
- imap-emailSkill
- ollama-model-managerSkill
- Ollama Code VerificationSkill
- project-bootstrapperSkill
- prompt-engineerSkill
- refactor-analyzerSkill
- release-managerSkill
- scheduleSkill
- skill-creatorSkill
- Work LogSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
Read the profiles config to know which profiles are available:
- Distinctive: line 55
Before running tests, check that Chrome is running with debugging enabled:
- Distinctive: line 61
If not connected, tell the user to run:
- Distinctive: line 93
Prefer selectors in this order:
- Very specific: line 107
Add test credentials to ~/.secrets.zsh:
- Distinctive: line 167
If the user is in a context where they can view images, show the failure screenshot.
- Very specific: line 229
Check which profiles are configured: chrome-debug --list
- Very specific: line 230
Verify the port matches: node check-connection.js <port>
- Distinctive: line 233
Verify the screenshot directory exists and is writable
- Distinctive: line 242
Always check the connection before running tests
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Browser UAT — Real Chrome Testing via CDP
This skill enables you to run User Acceptance Tests against the user's actual Chrome browser (with real sessions, cookies, and auth tokens) using Playwright connected via Chrome DevTools Protocol.
Architecture
User describes test in natural language
→ You generate a test steps JSON
→ run-test.js connects to Chrome via CDP
→ Executes each step (navigate, click, fill, assert)
→ Screenshots on failure
→ You present a markdown reportPrerequisites
- Chrome running with
--remote-debugging-port(user launches withchrome-debug <profile>) - Playwright installed:
cd ~/.claude/skills/browser-uat/scripts && npm install - Profile config:
~/.claude/skills/browser-uat/configs/profiles.json
Step 1: Check Profile Configuration
Read the profiles config to know which profiles are available:
cat ~/.claude/skills/browser-uat/configs/profiles.jsonThis returns a JSON object mapping profile names to ports and base URLs.
Step 2: Verify Chrome Connection
Before running tests, check that Chrome is running with debugging enabled:
node ~/.claude/skills/browser-uat/scripts/check-connection.js <port>If not connected, tell the user to run:
chrome-debug <profile-name>Step 3: Generate Test Steps
Translate the user's natural language test description into a JSON test definition.
Supported Actions
| Action | Parameters | Description |
goto | url | Navigate to URL (relative to baseUrl or absolute) |
fill | selector, value | Type into an input field |
click | selector | Click an element |
waitForSelector | selector, state?, timeout? | Wait for element (default: visible) |
waitForURL | url, timeout? | Wait for navigation to URL |
assertVisible | selector | Assert element is visible |
assertText | selector, expected | Assert element contains text |
assertCount | selector, min?, max?, exact? | Assert number of matching elements |
screenshot | name, fullPage? | Capture screenshot |
wait | ms | Explicit wait in milliseconds |
evaluate | script | Run JavaScript in page context |
selectOption | selector, value | Select dropdown option |
check | selector | Check a checkbox |
uncheck | selector | Uncheck a checkbox |
hover | selector | Hover over element |
press | selector?, key | Press keyboard key |
Selector Strategy
Prefer selectors in this order:
- Text-based:
button:has-text('Save'),a:has-text('Login') - Role-based:
role=button[name="Submit"] - Placeholder:
input[placeholder="Email"] - Name/type:
input[name="email"],input[type="password"] - Test IDs:
[data-testid="campaign-table"] - CSS:
.campaign-row,#login-form
Environment Variables in Values
Values starting with $ are resolved from environment variables:
"$STAGING_USER"→ readsprocess.env.STAGING_USER"$STAGING_PASSWORD"→ readsprocess.env.STAGING_PASSWORD
Add test credentials to ~/.secrets.zsh:
export STAGING_USER="user@example.com"
export STAGING_PASSWORD="your-staging-password"Step 4: Run the Test
Execute the test with run-test.js:
node ~/.claude/skills/browser-uat/scripts/run-test.js '<JSON test definition>'Example Test Definition
{
"cdpUrl": "http://localhost:9222",
"baseUrl": "https://app.example.com",
"screenshotDir": "/tmp/uat-screenshots",
"timeout": 5000,
"steps": [
{ "action": "goto", "url": "/login" },
{ "action": "fill", "selector": "input[name=email]", "value": "$STAGING_USER" },
{ "action": "fill", "selector": "input[type=password]", "value": "$STAGING_PASSWORD" },
{ "action": "click", "selector": "button:has-text('Log in')" },
{ "action": "waitForURL", "url": "/dashboard" },
{ "action": "goto", "url": "/campaigns" },
{ "action": "waitForSelector", "selector": "table" },
{ "action": "assertVisible", "selector": "th:has-text('Active')" },
{ "action": "assertCount", "selector": "tbody tr", "min": 1 },
{ "action": "screenshot", "name": "campaigns-loaded" }
]
}Step 5: Present Results
The runner outputs JSON. Present it as a markdown report:
# UAT Report: [Test Name]
**Profile:** [profile] (port [port])
**Base URL:** [baseUrl]
**Status:** ✅ PASSED (N/N steps) | ❌ FAILED at step N
**Duration:** X.Xs
## Steps
1. ✅ Navigate to /login (0.8s)
2. ✅ Fill email field (0.1s)
...
N. ❌ Verify table — Element not found: table (5.0s)
Screenshot: /tmp/uat-screenshots/failure-step-N.png
## Screenshots
- [List captured screenshots with paths]If the user is in a context where they can view images, show the failure screenshot.
Common Test Patterns
Login Flow
[
{ "action": "goto", "url": "/login" },
{ "action": "fill", "selector": "input[name=email]", "value": "$STAGING_USER" },
{ "action": "fill", "selector": "input[type=password]", "value": "$STAGING_PASSWORD" },
{ "action": "click", "selector": "button:has-text('Log in')" },
{ "action": "waitForURL", "url": "/dashboard", "timeout": 10000 }
]Table Verification
[
{ "action": "goto", "url": "/campaigns" },
{ "action": "waitForSelector", "selector": "table", "timeout": 10000 },
{ "action": "assertCount", "selector": "tbody tr", "min": 1 },
{ "action": "assertVisible", "selector": "th:has-text('Status')" }
]Form Submission
[
{ "action": "goto", "url": "/settings" },
{ "action": "fill", "selector": "input[name=company]", "value": "Example Corp" },
{ "action": "selectOption", "selector": "select[name=timezone]", "value": "Europe/London" },
{ "action": "check", "selector": "input[name=notifications]" },
{ "action": "click", "selector": "button:has-text('Save')" },
{ "action": "waitForSelector", "selector": ".toast-success" },
{ "action": "screenshot", "name": "settings-saved" }
]Navigation Check
[
{ "action": "goto", "url": "/" },
{ "action": "click", "selector": "a:has-text('Reports')" },
{ "action": "waitForURL", "url": "/reports" },
{ "action": "assertVisible", "selector": "h1:has-text('Reports')" }
]Troubleshooting
"Cannot connect to Chrome"
Chrome is not running with debugging enabled. Tell the user:
chrome-debug <profile-name>"Element not found" / Timeout
- The selector might be wrong — ask the user to describe the element
- The page might not have loaded — add a
waitForSelectorstep before asserting - Increase timeout for slow pages:
"timeout": 10000
Wrong profile
- Check which profiles are configured:
chrome-debug --list - Verify the port matches:
node check-connection.js <port>
Screenshots not capturing
- Verify the screenshot directory exists and is writable
- Default:
/tmp/uat-screenshots
Important Notes
- Tests run against the user's REAL browser with real sessions and cookies
- The runner creates a new tab for testing and closes it when done
- It does NOT close or restart Chrome
- Environment variables in values (e.g.,
$STAGING_PASSWORD) are resolved at runtime - Always check the connection before running tests
- On failure, execution stops at the failing step and captures a screenshot
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
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.

