e2e-agent-browser

e2e-agent-browser is a skill for Claude Code, Codex from jh941213/codex-lattice. It costs 113 tokens per session (3,596 once invoked), scanned A, original, MIT.

A guide for using agent-browser, a command-line tool that controls a headless web browser without opening a visible window. It uses page snapshots to find buttons, links, fields, and other elements for interaction.

In plain words
What is it for?
Writing and running end-to-end tests for sign-in, forms, navigation, clicks, scrolling, visible text, and other web-application interactions, including in CI pipelines.
Why use it?
It provides a repeatable way to check real browser behaviour instead of testing only individual functions or reading source code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jh941213/codex-lattice/e2e-agent-browser
Any agent
npx skills add jh941213/codex-lattice --skill e2e-agent-browser
Clone the repo
git clone --depth 1 https://github.com/jh941213/codex-lattice

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for e2e-agent-browser

README.md
[![agentmods](https://agentmods.dev/badge/skills/jh941213/codex-lattice/e2e-agent-browser.svg)](https://agentmods.dev/skills/jh941213/codex-lattice/e2e-agent-browser)
Your own site
<a href="https://agentmods.dev/skills/jh941213/codex-lattice/e2e-agent-browser"><img src="https://agentmods.dev/badge/skills/jh941213/codex-lattice/e2e-agent-browser.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,596 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.03596
Opus 5 $0.00056 $0.01798
Sonnet 5 $0.00023 $0.00719
Haiku 4.5 $0.00011 $0.00360

Measured 6d ago against content hash 56c76b5c9d8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

e2e-agent-browser scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (templates/runner.js, templates/test-suite.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

const { execSync } = require('child_process');
skills/e2e-agent-browser/SKILL.md · 645 lines

How it starts

The opening of the file, as written. The whole thing — 645 lines — stays where its author put it; the contents beside it link to each section on GitHub.

E2E Testing with agent-browser

AI 에이전트를 위한 헤드리스 브라우저 자동화 CLI agent-browser를 활용하여 E2E 테스트를 작성하고 실행하는 종합 가이드입니다.

이 스킬을 사용할 때

  • 웹 애플리케이션 E2E 테스트 작성
  • 로그인/회원가입 플로우 테스트
  • 폼 입력 및 제출 테스트
  • 네비게이션 및 라우팅 테스트
  • UI 상호작용 테스트 (클릭, 호버, 스크롤)
  • 시각적 상태 확인 (요소 존재, 텍스트 내용)
  • CI/CD 파이프라인에서 브라우저 테스트 실행

설치

# npm으로 설치 (권장)
npm install -g agent-browser

# Chromium 브라우저 다운로드
agent-browser setup

# Linux의 경우 시스템 의존성 추가 설치
agent-browser setup --with-deps

핵심 개념

1. 스냅샷 + Ref 워크플로우

agent-browser의 핵심은 **접근성 트리(Accessibility Tree)**와 ref 시스템입니다.

# 1. 페이지 열기
agent-browser open https://example.com

# 2. 접근성 스냅샷 가져오기 (ref 포함)
agent-browser snapshot -i
# 출력:
# - heading "Example Domain" [ref=e1] [level=1]
# - button "Submit" [ref=e2]
# - textbox "Email" [ref=e3]
# - link "Learn more" [ref=e4]

# 3. ref를 사용하여 요소와 상호작용
agent-browser click @e2        # 버튼 클릭
agent-browser fill @e3 "[email protected]"  # 텍스트 입력
agent-browser text @e1         # 텍스트 가져오기

2. 스냅샷 옵션

# 전체 접근성 트리
agent-browser snapshot

# 인터랙티브 요소만 (버튼, 입력, 링크)
agent-browser snapshot -i

# 컴팩트 모드 (빈 구조 요소 제거)
agent-browser snapshot -c

# 깊이 제한
agent-browser snapshot -d 3

# CSS 선택자로 범위 제한
agent-browser snapshot -s "#main"

# 옵션 조합
agent-browser snapshot -i -c -d 5

3. JSON 모드 (AI 에이전트용)

# JSON 출력으로 파싱 가능한 결과 반환
agent-browser snapshot --json
# {"success":true,"data":{"snapshot":"...","refs":{"e1":{"role":"heading","name":"Title"},...}}}

E2E 테스트 패턴

패턴 1: 기본 페이지 테스트

#!/bin/bash
# test_homepage.sh

set -e  # 에러 시 즉시 중단

# 페이지 열기
agent-browser open https://myapp.com

# 페이지 타이틀 확인
TITLE=$(agent-browser title)
if [[ "$TITLE" != "My App" ]]; then
  echo "FAIL: Expected title 'My App', got '$TITLE'"
  exit 1
fi

# 주요 요소 존재 확인
agent-browser snapshot -i | grep -q "button.*Login" || {
  echo "FAIL: Login button not found"
  exit 1
}

echo "PASS: Homepage test"
agent-browser close

패턴 2: 로그인 플로우 테스트

#!/bin/bash
# test_login.sh

set -e

# 로그인 페이지 열기
agent-browser open https://myapp.com/login

# 스냅샷으로 요소 ref 확인
agent-browser snapshot -i
# - textbox "Email" [ref=e1]
# - textbox "Password" [ref=e2]
# - button "Sign In" [ref=e3]

# 이메일 입력
agent-browser fill @e1 "[email protected]"

# 비밀번호 입력
agent-browser fill @e2 "password123"

# 로그인 버튼 클릭
agent-browser click @e3

# URL 변경 대기
agent-browser wait url "**/dashboard"

# 대시보드 확인
URL=$(agent-browser url)
if [[ "$URL" != *"dashboard"* ]]; then
  echo "FAIL: Not redirected to dashboard"
  exit 1
fi

echo "PASS: Login flow"
agent-browser close

Read the full file on GitHub · 645 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 645 lines · 113 tokens per session scan A 56c76b5c9d8e

Subscribe to this mod's changes

e2e-agent-browser is a skill published in the GitHub repository jh941213/codex-lattice (19 stars, last pushed 3mo ago), licensed MIT. It adds 113 tokens to every session and 3,596 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.