Generate and run E2E tests using browser-use AI automation. This skill should be used when creating automated browser tests, testing authenticated flows, generating test scripts from natural language, or validating user journeys with AI-powered browser control. Handles credentials securely via .env.test with domain-prefixed variables.
View on GitHubplugins/browser-automation/skills/browser-use-e2e/SKILL.md
February 5, 2026
Select agents to install to:
npx add-skill https://github.com/citadelgrad/scott-cc/blob/main/plugins/browser-automation/skills/browser-use-e2e/SKILL.md -a claude-code --skill browser-use-e2eInstallation paths:
.claude/skills/browser-use-e2e/# browser-use E2E Testing
## Overview
Generate and execute end-to-end tests using browser-use, an AI-powered browser automation library. Tests are written in natural language and the AI agent figures out the specific interactions.
## Quick Start
### 1. Setup
```bash
# Install browser-use
uv add browser-use python-dotenv
uvx browser-use install
```
### 2. Configure Credentials
Create `.env.test` with domain-prefixed credentials:
```bash
# Format: SERVICENAME_USER, SERVICENAME_PASS, SERVICENAME_DOMAIN (optional)
GITHUB_USER=your-username
GITHUB_PASS=your-password
GMAIL_EMAIL=you@gmail.com
GMAIL_PASS=your-app-password
# Custom app
MYAPP_USER=admin
MYAPP_PASS=secret
MYAPP_DOMAIN=https://app.example.com
```
### 3. Credential Loader
```python
# tests/e2e/conftest.py
import os
from dotenv import load_dotenv
load_dotenv('.env.test')
DOMAIN_MAP = {
'GITHUB': 'https://*.github.com',
'GMAIL': 'https://*.google.com',
'GOOGLE': 'https://*.google.com',
}
def build_sensitive_data() -> dict:
"""Build browser-use sensitive_data from .env.test vars."""
credentials = {}
for key in os.environ:
if key.endswith('_USER') or key.endswith('_EMAIL'):
prefix = key.rsplit('_', 1)[0]
user_val = os.getenv(key)
pass_key = f'{prefix}_PASS'
pass_val = os.getenv(pass_key)
if not pass_val:
continue
# Determine domain
domain_key = f'{prefix}_DOMAIN'
domain = os.getenv(domain_key) or DOMAIN_MAP.get(prefix)
if not domain:
continue
# Build credential entry
placeholder_user = f'{prefix.lower()}_user'
placeholder_pass = f'{prefix.lower()}_pass'
credentials[domain] = {
placeholder_user: user_val,
placeholder_pass: pass_val,
}
return credentials
```
## Test Patterns
### Simple Test
```python
from browser_use import Agen