بنقرة واحدة
e2e-testing
E2E/QA testing with agent-browser CLI for token-efficient browser automation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
E2E/QA testing with agent-browser CLI for token-efficient browser automation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Dashboard Screenshot Capture
Generate professional system architecture diagrams using Excalidraw. Expert-level system design visuals.
Generate infrastructure diagrams using Python Diagrams library (mingrammer/diagrams).
| name | e2e-testing |
| description | E2E/QA testing with agent-browser CLI for token-efficient browser automation |
| triggers | ["e2e test","e2e 테스트","browser test","브라우저 테스트","qa test","qa 테스트","페이지 테스트","화면 테스트","agent-browser","end to end"] |
Browser automation for QA/E2E testing using Vercel's agent-browser CLI.
Uses accessibility tree refs (@e1, @e2) instead of CSS selectors — 5.7x more token-efficient than Playwright MCP.
npm install -g agent-browser
agent-browser install # installs Chromium
1. Open & Snapshot (understand the page)
agent-browser open <URL> && agent-browser wait --load networkidle && agent-browser snapshot -i
snapshot -i returns interactive elements only (buttons, inputs, links) with refs like @e1, @e22. Interact (fill forms, click buttons)
agent-browser fill @e3 "test@example.com"
agent-browser fill @e4 "password123"
agent-browser click @e5 # Submit button
agent-browser wait --load networkidle
3. Assert (verify results)
agent-browser snapshot -i # Check new page state
agent-browser get text @e10 # Get specific element text
agent-browser get url # Check current URL
agent-browser screenshot result.png # Visual evidence
4. Chain Commands (single bash call)
agent-browser open localhost:3000 && \
agent-browser wait --load networkidle && \
agent-browser snapshot -i
| Command | Description |
|---|---|
open <url> | Navigate to URL |
snapshot | Full accessibility tree with refs |
snapshot -i | Interactive elements only (less tokens) |
click @ref | Click element by ref |
fill @ref "text" | Clear and fill input |
type @ref "text" | Type into element (append) |
press Enter | Press keyboard key |
select @ref "value" | Select dropdown option |
check @ref / uncheck @ref | Checkbox toggle |
scroll down 500 | Scroll direction + pixels |
wait @ref | Wait for element to appear |
wait 2000 | Wait milliseconds |
wait --load networkidle | Wait for network idle |
get text @ref | Get element text content |
get url | Get current page URL |
get value @ref | Get input value |
screenshot [path] | Take screenshot |
screenshot --full | Full page screenshot |
screenshot --annotate | Labeled screenshot for AI review |
eval "js code" | Execute JavaScript |
close | Close browser |
@e1 # Ref from snapshot (preferred)
"button:has-text('Submit')" # CSS + text selector
"#email" # CSS ID selector
".btn-primary" # CSS class selector
Auth Flow Test:
agent-browser open localhost:3000/auth && agent-browser wait --load networkidle && agent-browser snapshot -i
# Read refs → find email input, password input, login button
agent-browser fill @e3 "test@example.com" && agent-browser fill @e4 "password123" && agent-browser click @e5
agent-browser wait --load networkidle && agent-browser get url
# Assert: URL changed after successful login
Form Submission Test:
agent-browser open localhost:3000/contact && agent-browser wait --load networkidle && agent-browser snapshot -i
agent-browser fill @e2 "John" && agent-browser fill @e3 "john@test.com" && agent-browser fill @e4 "Hello"
agent-browser click @e5 # Submit
agent-browser wait --load networkidle && agent-browser snapshot -i
# Assert: success message visible
Navigation & Content Test:
agent-browser open localhost:3000 && agent-browser wait --load networkidle
agent-browser snapshot -i
# Assert: key navigation elements present
agent-browser click @e2 # Navigate to a page
agent-browser wait --load networkidle && agent-browser get url
# Assert: URL is correct
After each test, create a structured result:
## Test: [Name]
- URL: [tested URL]
- Status: PASS / FAIL
- Steps:
1. [action] → [expected] → [actual]
2. ...
- Screenshot: [path if captured]
- Errors: [any errors encountered]
snapshot -i vs full snapshot:
snapshot -i shows only interactive elements (buttons, links, inputs) — great for form filling and clickingsnapshot shows ALL content including text, headings, paragraphs — use when verifying page contentsnapshot -i looks unchanged after navigation, use get url or full snapshot to verify the page actually changedState verification via eval:
agent-browser eval "localStorage.getItem('key')"
agent-browser eval "JSON.parse(localStorage.getItem('key')).state.field"
agent-browser eval "document.querySelector('[role=alert]')?.textContent"
SPA hydration awareness:
open (full page load), framework stores need time to rehydrate from localStoragewait 1000 or wait 2000 after navigation before checking auth-dependent stateopen does full page loadsnapshot -i (interactive only) instead of full snapshot — 60-80% less tokens&& in a single bash call — one tool call instead of manyget text are cheaperagent-browser close@e1) — never re-snapshot just to get CSS selectorseval for state checks — cheaper than re-snapshotting to verify JS stateagent-browser --headless open <url> && agent-browser snapshot -i
# Save login state across runs
agent-browser --session-name myapp open localhost:3000/login
# Login via commands...
# Next time, session is restored:
agent-browser --session-name myapp open localhost:3000
# Connect to Chrome with remote debugging
agent-browser --cdp 9222 snapshot
# Or auto-discover running Chrome
agent-browser --auto-connect snapshot