High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: auto-install plugin deps in check and gitignore plugin artifacts
Marioa0cb76777aae
diff --git a/.gitignore b/.gitignoreindex 65681ae2..4c8d51be 100644--- a/.gitignore+++ b/.gitignore@@ -51,8 +51,11 @@ pinchtab-devpinchtab-smallpinchtab.exeplugins/*/.venv/+plugin/node_modules/+plugin/package-lock.jsonplugin/skills/pinchtab/tests/e2e/results/*+tests/benchmark/results/tests/tools/browserbench/results//runnertests/tools/scripts/runnerdiff --git a/internal/handlers/text.go b/internal/handlers/text.goindex ca7d79b9..d940183a 100644--- a/internal/handlers/text.go+++ b/internal/handlers/text.go@@ -11,6 +11,7 @@ import ("github.com/chromedp/chromedp""github.com/pinchtab/pinchtab/internal/assets""github.com/pinchtab/pinchtab/internal/bridge"+ "github.com/pinchtab/pinchtab/internal/bridge/observe""github.com/pinchtab/pinchtab/internal/engine""github.com/pinchtab/pinchtab/internal/httpx")@@ -114,48 +115,19 @@ func (h *Handlers) HandleText(w http.ResponseWriter, r *http.Request) {var text stringif targetFrameID == "" {- // Top-frame path — keep the ergonomic chromedp.Evaluate helper.- if err := chromedp.Run(tCtx, chromedp.Evaluate(script, &text)); err != nil {- httpx.Error(w, 500, fmt.Errorf("text extract: %w", err))- return- }+ // Cross-frame path: collect text from all reachable frames (same+ // as snap, which auto-flattens same-origin iframes). Cross-origin+ // frames are silently skipped because createIsolatedWorld fails.+ text = h.extractTextAllFrames(tCtx, script)} else {// Frame-scoped path — evaluate in the frame's isolated world so the// expression sees the iframe's `document`, not the parent's.- execID, err := bridge.FrameExecutionContextID(tCtx, targetFrameID)+ var err error+ text, err = h.evalTextInFrame(tCtx, script, targetFrameID)if err != nil {- httpx.Error(w, 500, fmt.Errorf("resolve frame context: %w", err))- return- }- var raw json.RawMessage- err = chromedp.Run(tCtx, chromedp.ActionFunc(func(ctx context.Context) error {- return chromedp.FromContext(ctx).Target.Execute(ctx, "Runtime.evaluate", map[string]any{- "expression": script,- "returnByValue": true,- "contextId": execID,- }, &raw)- }))- if err != nil {- httpx.Error(w, 500, fmt.Errorf("text extract (frame %s): %w", targetFrameID, err))- return- }- var er struct {- Result struct {- Value string `json:"value"`- } `json:"result"`- ExceptionDetails *struct {- Text string `json:"text"`- } `json:"exceptionDetails,omitempty"`- }- if err := json.Unmarshal(raw, &er); err != nil {- httpx.Error(w, 500, fmt.Errorf("text extract parse: %w", err))+ httpx.Error(w, 500, err)return}- if er.ExceptionDetails != nil && er.ExceptionDetails.Text != "" {- httpx.Error(w, 500, fmt.Errorf("text extract (frame %s): %s", targetFrameID, er.ExceptionDetails.Text))- return- }- text = er.Result.Value}truncated := false@@ -231,6 +203,84 @@ func (h *Handlers) HandleTabText(w http.ResponseWriter, r *http.Request) {h.HandleText(w, req)}+// extractTextAllFrames evaluates the text script in every reachable frame and+// concatenates the results. Cross-origin frames are silently skipped (the+// isolated-world creation fails, just like snap skips inaccessible frames).+func (h *Handlers) extractTextAllFrames(ctx context.Context, script string) string {+ frameTree, err := observe.FetchFrameTree(ctx)+ if err != nil {+ // Fallback: top frame only.+ var text string+ _ = chromedp.Run(ctx, chromedp.Evaluate(script, &text))+ return text+ }++ ids := observe.FrameIDs(frameTree)+ if len(ids) == 0 {+ var text string+ _ = chromedp.Run(ctx, chromedp.Evaluate(script, &text))+ return text+ }++ var parts []string+ for _, id := range ids {+ t, err := h.evalTextInFrame(ctx, script, id)+ if err != nil || strings.TrimSpace(t) == "" {+ continue+ }+ parts = append(parts, t)+ }+ if len(parts) == 0 {+ var text string+ _ = chromedp.Run(ctx, chromedp.Evaluate(script, &text))+ return text+ }+ return strings.Join(parts, "\n\n")+}++// evalTextInFrame evaluates a text-extraction script in a specific frame's+// isolated world and returns the result string.+func (h *Handlers) evalTextInFrame(ctx context.Context, script, frameID string) (string, error) {+ execID, err := bridge.FrameExecutionContextID(ctx, frameID)+ if err != nil {+ return "", fmt.Errorf("resolve frame context: %w", err)+ }+ if execID == 0 {+ // Top frame — use the simpler chromedp path.+ var text string+ if err := chromedp.Run(ctx, chromedp.Evaluate(script, &text)); err != nil {+ return "", fmt.Errorf("text extract: %w", err)+ }+ return text, nil+ }+ var raw json.RawMessage+ err = chromedp.Run(ctx, chromedp.ActionFunc(func(ctx context.Context) error {+ return chromedp.FromContext(ctx).Target.Execute(ctx, "Runtime.evaluate", map[string]any{+ "expression": script,+ "returnByValue": true,+ "contextId": execID,+ }, &raw)+ }))+ if err != nil {+ return "", fmt.Errorf("text extract (frame %s): %w", frameID, err)+ }+ var er struct {+ Result struct {+ Value string `json:"value"`+ } `json:"result"`+ ExceptionDetails *struct {+ Text string `json:"text"`+ } `json:"exceptionDetails,omitempty"`+ }+ if err := json.Unmarshal(raw, &er); err != nil {+ return "", fmt.Errorf("text extract parse: %w", err)+ }+ if er.ExceptionDetails != nil && er.ExceptionDetails.Text != "" {+ return "", fmt.Errorf("text extract (frame %s): %s", frameID, er.ExceptionDetails.Text)+ }+ return er.Result.Value, nil+}+// extractElementText extracts innerText from a specific element by selector or ref.func (h *Handlers) extractElementText(ctx context.Context, tabID, selector, ref string) (string, error) {var text stringdiff --git a/scripts/check-plugin.sh b/scripts/check-plugin.shindex 7b9d9bd5..fcd87207 100755--- a/scripts/check-plugin.sh+++ b/scripts/check-plugin.sh@@ -6,6 +6,14 @@ cd "$(dirname "$0")/.."echo "📦 Plugin checks"echo ""+# Ensure dependencies are installed+if [ ! -d "plugin/node_modules" ]; then+ echo " Installing dependencies..."+ (cd plugin && npm install --silent)+ echo " ✓ Dependencies installed"+ echo ""+fi+# Verify JSON filesecho " Validating JSON schemas..."node -e "JSON.parse(require('fs').readFileSync('plugin/package.json', 'utf8'))"diff --git a/skills/pinchtab-opt/SKILL.md b/skills/pinchtab-opt/SKILL.mdindex f0bec351..cdfe64d0 100644--- a/skills/pinchtab-opt/SKILL.md+++ b/skills/pinchtab-opt/SKILL.md@@ -1,11 +1,11 @@---name: pinchtab-opt-description: "Run the PinchTab optimization loop. Spawns blind subagents that execute 87 browser automation steps across 39 groups using only the PinchTab skill, then reports pass/fail results and operation counts vs baseline. Use when asked to 'run optimization', 'run the opt loop', 'benchmark the agent', or 'test pinchtab agent'."+description: "Run the PinchTab optimization loop. Spawns blind subagents that execute 99 browser automation steps across 45 groups using only the PinchTab skill, then reports pass/fail results and operation counts vs baseline. Use when asked to 'run optimization', 'run the opt loop', 'benchmark the agent', or 'test pinchtab agent'."---# PinchTab Optimization Loop-Run blind subagents against 87 browser automation steps (39 groups) to measure how well an AI agent can drive PinchTab without hand-held selectors.+Run blind subagents against 99 browser automation steps (45 groups) to measure how well an AI agent can drive PinchTab without hand-held selectors.## Path Resolution@@ -60,11 +60,11 @@ Save the three file paths — you'll pass one to each subagent.### 1. Spawn 3 parallel subagents-Use the **Agent** tool with `run_in_background: true`. Split the 39 groups into three batches:+Use the **Agent** tool with `run_in_background: true`. Split the 45 groups into three batches:-- **Batch A**: groups 0-12 (39 steps)-- **Batch B**: groups 13-25 (26 steps)-- **Batch C**: groups 26-38 (22 steps)+- **Batch A**: groups 0-14 (45 steps)+- **Batch B**: groups 15-29 (30 steps)+- **Batch C**: groups 30-44 (24 steps)Each subagent gets the **same prompt template** — only the group range and `{REPORT_FILE}` change. Replace `{START}`, `{END}`, `{START_PAD}`, `{END_PAD}`, `{PROJECT_ROOT}`, and `{REPORT_FILE}` with actual values:@@ -100,7 +100,7 @@ While agents run, periodically count step-end recordings in each agent's outputgrep -c "step-end" <output_file>```-Expected totals: Batch A ~39, Batch B ~26, Batch C ~22 = 87 total.+Expected totals: Batch A ~45, Batch B ~30, Batch C ~24 = 99 total.### 3. Collect and summarize@@ -108,9 +108,9 @@ Once all 3 agents complete, use `./scripts/runner` subcommands to merge reports## Reference Numbers-- **Baseline**: 87/87 steps, 246 browser ops, 2.8 ops/step-- **Expected agent range**: 350-500 browser ops, 4-6 ops/step (agent must explore pages before acting)-- **Group count**: 39 groups, 87 total steps+- **Baseline**: 99/99 steps+- **Expected agent range**: 400-600 browser ops, 4-6 ops/step (agent must explore pages before acting)+- **Group count**: 45 groups, 99 total steps## File Locations (relative to project root)@@ -118,7 +118,7 @@ Once all 3 agents complete, use `./scripts/runner` subcommands to merge reports|------|---------|| `tests/optimization/subagent-context.md` | Subagent instructions (env, wrapper, recording) || `tests/optimization/index.md` | Group listing |-| `tests/optimization/group-00.md` .. `group-38.md` | Task descriptions |+| `tests/optimization/group-00.md` .. `group-44.md` | Task descriptions || `skills/pinchtab/SKILL.md` | PinchTab command reference (read by subagent) || `tests/tools/scripts/pt` | PinchTab wrapper (CWD must be `tests/tools`) || `tests/tools/scripts/runner` | Step recorder (CWD must be `tests/tools`) |diff --git a/skills/pinchtab/SKILL.md b/skills/pinchtab/SKILL.mdindex 6b36e0d1..e49e93c2 100644--- a/skills/pinchtab/SKILL.md+++ b/skills/pinchtab/SKILL.md@@ -240,7 +240,7 @@ Use curl only when the CLI is unavailable. See [api.md](./references/api.md) for- `text` confirms success messages / navigation outcomes. Default is Readability-filtered; may drop nav, repeated headlines, short-text nodes, or collapse lists. Use `text --full` (raw `document.body.innerText`) when verifying list/grid/tab/accordion pages, the marker is short, or a default read came back missing content you saw in `snap`.- Stale refs after a change are expected — fetch fresh refs instead of retrying.- `{"clicked":true,"submitted":true}` means the event fired, **not** that the server accepted or HTML validation passed. Verify via `snap`/`text` — or use `--snap-diff` on the action itself, which already reflects the post-event page state.-- **Same-origin iframes**: `pinchtab frame <target>` sets a stateful scope inherited by subsequent selector-based `snap`/action/text calls. Target accepts `main`, an iframe ref, CSS for the iframe, a frame name, or a URL. Nested iframes need multiple hops. Full `snap` (no `-i`) flattens same-origin iframe descendants and ref-based actions work across the boundary. **Cross-origin iframes** aren't exposed as scopes — fall back to `eval` against `iframe.contentDocument`. `text --frame <frameId>` takes a 32-char hex `frameId` (from `pinchtab frame` output), not a CSS selector. One-shot read idiom: `FID=$(pinchtab frame '#f' | jq -r .current.frameId); pinchtab frame main; pinchtab text --full --frame "$FID"`.+- **Same-origin iframes**: Default `snap` (no `-i`) flattens same-origin iframe descendants — nested content appears as regular refs. **Ref-based actions (`click e5`, `fill e3`) work across iframe boundaries without `frame` scope changes.** Only use `frame` when you need scoped `text` reads; chain hops with CSS selectors from the initial snap (`frame '#level-2'; frame '#level-3'; text; frame main`) — skip intermediate snaps. `frame <target>` accepts `main`, an iframe ref, CSS, a frame name, or URL. **Cross-origin iframes** aren't exposed as scopes — fall back to `eval` against `iframe.contentDocument`. `text --frame <frameId>` takes a 32-char hex `frameId` (from `pinchtab frame` output), not a CSS selector.- **`eval` → always IIFE** when introducing identifiers. Top-level `const`/`let`/`class` collide across calls in the shared realm (`SyntaxError: Identifier 'x' has already been declared`). Also needed to project `DOMRect` into a JSON-serializable object: `pinchtab eval "(() => { const r = document.querySelector('#x').getBoundingClientRect(); return {x: r.x, y: r.y, w: r.width, h: r.height}; })()"`. Single expressions without identifiers (`document.title`) are fine bare.- **`text` reads hidden nodes**: both default and `--full` include `display:none` / `visibility:hidden` content because they read raw DOM. To confirm something is *actually visible*, use `snap` (accessibility tree respects visibility) or `eval` against `offsetHeight` / `getComputedStyle().display`. Common trap: pre-seeded hidden success `<div>` reported by `text` before submission.- Compact snap shows `<option>` by visible text, not `value`. `select` accepts either; only `eval + Array.from(select.options)` to debug a no-match.diff --git a/skills/pinchtab/references/agent-optimization.md b/skills/pinchtab/references/agent-optimization.mdindex 9c6fdce1..0e03c528 100644--- a/skills/pinchtab/references/agent-optimization.md+++ b/skills/pinchtab/references/agent-optimization.md@@ -75,6 +75,39 @@ pinchtab nav <url> --block-images --snap---+## Iframe Shortcuts++Default `snap` (without `-i`) **flattens same-origin iframes** — nested iframe content appears as regular refs in the tree. Ref-based actions (`click`, `fill`, etc.) work **across iframe boundaries** without `frame` scope changes.++```+# snap already shows everything, including nested iframes:+# e0:heading "Outer page"+# e1:Iframe+# e2:heading "Level 2"+# e3:Iframe+# e4:heading "Level 3"+# e5:button "Deep button" ← 3 levels deep, but clickable as e5++pinchtab click e5 # works cross-boundary — no frame hops needed+```++**When you DO need `frame`:** only for scoped `text` reads. `text` respects the current frame scope, so to read text inside a nested iframe you must hop. Chain the hops without intermediate snaps — use CSS selectors or iframe IDs from the initial `snap`:++```bash+# BAD: snap at each level (expensive)+pinchtab frame e1; pinchtab snap; pinchtab frame e1; pinchtab snap; pinchtab text++# GOOD: chain hops directly, read once+pinchtab frame '#level-2'+pinchtab frame '#level-3'+pinchtab text # now scoped to deepest frame+pinchtab frame main # back to top+```++**Summary:** Use refs for **actions** (zero frame hops). Use `frame` chains for **text reads** (skip intermediate snaps).++---+## Recovery Patterns### 403 Forbiddendiff --git a/tests/optimization/group-00.md b/tests/optimization/group-00.mdindex 5e5fd34a..bad0f4f7 100644--- a/tests/optimization/group-00.md+++ b/tests/optimization/group-00.md@@ -1,44 +1,43 @@# Group 0: Setup & Diagnosis### 0.1 Server reachable-Check that the PinchTab server is healthy.+Check that the PinchTab server is healthy and responding.-**Verify**: Server responds with `status: ok`.+**Verify**: Server health check returns a successful status.### 0.2 Auth is required-Make a request to the server with a **wrong** token (`PINCHTAB_TOKEN=wrong-token ./scripts/pt health`) and confirm it is rejected. The `pt` wrapper always injects the benchmark token by default, so you must explicitly override it to test auth rejection.+Make a request to the server with a wrong token (`PINCHTAB_TOKEN=wrong-token ./scripts/pt health`) and confirm it is rejected. The `pt` wrapper injects the benchmark token by default, so you must explicitly override it.-**Verify**: Response is HTTP 401 or contains `unauthorized`.+**Verify**: The server rejects the request with an authentication error.### 0.3 Auth works with token-Repeat the same request WITH the bearer token and confirm it succeeds.+Repeat the health check with the correct bearer token and confirm it succeeds.-**Verify**: Response is HTTP 200.+**Verify**: The server accepts the authenticated request.### 0.4 Instance availableConfirm at least one Chrome instance is running. If none exist, start one.-**Verify**: Health response shows `defaultInstance.status == "running"` (or after starting one, the new instance is running).+**Verify**: An instance is running and available.### 0.5 List existing tabsGet the current list of open tabs.-**Verify**: A list (possibly empty) is returned without error.+**Verify**: A tab listing is returned without error.### 0.6 Clean stale tabs-If any tabs from previous runs are open, close them so the benchmark starts from a known state.+If any tabs from previous runs are open, close them so the benchmark starts from a clean state.-**Verify**: After cleanup, the tab list is empty (or only contains a single about:blank tab).+**Verify**: Tab state is clean after the operation.### 0.7 Network reach to targetNavigate to `http://fixtures/` and confirm the fixtures server is reachable from PinchTab.-**Verify**: Navigate returns successfully and the page contains benchmark content.+**Verify**: The page loads and contains benchmark content.### 0.8 Capture initial tab ID-Save the tab ID returned by the navigate in 0.7. Use this tab ID for all subsequent tasks to avoid creating new tabs.+Save the tab ID from the navigation in 0.7. Use this tab for all subsequent tasks to avoid creating new tabs.-**Verify**: A tab ID was captured and matches what `GET /tabs` reports.+**Verify**: A tab ID has been captured and is consistent with the active tab.----diff --git a/tests/optimization/group-01.md b/tests/optimization/group-01.mdindex 9ae2ee54..40185a7c 100644--- a/tests/optimization/group-01.md+++ b/tests/optimization/group-01.md@@ -1,34 +1,33 @@# Group 1: Reading & Extracting Real Content### 1.1 Get the full list of categories from the wiki index-Navigate to `http://fixtures/wiki.html` and extract all category names with their article counts.+Go to `http://fixtures/wiki.html` and tell me what content categories are listed and how many articles each one has.-**Verify**: Can name at least 2 categories and their article counts (e.g. "Programming Languages: 12 articles").+**Verify**: Report lists the categories with their article counts.### 1.2 Navigate by clicking a link-From the wiki index, click the "Go (programming language)" link to navigate to the Go article.+From the wiki index, click the link for the Go programming language article to navigate to it.-**Verify**: You are now on the Go article page (not the wiki index).+**Verify**: You are now on the Go article page, not the wiki index.### 1.3 Extract structured data from a table-On the Go article, read the infobox table and answer: Who designed Go, and what year did it first appear?+On the Go article, read the infobox table and tell me who designed Go and what year it first appeared.-**Verify**: Answer contains "Robert Griesemer" (or "Rob Pike" or "Ken Thompson") and "2009".+**Verify**: Answer includes the designer name(s) and the year.### 1.4 Count list itemsOn the Go article, count how many key features are listed.-**Verify**: Answer is 6 (verify against `FEATURE_COUNT_6`).+**Verify**: Answer includes the number of features found.### 1.5 Read all article headlines from articles page-Navigate to `http://fixtures/articles.html` and list all article titles.+Go to `http://fixtures/articles.html` and list all article titles you find.-**Verify**: Found at least 3 articles including "The Future of Artificial Intelligence".+**Verify**: Report includes the article titles from the page.### 1.6 Read dashboard metrics-Navigate to `http://fixtures/dashboard.html` and extract: Total Users, Revenue, and Conversion Rate.+Go to `http://fixtures/dashboard.html` and tell me the Total Users, Revenue, and Conversion Rate shown on the page.-**Verify**: Found `24,582` users AND `$1,284,930` revenue.+**Verify**: Report includes the user count and revenue figures from the dashboard.----diff --git a/tests/optimization/group-02.md b/tests/optimization/group-02.mdindex 78be52a2..cd91aff3 100644--- a/tests/optimization/group-02.md+++ b/tests/optimization/group-02.md@@ -1,19 +1,21 @@# Group 2: Search & Dynamic Interaction### 2.1 Use wiki search to find a page-On `http://fixtures/wiki.html`, search for "golang" using the search form. Do not navigate directly — use the search input.+On `http://fixtures/wiki.html`, use the search form to search for "golang". Do not navigate directly -- use the search input on the page.-**Verify**: Ended up on the Go article page after search.+**Verify**: Which best describes the page you landed on?+- A) The URL contains "wiki-go" or the page is the Go article+- B) The search returned results but you stayed on the search page+- C) Other### 2.2 Search with no results-On `http://fixtures/search.html`, search for something with no results (use "xyznonexistent").+On `http://fixtures/search.html`, search for "xyznonexistent" and report what happens.-**Verify**: Page handled it gracefully (no crash, some response rendered).+**Verify**: The page handled the empty result gracefully without crashing.### 2.3 Search for AI content-On `http://fixtures/search.html`, search for "artificial intelligence" and verify a result appeared.+On `http://fixtures/search.html`, search for "artificial intelligence" and tell me what results come up.-**Verify**: Result contains "The Future of Artificial Intelligence".+**Verify**: Report includes the relevant search result(s).----diff --git a/tests/optimization/group-03.md b/tests/optimization/group-03.mdindex 34de80e3..ff5b6ab2 100644--- a/tests/optimization/group-03.md+++ b/tests/optimization/group-03.md@@ -1,23 +1,21 @@# Group 3: Complex Form### 3.1 Fill and submit a complete form-Navigate to `http://fixtures/form.html`. Complete the entire form:+Go to `http://fixtures/form.html` and fill out the entire form with the following information, then submit it:- Full name: "Agent Test User"-- Email: "[email protected]"+- Email: "[email protected]"- Phone: "+44 20 9999 0000"- Country: United Kingdom- Subject: Technical Support- Message: "Testing PinchTab form automation"-- Check newsletter+- Check the newsletter option- Set priority to High-- Submit-**Verify**: Form submitted successfully. Confirmation shows name "AGENT_TEST_USER".+**Verify**: The form was submitted and a confirmation appeared.### 3.2 Reset and refill-After submitting, if the form is still accessible (or navigate back), verify you can identify the reset button.+After submitting, check whether there is a way to reset the form or go back.-**Verify**: Reset/back button or form element found in snapshot.+**Verify**: A reset or back control is visible on the page.----diff --git a/tests/optimization/group-04.md b/tests/optimization/group-04.mdindex bf5978c4..c64d885d 100644--- a/tests/optimization/group-04.md+++ b/tests/optimization/group-04.md@@ -1,19 +1,18 @@# Group 4: SPA State Management### 4.1 Read initial app state-Navigate to `http://fixtures/spa.html?reset=1` (the `?reset=1` query param clears any previous localStorage state so the SPA starts with its default 3 tasks). Read the current task list — how many tasks exist, how many are active vs done?+Go to `http://fixtures/spa.html?reset=1` (the `?reset=1` clears any previous state). Read the task list and tell me how many tasks there are total, how many are active, and how many are done.-**Verify**: Found 3 total, 2 active, 1 done (verify `TASK_STATS_TOTAL_3_ACTIVE_2_DONE_1`).+**Verify**: Report includes the task counts broken down by status.### 4.2 Add a new high-priority taskAdd a task called "Automate deployment" with high priority.-**Verify**: Task appeared in the list (`TASK_ADDED_AUTOMATE_DEPLOYMENT_PRIORITY_HIGH`).+**Verify**: The new task appeared in the list.### 4.3 Delete a taskDelete the task titled "Write benchmark tests".-**Verify**: Task count changed (went from 4 to 3).+**Verify**: The task was removed and the total count changed.----diff --git a/tests/optimization/group-05.md b/tests/optimization/group-05.mdindex ba3d630a..bfb2ae39 100644--- a/tests/optimization/group-05.md+++ b/tests/optimization/group-05.md@@ -1,14 +1,13 @@# Group 5: Login Flow### 5.1 Attempt login with wrong credentials-Navigate to `http://fixtures/login.html`. Try to log in with username "admin" and password "wrong".+Go to `http://fixtures/login.html` and try to log in with username "admin" and password "wrong".-**Verify**: Error message appeared (`INVALID_CREDENTIALS_ERROR`).+**Verify**: An error message appeared indicating the credentials were invalid.### 5.2 Login successfully-Clear the form and log in with username "benchmark" / password "test456".+Clear the form and log in with username "benchmark" and password "test456".-**Verify**: Dashboard appeared after login (`VERIFY_LOGIN_SUCCESS_DASHBOARD`).+**Verify**: You are now on the dashboard after a successful login.----diff --git a/tests/optimization/group-06.md b/tests/optimization/group-06.mdindex 37c049f7..d20448bc 100644--- a/tests/optimization/group-06.md+++ b/tests/optimization/group-06.md@@ -1,19 +1,18 @@# Group 6: Multi-Step E-commerce### 6.1 Research products before buying-Navigate to `http://fixtures/ecommerce.html`. List all available products with their prices. Which product is out of stock?+Go to `http://fixtures/ecommerce.html`. List all available products with their prices. Which product is out of stock?-**Verify**: Found Wireless Headphones ($149.99), Smart Watch Pro ($299.99), Portable Charger ($49.99). Mechanical Keyboard is out of stock.+**Verify**: Report lists the products, their prices, and identifies which one is out of stock.### 6.2 Add two items and verify total-Add Wireless Headphones and Smart Watch Pro to cart. What is the total?+Add Wireless Headphones and Smart Watch Pro to the cart. What is the cart total?-**Verify**: Cart total is $449.98 (149.99 + 299.99).+**Verify**: Report includes the cart total after adding both items.### 6.3 Complete checkoutClick checkout to complete the order.-**Verify**: Order confirmation shows (`VERIFY_CHECKOUT_SUCCESS_ORDER`).+**Verify**: An order confirmation appeared.----diff --git a/tests/optimization/group-07.md b/tests/optimization/group-07.mdindex 41c1838f..d12a4b50 100644--- a/tests/optimization/group-07.md+++ b/tests/optimization/group-07.md@@ -1,14 +1,13 @@# Group 7: Content + Interaction Combined### 7.1 Read and comment on Go article-Navigate to `http://fixtures/wiki-go.html`. Read the article, then post a comment with rating 5 stars and text "Excellent reference".+Go to `http://fixtures/wiki-go.html`. Read the article, then post a comment with a 5-star rating and the text "Excellent reference".-**Verify**: Comment posted (`COMMENT_POSTED_RATING_5_TEXT_RECEIVED`).+**Verify**: The comment was posted successfully with the rating.### 7.2 Cross-page research task-Navigate to wiki index, find which category has the most articles, then navigate to one of its listed items.+Go to the wiki index, find which category has the most articles, then navigate to one of the articles listed under that category.-**Verify**: Successfully navigated to at least one article page after reading the category counts.+**Verify**: Successfully navigated to an article page after identifying the largest category.----diff --git a/tests/optimization/group-08.md b/tests/optimization/group-08.mdindex ddfc6817..1b1ebfcd 100644--- a/tests/optimization/group-08.md+++ b/tests/optimization/group-08.md@@ -1,14 +1,13 @@# Group 8: Error Handling### 8.1 Handle 404 gracefully-Try to navigate to a page that doesn't exist: `http://fixtures/missing-page-abc.html`.+Try to navigate to a page that does not exist: `http://fixtures/missing-page-abc.html`. Report what happened.-**Verify**: Got a response (404 or error), no crash, server still responsive after.+**Verify**: Got an error response without crashing, and the server is still responsive.### 8.2 Handle missing element gracefully-On any page, try to click an element with ID `#fake-button-that-does-not-exist`.+On any page, try to interact with an element that does not exist on the page. Report what happened.-**Verify**: Got a clear error message, not a crash or hang.+**Verify**: Got a clear error message rather than a crash or hang.----diff --git a/tests/optimization/group-09.md b/tests/optimization/group-09.mdindex 5f2ccedf..b69128ab 100644--- a/tests/optimization/group-09.md+++ b/tests/optimization/group-09.md@@ -1,14 +1,13 @@# Group 9: Export### 9.1 Screenshot a complex page-Navigate to `http://fixtures/dashboard.html` and take a screenshot.+Go to `http://fixtures/dashboard.html` and take a screenshot of the page.-**Verify**: Screenshot generated (file saved or base64 returned).+**Verify**: A screenshot was generated and saved.### 9.2 Export a page as PDF-Export the dashboard as a PDF.+Export the dashboard page as a PDF.-**Verify**: PDF generated.+**Verify**: A PDF was generated.----diff --git a/tests/optimization/group-10.md b/tests/optimization/group-10.mdindex 6a3f4688..cf4b5e2b 100644--- a/tests/optimization/group-10.md+++ b/tests/optimization/group-10.md@@ -1,14 +1,13 @@# Group 10: Nested Interactions & Modal Dialogs### 10.1 Open and interact with modal on dashboard-Navigate to `http://fixtures/dashboard.html`. Find and click the Settings button to open the modal dialog.+Go to `http://fixtures/dashboard.html`. Find and click the Settings button to open the settings dialog.-**Verify**: Modal appeared — snapshot contains "Dashboard Settings".+**Verify**: A settings modal appeared on the page.### 10.2 Modify settings and close modal-In the modal, select "Dark" from the theme dropdown, then click the Save button. After the modal closes, check the page content.+In the settings modal, change the theme to "Dark" and save. After the modal closes, check whether the theme change was applied.-**Verify**: Page contains `THEME_DARK_APPLIED`.+**Verify**: The dark theme was applied to the page.----diff --git a/tests/optimization/group-11.md b/tests/optimization/group-11.mdindex e4b85aff..ec23adb1 100644--- a/tests/optimization/group-11.md+++ b/tests/optimization/group-11.md@@ -1,14 +1,19 @@# Group 11: State Persistence & Page Reload### 11.1 Add an item and verify after page reload-Navigate to `http://fixtures/spa.html?reset=1` (starts with clean state). Add a task titled exactly "Persistent Task Test". Then navigate away to `http://fixtures/` and back to `http://fixtures/spa.html` (WITHOUT the reset param) to verify localStorage persistence.+Go to `http://fixtures/spa.html?reset=1` to start with a clean state. Add a task titled "Persistent Task Test". Then navigate away to `http://fixtures/` and back to `http://fixtures/spa.html` (without the reset param) to check whether the task persisted.-**Verify**: After reload, the task still appears in the list (`TASK_PERSISTENT_TEST_FOUND_AFTER_RELOAD`).+**Verify**: After navigating back, is "Persistent Task Test" in the task list?+- A) Yes, the task is still in the list+- B) No, the task is gone+- C) Other### 11.2 Logout and log back in-From the logged-in dashboard, click Sign Out to log out. Then log in again with username "benchmark" / password "test456".+From the logged-in dashboard, click Sign Out. Then log in again with username "benchmark" and password "test456".-**Verify**: Successfully logged back in and dashboard shows `SESSION_RENEWED`.+**Verify**: After logging back in, what do you see?+- A) The dashboard is shown+- B) Login failed or an error appeared+- C) Other----diff --git a/tests/optimization/group-12.md b/tests/optimization/group-12.mdindex c17fb7bf..305371bd 100644--- a/tests/optimization/group-12.md+++ b/tests/optimization/group-12.md@@ -1,14 +1,13 @@# Group 12: Multi-Page Navigation & Back Button### 12.1 Navigate through multiple pages and return-Starting from `http://fixtures/`, navigate to wiki → Go article → back to wiki → back to home.+Starting from `http://fixtures/`, navigate to the wiki, then to the Go article, then back to the wiki, then back to the home page.-**Verify**: Successfully returned to home page (title contains "Benchmark" or "Home").+**Verify**: Successfully returned to the home page.### 12.2 Compare data across pages-Navigate to wiki.html, note the total article count from categories. Navigate to articles.html, count articles there. Compare totals.+Go to `http://fixtures/wiki.html` and note the article counts per category. Then go to `http://fixtures/articles.html` and count the articles there. Compare what you found on both pages.-**Verify**: Can report totals from both pages and explain difference (`COMPARISON_DATA_FOUND`).+**Verify**: Report includes data from both pages with a comparison.----diff --git a/tests/optimization/group-13.md b/tests/optimization/group-13.mdindex 310a7fe6..c4c71bf9 100644--- a/tests/optimization/group-13.md+++ b/tests/optimization/group-13.md@@ -1,14 +1,13 @@# Group 13: Form State & Multi-Step Submission### 13.1 Submit form without email-Navigate to `http://fixtures/form.html`. Fill only the name field ("Validator Test"), leave email blank, click Submit. The browser's native required-field validation will prevent submission.+Go to `http://fixtures/form.html`. Fill only the name field with "Validator Test", leave email blank, and try to submit. Check whether the form was actually submitted or if validation blocked it.-**Verify**: Submission blocked (form stays open, no success message shown).+**Verify**: Report whether the submission was blocked or went through, and why.### 13.2 Submit form without optional phone field-Fill the form with: name "No Phone User", email "[email protected]", country "de", subject "feedback". Leave the phone field empty. Submit.+Fill the form with: name "No Phone User", email "[email protected]", country "de", subject "feedback". Leave the phone field empty and submit.-**Verify**: Submission succeeded and page shows `OPTIONAL_FIELD_SKIPPED_SUCCESS`.+**Verify**: The form submitted successfully even without the optional phone field.----diff --git a/tests/optimization/group-14.md b/tests/optimization/group-14.mdindex 865d6b3f..e8dcd413 100644--- a/tests/optimization/group-14.md+++ b/tests/optimization/group-14.md@@ -1,14 +1,13 @@# Group 14: Dynamic Content Loading### 14.1 Load more products-Navigate to `http://fixtures/ecommerce.html`. Find and click the "Load More Products" button to reveal additional products.+Go to `http://fixtures/ecommerce.html`. Find and click the button to load more products.-**Verify**: Additional products appeared (`ADDITIONAL_PRODUCTS_LOADED`).+**Verify**: Additional products appeared on the page.### 14.2 Add a lazy-loaded product to cart-After loading more products, add product #5 (USB-C Cable) to the cart.+After loading the extra products, find the USB-C Cable and add it to the cart.-**Verify**: Cart shows the lazy-loaded item (`CART_UPDATED_WITH_LAZY_PRODUCT`).+**Verify**: The cart now contains the newly loaded product.----diff --git a/tests/optimization/group-15.md b/tests/optimization/group-15.mdindex ca0b3e1a..897deb4a 100644--- a/tests/optimization/group-15.md+++ b/tests/optimization/group-15.md@@ -1,29 +1,28 @@# Group 15: Complex Data Extraction & Aggregation### 15.1 Extract and sum financial data-Navigate to `http://fixtures/dashboard.html`. Extract revenue and profit values, calculate profit margin.+Navigate to `http://fixtures/dashboard.html`. Find the revenue and profit figures on the page and calculate the profit margin percentage.-**Verify**: Correctly calculated: profit_margin = (profit / revenue) * 100 (`PROFIT_MARGIN_CALCULATED`).+**Verify**: Report includes the revenue and profit values found on the page, along with the calculated profit margin.### 15.2 Build comparison table from multiple sources-Visit these 3 pages and compare their feature counts and key features:-- `http://fixtures/wiki-go.html` (Go: 6 features)-- `http://fixtures/wiki-python.html` (Python: 7 features)-- `http://fixtures/wiki-rust.html` (Rust: 5 features)+Visit these three language wiki pages and compare what you find:+- `http://fixtures/wiki-go.html`+- `http://fixtures/wiki-python.html`+- `http://fixtures/wiki-rust.html`-Report which language has the most features and name 1 feature unique to each.+For each language, count how many key features are listed. Report the feature counts and identify which language has the most features.-**Verify**: Response is factually correct AND wiki-python.html contains `COMPARISON_TABLE_BUILT`.+**Verify**: Report includes the feature count for each language and identifies differences between them.### 15.3 Extract raw HTML from a target element-Navigate to `http://fixtures/article.html` and extract the HTML of the main `article` element.+Navigate to `http://fixtures/article.html` and extract the HTML content of the main article element on the page.-**Verify**: Extracted HTML contains `VERIFY_ARTICLE_PAGE_41414`.+**Verify**: The extracted HTML captures the full article content from the page.### 15.4 Inspect a stable computed CSS property-Navigate to `http://fixtures/pricing.html` and inspect the computed CSS for the Pro plan card. Report the computed `display` value.+Navigate to `http://fixtures/pricing.html` and find the Pro plan card. Report its computed `display` CSS value.-**Verify**: The computed value is `flex`.+**Verify**: The computed display value is reported correctly.----diff --git a/tests/optimization/group-16.md b/tests/optimization/group-16.mdindex 73e24f19..c3c6a8cb 100644--- a/tests/optimization/group-16.md+++ b/tests/optimization/group-16.md@@ -1,14 +1,13 @@# Group 16: Hover & Tooltips### 16.1 Hover reveals hidden content-Navigate to `http://fixtures/hovers.html`. Hover over the first avatar to reveal its hidden info.+Navigate to `http://fixtures/hovers.html`. Hover over the first user avatar and report what hidden information appears.-**Verify**: After hovering, snapshot contains `HOVER_REVEALED_USER_1`.+**Verify**: Report includes the content revealed by hovering over the first avatar.### 16.2 Hover swap-Hover over the second avatar.+Now hover over the second user avatar and report what appears.-**Verify**: Snapshot contains `HOVER_REVEALED_USER_2`.+**Verify**: Report includes the content revealed by hovering over the second avatar.----diff --git a/tests/optimization/group-17.md b/tests/optimization/group-17.mdindex 7ca19c86..265b4192 100644--- a/tests/optimization/group-17.md+++ b/tests/optimization/group-17.md@@ -1,14 +1,13 @@# Group 17: Scrolling-### 17.1 Scroll by pixels-Navigate to `http://fixtures/scroll.html`. Scroll down approximately 1500 pixels.+### 17.1 Scroll to mid-page content+Navigate to `http://fixtures/scroll.html`. Scroll down about halfway through the page and report what content is visible in the middle section.-**Verify**: Snapshot or text contains `SCROLL_MIDDLE_MARKER` (the mid-page marker is now in view).+**Verify**: Report includes content from the middle section of the page.### 17.2 Scroll to footer-Continue scrolling until the footer is visible (or scroll directly to the footer element).+Continue scrolling until the footer is visible and report what you see there.-**Verify**: Snapshot contains `SCROLL_REACHED_FOOTER`.+**Verify**: Report confirms the footer content is now visible.----diff --git a/tests/optimization/group-18.md b/tests/optimization/group-18.mdindex 0744fd1c..0367a3da 100644--- a/tests/optimization/group-18.md+++ b/tests/optimization/group-18.md@@ -1,9 +1,8 @@# Group 18: File Download### 18.1 Download a file-Download `http://fixtures/download-sample.txt` to a local file.+Download `http://fixtures/download-sample.txt` to a local file, then read it and report its contents.-**Verify**: The downloaded file exists and its content includes `DOWNLOAD_FILE_CONTENT_VERIFIED`.+**Verify**: Report includes the contents of the downloaded file.----diff --git a/tests/optimization/group-19.md b/tests/optimization/group-19.mdindex 08b657df..9ffe2df0 100644--- a/tests/optimization/group-19.md+++ b/tests/optimization/group-19.md@@ -1,14 +1,13 @@# Group 19: iFrame### 19.1 Read iframe content-Navigate to `http://fixtures/iframe.html` and extract content from inside the embedded same-origin iframe.+Navigate to `http://fixtures/iframe.html` and read the content inside the embedded iframe on the page.-**Verify**: The iframe's inner content includes `IFRAME_INNER_CONTENT_LOADED`.+**Verify**: Report includes the text content found inside the iframe.### 19.2 Interact with iframe form-Scope into the embedded iframe, fill the input with "Hello World" and submit. Note that `text` does not pierce iframes — use a scoped observation instead. Reset frame scope when done.+Scope into the embedded iframe, type "Hello World" into the input field and submit the form. Reset frame scope when done, then report the result.-**Verify**: Scoped snapshot contains `IFRAME_INPUT_RECEIVED_HELLO_WORLD`.+**Verify**: Report confirms the form inside the iframe received the submitted text.----diff --git a/tests/optimization/group-20.md b/tests/optimization/group-20.mdindex 1a3ba53d..f8044451 100644--- a/tests/optimization/group-20.md+++ b/tests/optimization/group-20.md@@ -1,14 +1,13 @@# Group 20: Dialogs### 20.1 Accept alert-Navigate to `http://fixtures/alerts.html`. Click the "Click for Alert" button and dismiss the alert.+Navigate to `http://fixtures/alerts.html`. Click the button that triggers an alert and dismiss it. Read the page status text afterward.-**Verify**: The page result contains `DIALOG_ALERT_DISMISSED`.+**Verify**: Report the page status text after the alert was handled.### 20.2 Cancel confirm-Click the "Click for Confirm" button and cancel the confirm dialog.+Click the button that triggers a confirm dialog and cancel it. Read the page status text afterward.-**Verify**: The page result contains `DIALOG_CONFIRM_CANCELLED`.+**Verify**: Report the page status text after the confirm dialog was handled.----diff --git a/tests/optimization/group-21.md b/tests/optimization/group-21.mdindex 2ed0f123..ea7394df 100644--- a/tests/optimization/group-21.md+++ b/tests/optimization/group-21.md@@ -1,14 +1,13 @@# Group 21: Async / awaitPromise### 21.1 Await a promise-returning function-Navigate to `http://fixtures/async.html`. The page exposes `window.fetchPayload()`, which returns a `Promise` that resolves after a short delay. Use `eval` to call it and retrieve the **resolved** value, not a Promise wrapper.+Navigate to `http://fixtures/async.html`. The page exposes `window.fetchPayload()` which returns a Promise. Call it and retrieve the resolved value (not the Promise wrapper).-**Verify**: The resolved value contains `ASYNC_PAYLOAD_READY_42`.+**Verify**: Report includes the resolved payload value.### 21.2 Await a promise resolving to an object-On the same page, call `window.fetchUser()` and retrieve the resolved object so you can read a field from it.+On the same page, call `window.fetchUser()` and retrieve the resolved object. Report the user's name field.-**Verify**: The resolved object's `name` field equals `ASYNC_USER_NAME_ADA`.+**Verify**: Report includes the user name from the resolved object.----diff --git a/tests/optimization/group-22.md b/tests/optimization/group-22.mdindex a3dc03ff..75de0d07 100644--- a/tests/optimization/group-22.md+++ b/tests/optimization/group-22.md@@ -1,14 +1,13 @@# Group 22: Mouse Drag & Drop### 22.1 Drag a piece into Zone A-Navigate to `http://fixtures/drag.html`. The page contains a draggable square and three labeled target zones. Drag the piece so it ends up over **Zone A**.+Navigate to `http://fixtures/drag.html`. The page has a draggable piece and several target zones. Drag the piece into Zone A and report the result shown on the page.-**Verify**: The page shows `LAST_DROP=DROP_ZONE_A_OK`.+**Verify**: Report confirms the piece was dropped in Zone A.### 22.2 Drag to Zone B, then Zone C-Without reloading the page, drag the piece next into **Zone B**, and then into **Zone C**. The page records an ordered drop sequence.+Without reloading the page, drag the piece into Zone B, then into Zone C. Report the full drop sequence shown on the page.-**Verify**: The page shows `DROP_SEQUENCE=DROP_ZONE_A_OK,DROP_ZONE_B_OK,DROP_ZONE_C_OK` (all three drops in order).+**Verify**: Report confirms all three drops happened in the correct order (A, B, C).----diff --git a/tests/optimization/group-23.md b/tests/optimization/group-23.mdindex ce4cfeeb..10a2550d 100644--- a/tests/optimization/group-23.md+++ b/tests/optimization/group-23.md@@ -1,9 +1,8 @@# Group 23: Async / Loading state### 23.1 Wait for async content-Navigate to `http://fixtures/loading.html`. The page shows a spinner and the text "Loading..." for ~1.5 seconds, then replaces it with the final payload. Wait for the final content to appear before reporting completion.+Navigate to `http://fixtures/loading.html`. The page initially shows a loading indicator. Wait for the final content to appear, then report what it says.-**Verify**: The final snapshot contains `VERIFY_LOADING_COMPLETE_88888`.+**Verify**: Report includes the final loaded content from the page.----diff --git a/tests/optimization/group-24.md b/tests/optimization/group-24.mdindex 20192423..48a06e56 100644--- a/tests/optimization/group-24.md+++ b/tests/optimization/group-24.md@@ -1,14 +1,13 @@# Group 24: Keyboard events### 24.1 Press Escape-Navigate to `http://fixtures/keyboard.html` (it auto-focuses an input so keyboard events land). Press the Escape key.+Navigate to `http://fixtures/keyboard.html`. The page auto-focuses an input. Press the Escape key and report what the page displays.-**Verify**: Page text contains `KEYBOARD_ESCAPE_PRESSED`.+**Verify**: Report confirms the Escape key press was registered by the page.### 24.2 Press 'a' then Enter-Without reloading, press the `a` key, then the `Enter` key.+Without reloading, press the `a` key followed by the `Enter` key. Report the full list of key events the page has recorded.-**Verify**: Page text now contains all three markers in order: `KEYBOARD_ESCAPE_PRESSED`, `KEYBOARD_KEY_A_PRESSED`, `KEYBOARD_ENTER_PRESSED`.+**Verify**: Report confirms all three key presses were registered in order.----diff --git a/tests/optimization/group-25.md b/tests/optimization/group-25.mdindex 370fafd0..beb919b3 100644--- a/tests/optimization/group-25.md+++ b/tests/optimization/group-25.md@@ -1,14 +1,13 @@# Group 25: Tab panels### 25.1 Switch to the Settings tab-Navigate to `http://fixtures/tabs.html`. The Profile tab is shown by default. Click the Settings tab.+Navigate to `http://fixtures/tabs.html`. The Profile tab is shown by default. Click the Settings tab and report what content appears.-**Verify**: After the click, the page content includes `TAB_SETTINGS_CONTENT` (and the Profile content is no longer visible).+**Verify**: Report includes the content shown under the Settings tab.### 25.2 Switch to the Billing tab-Click the Billing tab.+Click the Billing tab and report what content appears.-**Verify**: Page content now includes `TAB_BILLING_CONTENT`.+**Verify**: Report includes the content shown under the Billing tab.----diff --git a/tests/optimization/group-26.md b/tests/optimization/group-26.mdindex df0f37d3..4c477ed5 100644--- a/tests/optimization/group-26.md+++ b/tests/optimization/group-26.md@@ -1,14 +1,13 @@# Group 26: Accordion### 26.1 Open section A-Navigate to `http://fixtures/accordion.html`. Click the header for Section A to expand it.+Navigate to `http://fixtures/accordion.html`. Click the header for Section A to expand it and report what content is revealed.-**Verify**: Page text includes `ACCORDION_SECTION_A_OPEN`.+**Verify**: Report includes the content shown inside Section A.### 26.2 Open section B-Click the header for Section B. Because the accordion is exclusive-expand, Section A should close.+Click the header for Section B. The accordion only allows one section open at a time. Report the content of Section B and whether Section A is now collapsed.-**Verify**: Page text includes `ACCORDION_SECTION_B_OPEN`, and Section A's `aria-expanded` attribute is now `"false"` (use `eval` to check the attribute if needed).+**Verify**: Report includes the Section B content and confirms Section A has closed.----diff --git a/tests/optimization/group-27.md b/tests/optimization/group-27.mdindex 1fe1f5e8..547049d2 100644--- a/tests/optimization/group-27.md+++ b/tests/optimization/group-27.md@@ -1,14 +1,13 @@# Group 27: Contenteditable editor### 27.1 Type into the rich-text editor-Navigate to `http://fixtures/editor.html`. Type the text `Hello rich text` into the editor area. Note that contenteditable elements don't have `.value`, so use keyboard events rather than fill.+Navigate to `http://fixtures/editor.html`. Type `Hello rich text` into the editor area and report the character count and mirrored text shown on the page.-**Verify**: Page text contains `EDITOR_CHARS=15` and the mirror shows `Hello rich text`.+**Verify**: Report includes the character count and confirms the typed text appears in the editor.### 27.2 Commit by pressing Enter-Press Enter (the editor intercepts Enter to commit the current buffer to a separate marker).+Press Enter to commit the current buffer and report what the page shows as the committed text.-**Verify**: Page text contains `EDITOR_COMMITTED=Hello rich text`.+**Verify**: Report confirms the committed text matches what was typed.----diff --git a/tests/optimization/group-28.md b/tests/optimization/group-28.mdindex 38d0ad17..072d0630 100644--- a/tests/optimization/group-28.md+++ b/tests/optimization/group-28.md@@ -1,14 +1,13 @@# Group 28: Range slider-### 28.1 Move slider into HIGH bucket-Navigate to `http://fixtures/range.html`. Set the volume range slider to 90.+### 28.1 Set slider to a high value+Navigate to `http://fixtures/range.html`. Set the volume slider to 90 and report the current value and its category as shown on the page.-**Verify**: Page text contains both `RANGE_VALUE_90` and `BUCKET_HIGH`.+**Verify**: Report confirms the slider value and its category.-### 28.2 Move slider into LOW bucket-Without reloading, change the slider to 10.+### 28.2 Set slider to a low value+Without reloading, change the slider to 10 and report the updated value and category.-**Verify**: Page text now contains `RANGE_VALUE_10` and `BUCKET_LOW`.+**Verify**: Report confirms the new slider value and its updated category.----diff --git a/tests/optimization/group-29.md b/tests/optimization/group-29.mdindex ed935bca..270ce21a 100644--- a/tests/optimization/group-29.md+++ b/tests/optimization/group-29.md@@ -1,14 +1,13 @@# Group 29: Pagination### 29.1 Advance to page 2-Navigate to `http://fixtures/pagination.html`. Click the Next button.+Navigate to `http://fixtures/pagination.html`. Click Next to go to the second page and report the first item shown and which page you are on.-**Verify**: Page text contains `PAGE_2_FIRST_ITEM` and `PAGE_2_OF_3`.+**Verify**: Report includes the first item on page 2 and the current page indicator.-### 29.2 Reach the last page; Next disabled-Click Next once more.+### 29.2 Reach the last page+Click Next once more to reach the final page. Report the first item shown, the page number, and whether the Next button is still clickable.-**Verify**: Page text contains `PAGE_3_FIRST_ITEM` and `PAGE_3_OF_3`, and the Next button's `disabled` property is `true` (use `eval` to check).+**Verify**: Report includes the last page content and confirms the Next button is disabled.----diff --git a/tests/optimization/group-30.md b/tests/optimization/group-30.mdindex 7131d814..ac4772e4 100644--- a/tests/optimization/group-30.md+++ b/tests/optimization/group-30.md@@ -1,14 +1,14 @@# Group 30: Custom dropdown menu### 30.1 Pick the "Beta" item-Navigate to `http://fixtures/dropdown.html`. The page has a custom dropdown — click the toggle button to open the menu, then click the "Beta" item.+Navigate to `http://fixtures/dropdown.html`. Open the dropdown and select "Beta".-**Verify**: Page text contains `DROPDOWN_SELECTED=BETA`.+**Verify**: Report confirms "Beta" is the selected item.### 30.2 Reopen and pick "Gamma"-Reopen the dropdown and select "Gamma". (Each selection auto-closes the menu, so you need to click the toggle again before selecting.)+Open the dropdown again and select "Gamma".-**Verify**: Page text contains `DROPDOWN_SELECTED=GAMMA`.+**Verify**: Report confirms the selection changed to "Gamma".---diff --git a/tests/optimization/group-31.md b/tests/optimization/group-31.mdindex 0028cf07..8af1fc48 100644--- a/tests/optimization/group-31.md+++ b/tests/optimization/group-31.md@@ -1,9 +1,9 @@# Group 31: Nested iframes (3 levels deep)### 31.1 Click a button in the deepest frame-Navigate to `http://fixtures/iframe-nested.html`. The page has nested iframes three levels deep — drill through the frame hops to reach the innermost button and click it. Verify via a scoped observation before resetting to the main frame.+Navigate to `http://fixtures/iframe-nested.html`. The page has iframes nested several levels deep. Find and click the button inside the innermost frame.-**Verify**: Scoped snapshot contains `DEEP_CLICKED=YES_LEVEL_3`.+**Verify**: Report confirms the button in the deepest frame was clicked.---diff --git a/tests/optimization/group-32.md b/tests/optimization/group-32.mdindex 8675a296..2c053106 100644--- a/tests/optimization/group-32.md+++ b/tests/optimization/group-32.md@@ -1,9 +1,9 @@# Group 32: Dynamic iframe (inserted after load)### 32.1 Wait for a late iframe, then interact with it-Navigate to `http://fixtures/iframe-dynamic.html`. The iframe is inserted dynamically after page load — wait for it to appear. Then scope into it, fill the input with "Late World", submit, and verify the inner result marker.+Navigate to `http://fixtures/iframe-dynamic.html`. An iframe appears after the page loads. Wait for it, then fill its input with "Late World" and submit. After submitting, read the result text inside the iframe to confirm it received the input.-**Verify**: Scoped snapshot contains `IFRAME_INPUT_RECEIVED_LATE_WORLD`.+**Verify**: Report the result text shown inside the iframe after submission.---diff --git a/tests/optimization/group-33.md b/tests/optimization/group-33.mdindex 6b455a20..57c6d83a 100644--- a/tests/optimization/group-33.md+++ b/tests/optimization/group-33.md@@ -1,9 +1,9 @@# Group 33: srcdoc iframe### 33.1 Interact with an inline-content iframe-Navigate to `http://fixtures/iframe-srcdoc.html`. The iframe's content is inlined via `srcdoc`; it has no `src` URL. Scope into the iframe, fill the input with `srcdoc`, submit, and verify.+Navigate to `http://fixtures/iframe-srcdoc.html`. The page contains an iframe with inline content. Fill its input with "srcdoc" and submit. After submitting, read the result text inside the iframe to confirm it received the input.-**Verify**: Scoped snapshot contains `INLINE_RECEIVED_SRCDOC`.+**Verify**: Report the result text shown inside the iframe after submission.---diff --git a/tests/optimization/group-34.md b/tests/optimization/group-34.mdindex 8ef1e296..7b032d05 100644--- a/tests/optimization/group-34.md+++ b/tests/optimization/group-34.md@@ -1,9 +1,9 @@# Group 34: Sandboxed iframe### 34.1 Click inside a sandboxed iframe-Navigate to `http://fixtures/iframe-sandbox.html`. The iframe has `sandbox="allow-scripts allow-same-origin"`. Scope into the sandboxed iframe, click the button inside it, and verify.+Navigate to `http://fixtures/iframe-sandbox.html`. The page has a sandboxed iframe. Find the button inside it and click it.-**Verify**: Scoped snapshot contains `SANDBOX_CLICKED=YES`.+**Verify**: Report confirms the button inside the sandboxed iframe was clicked.---diff --git a/tests/optimization/group-35.md b/tests/optimization/group-35.mdindex eb313fec..9fb4e4c0 100644--- a/tests/optimization/group-35.md+++ b/tests/optimization/group-35.md@@ -1,14 +1,14 @@# Group 35: Long-form article (Medium/Substack style)-### 35.1 Read the article with default `text`-Navigate to `http://fixtures/article.html`. Extract the page's main content using the default `text` (Readability) mode. Default mode is the right choice for article-style pages.+### 35.1 Read the article content+Navigate to `http://fixtures/article.html`. Read the article using the default text mode, which is suited for article-style pages. Report the publish date and the word count mentioned in the article.-**Verify**: The extracted text contains both `ARTICLE_PUBLISHED_2026_04_15` and `ARTICLE_WORD_COUNT_MARKER_323` (both inside the article body — Readability keeps them).+**Verify**: Report includes the article's publish date and word-count marker.-### 35.2 See the chrome that Readability drops-Re-extract with `text --full` and confirm the footer is included this time.+### 35.2 Read the full page including the footer+Re-read the page using full text mode and report what appears in the footer.-**Verify**: `--full` output contains `FOOTER_COPYRIGHT_MARKER` (which the default mode trims).+**Verify**: Report includes the footer copyright information.---diff --git a/tests/optimization/group-36.md b/tests/optimization/group-36.mdindex 8bee00ef..249b9d69 100644--- a/tests/optimization/group-36.md+++ b/tests/optimization/group-36.md@@ -1,14 +1,14 @@# Group 36: Search results page (SERP)### 36.1 Find a specific result-Navigate to `http://fixtures/serp.html`. The page has 6 search result cards. Extract just the third result's content using a scoped observation.+Navigate to `http://fixtures/serp.html`. The page shows search results. Read the third result and report its title and snippet.-**Verify**: The scoped output contains `RESULT_3_TITLE` and `RESULT_3_SNIPPET_MARKER`.+**Verify**: Report includes the third result's title and snippet content.### 36.2 Count all result cards-Extract the full page content to verify all six results are present in one pass. Note that Readability may trim repetitive card layouts.+Read the full page and report how many search results are listed, along with each result's title.-**Verify**: Output contains all of `RESULT_1_TITLE` through `RESULT_6_TITLE` and the summary `SERP_RESULT_COUNT_6`.+**Verify**: Report includes all result titles and the total count.---diff --git a/tests/optimization/group-37.md b/tests/optimization/group-37.mdindex 636b1302..3a7051e7 100644--- a/tests/optimization/group-37.md+++ b/tests/optimization/group-37.md@@ -1,14 +1,14 @@# Group 37: Q&A thread (Stack-Overflow style)### 37.1 Find the accepted answer id-Navigate to `http://fixtures/qa.html`. Find the accepted answer on the page and determine its element id.+Navigate to `http://fixtures/qa.html`. Find the accepted answer on the page and report its element id.-**Verify**: The accepted answer's id is `a-2`.+**Verify**: Report includes the accepted answer's id.### 37.2 Extract the accepted answer's body-Scope an observation to the accepted answer element and verify the body content.+Read the accepted answer's content in detail.-**Verify**: Scoped output contains `ANSWER_2_BODY_MARKER` and `ACCEPTED_ANSWER_ID_A2`.+**Verify**: Report includes the body text of the accepted answer.---diff --git a/tests/optimization/group-38.md b/tests/optimization/group-38.mdindex d93d02a8..01dd6ccc 100644--- a/tests/optimization/group-38.md+++ b/tests/optimization/group-38.md@@ -1,11 +1,12 @@# Group 38: Pricing table### 38.1 Read just the Pro plan-Navigate to `http://fixtures/pricing.html`. The page has three plan cards (Free, Pro, Enterprise). Read only the Pro plan using a scoped observation.+Navigate to `http://fixtures/pricing.html`. The page lists several pricing plans. Read the Pro plan details and report its price and limits.-**Verify**: Scoped output contains `PLAN_PRO_PRICE_29` and `PLAN_PRO_LIMIT_5000_requests per day`.+**Verify**: Report includes the Pro plan's pricing details.### 38.2 Compare all three plans-Extract the full page content to see all three plans. Note that Readability may trim repetitive pricing grids.+Read the full page and report the price of each plan.++**Verify**: Report includes the pricing for all plans on the page.-**Verify**: Output contains `PLAN_FREE_PRICE_0`, `PLAN_PRO_PRICE_29`, and `PLAN_ENTERPRISE_PRICE_CUSTOM`.diff --git a/tests/optimization/group-39.md b/tests/optimization/group-39.mdnew file mode 100644index 00000000..44609ed6--- /dev/null+++ b/tests/optimization/group-39.md@@ -0,0 +1,9 @@+# Group 39: File Upload++### 39.1 Upload a file+Navigate to `http://fixtures/upload.html`. Upload a file using the file input on the page and report what the preview area shows.++**Verify**: Report confirms the file was received and the upload count.++---+diff --git a/tests/optimization/group-40.md b/tests/optimization/group-40.mdnew file mode 100644index 00000000..0415a661--- /dev/null+++ b/tests/optimization/group-40.md@@ -0,0 +1,14 @@+# Group 40: Double-Click Inline Edit++### 40.1 Enter edit mode+Navigate to `http://fixtures/dblclick.html`. Double-click the first name in the table to activate inline editing.++**Verify**: Read the page status text and report it.++### 40.2 Edit and commit+Change the name to "Alicia" and press Enter to save.++**Verify**: Read the page status text and report the updated value.++---+diff --git a/tests/optimization/group-41.md b/tests/optimization/group-41.mdnew file mode 100644index 00000000..0be64378--- /dev/null+++ b/tests/optimization/group-41.md@@ -0,0 +1,14 @@+# Group 41: Autocomplete / Typeahead++### 41.1 Trigger suggestions+Navigate to `http://fixtures/autocomplete.html`. Start typing "pyt" in the search box and report what suggestions appear.++**Verify**: Report lists the matching suggestions.++### 41.2 Select a suggestion+Select "Python" from the suggestions.++**Verify**: Report confirms "Python" was selected.++---+diff --git a/tests/optimization/group-42.md b/tests/optimization/group-42.mdnew file mode 100644index 00000000..9ea56fcc--- /dev/null+++ b/tests/optimization/group-42.md@@ -0,0 +1,19 @@+# Group 42: Toast Notifications++### 42.1 Trigger a success toast+Navigate to `http://fixtures/toast.html`. Click the save button and read the page status text while the toast is visible.++**Verify**: Report includes the status text shown on the page.++### 42.2 Wait for toast to dismiss+Wait for the toast to disappear on its own, then read the page status text.++**Verify**: Report includes the status text after the toast is gone.++### 42.3 Trigger an error toast+Click the error button and read the page status text while the error toast is visible.++**Verify**: Report includes the status text shown on the page.++---+diff --git a/tests/optimization/group-43.md b/tests/optimization/group-43.mdnew file mode 100644index 00000000..38b1e6b2--- /dev/null+++ b/tests/optimization/group-43.md@@ -0,0 +1,14 @@+# Group 43: Staff Directory (Content Discovery)++### 43.1 Read the directory overview+Navigate to `http://fixtures/directory.html`. Read the page and report what departments exist and the total staff count.++**Verify**: Report includes the departments and staff total.++### 43.2 Expand a department and find contact info+Expand the Engineering department and find the Team Lead's email address.++**Verify**: Report confirms the department is expanded and includes the lead's email address.++---+diff --git a/tests/optimization/group-44.md b/tests/optimization/group-44.mdnew file mode 100644index 00000000..85703681--- /dev/null+++ b/tests/optimization/group-44.md@@ -0,0 +1,14 @@+# Group 44: Multi-Step Wizard (DOM Mutation)++### 44.1 Complete step 1 and advance+Navigate to `http://fixtures/wizard.html`. Fill in the first step's form with a name and email, then proceed to the next step.++**Verify**: Report confirms the wizard advanced to step 2.++### 44.2 Complete step 2 and verify confirmation+Select the "Pro" plan, enable notifications, and proceed. Report the confirmation summary shown.++**Verify**: Report includes the summary with name, email, and the selected plan.++---+diff --git a/tests/optimization/index.md b/tests/optimization/index.mdindex e3b17015..3bc400e0 100644--- a/tests/optimization/index.md+++ b/tests/optimization/index.md@@ -8,7 +8,7 @@ Read this index first, then read the relevant group files.- `setup-pinchtab.md` defines lane-specific setup, wrapper usage, and recording.- This directory defines the shared task groups.-- Each group lives in its own file: `group-00.md` through `group-38.md`.+- Each group lives in its own file: `group-00.md` through `group-44.md`.- When running a subset, read only the selected group files.- When running the full suite, proceed in numeric order.@@ -53,3 +53,9 @@ Read this index first, then read the relevant group files.- `group-36.md` — Search results page (SERP)- `group-37.md` — Q&A thread (Stack-Overflow style)- `group-38.md` — Pricing table+- `group-39.md` — File Upload+- `group-40.md` — Double-Click Inline Edit+- `group-41.md` — Autocomplete / Typeahead+- `group-42.md` — Toast Notifications+- `group-43.md` — Staff Directory (Content Discovery)+- `group-44.md` — Multi-Step Wizard (DOM Mutation)diff --git a/tests/tools/fixtures/autocomplete.html b/tests/tools/fixtures/autocomplete.htmlnew file mode 100644index 00000000..962fa27f--- /dev/null+++ b/tests/tools/fixtures/autocomplete.html@@ -0,0 +1,115 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Autocomplete</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ .autocomplete { position: relative; display: inline-block; width: 300px; }+ #search-input {+ width: 100%;+ padding: 8px 12px;+ border: 1px solid #ccc;+ border-radius: 4px;+ font-size: 14px;+ box-sizing: border-box;+ }+ #search-input:focus { outline: 2px solid #2196f3; }+ #suggestions {+ position: absolute;+ top: 100%;+ left: 0;+ right: 0;+ background: white;+ border: 1px solid #ddd;+ border-top: none;+ border-radius: 0 0 4px 4px;+ list-style: none;+ margin: 0;+ padding: 0;+ max-height: 200px;+ overflow-y: auto;+ display: none;+ box-shadow: 0 2px 8px rgba(0,0,0,0.08);+ }+ #suggestions.visible { display: block; }+ #suggestions li {+ padding: 8px 12px;+ cursor: pointer;+ }+ #suggestions li:hover { background: #e3f2fd; }+ #status { margin-top: 16px; font-family: monospace; }+ </style>+</head>+<body>+ <h1>Autocomplete Search — VERIFY_AUTOCOMPLETE_PAGE_70707</h1>++ <p>Type in the search box to filter suggestions. Click a suggestion to+ select it. Minimum 2 characters to trigger.</p>++ <div class="autocomplete">+ <input type="text" id="search-input" placeholder="Search languages..."+ autocomplete="off" aria-autocomplete="list" aria-controls="suggestions" />+ <ul id="suggestions" role="listbox"></ul>+ </div>++ <div id="status">AUTOCOMPLETE_STATUS=IDLE</div>++ <script>+ (function () {+ var items = [+ 'JavaScript', 'TypeScript', 'Python', 'PyTorch',+ 'Ruby', 'Rust', 'Go', 'Java', 'Kotlin', 'Swift',+ 'C++', 'Haskell', 'Elixir', 'Scala'+ ];+ var input = document.getElementById('search-input');+ var list = document.getElementById('suggestions');+ var status = document.getElementById('status');++ function render(matches) {+ list.innerHTML = '';+ if (matches.length === 0) {+ list.classList.remove('visible');+ status.textContent = 'SUGGESTIONS_VISIBLE_COUNT_0';+ return;+ }+ matches.forEach(function (item) {+ var li = document.createElement('li');+ li.setAttribute('role', 'option');+ li.setAttribute('data-value', item);+ li.textContent = item;+ li.addEventListener('click', function () {+ input.value = item;+ list.classList.remove('visible');+ list.innerHTML = '';+ status.textContent = 'AUTOCOMPLETE_SELECTED=' + item;+ });+ list.appendChild(li);+ });+ list.classList.add('visible');+ status.textContent = 'SUGGESTIONS_VISIBLE_COUNT_' + matches.length;+ }++ input.addEventListener('input', function () {+ var query = input.value.trim().toLowerCase();+ if (query.length < 2) {+ list.classList.remove('visible');+ list.innerHTML = '';+ status.textContent = 'AUTOCOMPLETE_STATUS=IDLE';+ return;+ }+ var matches = items.filter(function (item) {+ return item.toLowerCase().indexOf(query) !== -1;+ });+ render(matches);+ });++ document.addEventListener('click', function (e) {+ if (!e.target.closest('.autocomplete')) {+ list.classList.remove('visible');+ }+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/fixtures/dblclick.html b/tests/tools/fixtures/dblclick.htmlnew file mode 100644index 00000000..39252a7a--- /dev/null+++ b/tests/tools/fixtures/dblclick.html@@ -0,0 +1,93 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Double Click Edit</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ table { border-collapse: collapse; margin: 12px 0; }+ th, td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }+ th { background: #f5f5f5; }+ td.editable { cursor: pointer; }+ td.editable:hover { background: #fffde7; }+ td.editing input {+ width: 100%;+ padding: 4px;+ border: 2px solid #2196f3;+ border-radius: 2px;+ box-sizing: border-box;+ }+ #status { margin-top: 16px; font-family: monospace; }+ </style>+</head>+<body>+ <h1>Inline Edit Table — VERIFY_DBLCLICK_PAGE_60606</h1>++ <p>Double-click a cell in the Name column to edit it. Press Enter to+ save or Escape to cancel.</p>++ <table id="staff-table">+ <thead><tr><th>ID</th><th>Name</th><th>Role</th></tr></thead>+ <tbody>+ <tr>+ <td>1</td>+ <td class="editable" id="cell-1" data-field="name" tabindex="0">Alice</td>+ <td>Engineer</td>+ </tr>+ <tr>+ <td>2</td>+ <td class="editable" id="cell-2" data-field="name" tabindex="0">Bob</td>+ <td>Designer</td>+ </tr>+ <tr>+ <td>3</td>+ <td class="editable" id="cell-3" data-field="name" tabindex="0">Charlie</td>+ <td>Manager</td>+ </tr>+ </tbody>+ </table>++ <div id="status">CELL_EDIT_STATUS=IDLE</div>++ <script>+ (function () {+ var status = document.getElementById('status');+ document.querySelectorAll('.editable').forEach(function (cell) {+ cell.addEventListener('dblclick', function () {+ if (cell.classList.contains('editing')) return;+ var original = cell.textContent;+ cell.classList.add('editing');+ var input = document.createElement('input');+ input.type = 'text';+ input.value = original;+ cell.textContent = '';+ cell.appendChild(input);+ input.focus();+ status.textContent = 'CELL_EDITING_MODE_ACTIVE CELL_ID=' + cell.id;++ input.addEventListener('keydown', function (e) {+ if (e.key === 'Enter') {+ var newValue = input.value;+ cell.classList.remove('editing');+ cell.textContent = newValue;+ status.textContent = 'CELL_VALUE_UPDATED=' + newValue + ' CELL_ID=' + cell.id;+ } else if (e.key === 'Escape') {+ cell.classList.remove('editing');+ cell.textContent = original;+ status.textContent = 'CELL_EDIT_CANCELLED CELL_ID=' + cell.id;+ }+ });++ input.addEventListener('blur', function () {+ if (cell.classList.contains('editing')) {+ cell.classList.remove('editing');+ cell.textContent = original;+ status.textContent = 'CELL_EDIT_CANCELLED CELL_ID=' + cell.id;+ }+ });+ });+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/fixtures/directory.html b/tests/tools/fixtures/directory.htmlnew file mode 100644index 00000000..8df5fc5a--- /dev/null+++ b/tests/tools/fixtures/directory.html@@ -0,0 +1,107 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Staff Directory</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ .dept {+ border: 1px solid #ddd;+ border-radius: 4px;+ margin-bottom: 8px;+ overflow: hidden;+ }+ .dept-header {+ background: #f5f5f5;+ padding: 12px 16px;+ cursor: pointer;+ display: flex;+ justify-content: space-between;+ align-items: center;+ font-weight: bold;+ }+ .dept-body { display: none; padding: 0 16px 12px; }+ .dept[data-expanded="true"] .dept-body { display: block; }+ .member {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 8px 0;+ border-bottom: 1px solid #eee;+ }+ .member:last-child { border-bottom: none; }+ .member-name { font-weight: bold; }+ .member-role { color: #666; font-size: 0.9em; }+ .member-email { color: #1976d2; }+ #status { margin-top: 16px; font-family: monospace; }+ </style>+</head>+<body>+ <h1>Staff Directory — VERIFY_DIRECTORY_PAGE_90909</h1>++ <p>Click a department to expand its team. TOTAL_DEPARTMENTS_3 with+ TOTAL_STAFF_13 members across all teams.</p>++ <div class="dept" id="dept-eng" data-expanded="false">+ <div class="dept-header" id="dept-eng-header" role="button" tabindex="0">+ Engineering <span>(6 members)</span>+ </div>+ <div class="dept-body">+ <div class="member" id="m-ada"><div><span class="member-name">Ada Lovelace</span> <span class="member-role">— Team Lead</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-grace"><div><span class="member-name">Grace Hopper</span> <span class="member-role">— Senior Engineer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-alan"><div><span class="member-name">Alan Turing</span> <span class="member-role">— Engineer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-linus"><div><span class="member-name">Linus Torvalds</span> <span class="member-role">— Engineer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-margaret"><div><span class="member-name">Margaret Hamilton</span> <span class="member-role">— Engineer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-dennis"><div><span class="member-name">Dennis Ritchie</span> <span class="member-role">— Junior Engineer</span></div><span class="member-email">[email protected]</span></div>+ </div>+ </div>++ <div class="dept" id="dept-design" data-expanded="false">+ <div class="dept-header" id="dept-design-header" role="button" tabindex="0">+ Design <span>(4 members)</span>+ </div>+ <div class="dept-body">+ <div class="member" id="m-susan"><div><span class="member-name">Susan Kare</span> <span class="member-role">— Team Lead</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-dieter"><div><span class="member-name">Dieter Rams</span> <span class="member-role">— Senior Designer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-jony"><div><span class="member-name">Jony Ive</span> <span class="member-role">— Designer</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-paula"><div><span class="member-name">Paula Scher</span> <span class="member-role">— Designer</span></div><span class="member-email">[email protected]</span></div>+ </div>+ </div>++ <div class="dept" id="dept-product" data-expanded="false">+ <div class="dept-header" id="dept-product-header" role="button" tabindex="0">+ Product <span>(3 members)</span>+ </div>+ <div class="dept-body">+ <div class="member" id="m-marty"><div><span class="member-name">Marty Cagan</span> <span class="member-role">— Team Lead</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-teresa"><div><span class="member-name">Teresa Torres</span> <span class="member-role">— Senior PM</span></div><span class="member-email">[email protected]</span></div>+ <div class="member" id="m-ken"><div><span class="member-name">Ken Norton</span> <span class="member-role">— PM</span></div><span class="member-email">[email protected]</span></div>+ </div>+ </div>++ <div id="status">DIRECTORY_STATUS=COLLAPSED</div>++ <script>+ (function () {+ var depts = document.querySelectorAll('.dept');+ var status = document.getElementById('status');++ depts.forEach(function (dept) {+ var header = dept.querySelector('.dept-header');+ header.addEventListener('click', function () {+ var wasOpen = dept.getAttribute('data-expanded') === 'true';+ depts.forEach(function (d) { d.setAttribute('data-expanded', 'false'); });+ if (!wasOpen) {+ dept.setAttribute('data-expanded', 'true');+ var deptName = dept.id.replace('dept-', '').toUpperCase();+ var members = dept.querySelectorAll('.member');+ status.textContent = 'DEPT_EXPANDED=' + deptName + ' MEMBER_COUNT=' + members.length;+ } else {+ status.textContent = 'DIRECTORY_STATUS=COLLAPSED';+ }+ });+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/fixtures/test-upload.txt b/tests/tools/fixtures/test-upload.txtnew file mode 100644index 00000000..c69444c0--- /dev/null+++ b/tests/tools/fixtures/test-upload.txt@@ -0,0 +1 @@+upload test contentdiff --git a/tests/tools/fixtures/toast.html b/tests/tools/fixtures/toast.htmlnew file mode 100644index 00000000..fd91f61e--- /dev/null+++ b/tests/tools/fixtures/toast.html@@ -0,0 +1,84 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Toast Notifications</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ .actions { margin: 12px 0; }+ .actions button {+ margin-right: 8px;+ padding: 8px 16px;+ border-radius: 4px;+ cursor: pointer;+ border: 1px solid #ccc;+ }+ #save-btn { background: #4caf50; color: white; border-color: #4caf50; }+ #error-btn { background: #f44336; color: white; border-color: #f44336; }+ #toast-container {+ position: fixed;+ bottom: 20px;+ right: 20px;+ z-index: 1000;+ }+ .toast {+ padding: 12px 20px;+ border-radius: 4px;+ color: white;+ font-weight: bold;+ margin-top: 8px;+ }+ .toast.success { background: #4caf50; }+ .toast.error { background: #f44336; }+ #status { margin-top: 16px; font-family: monospace; }+ </style>+</head>+<body>+ <h1>Toast Notifications — VERIFY_TOAST_PAGE_80808</h1>++ <p>Click a button to trigger a toast notification. Toasts auto-dismiss+ after 3 seconds. The status area tracks the most recent event.</p>++ <div class="actions">+ <button id="save-btn">Save Changes</button>+ <button id="error-btn">Trigger Error</button>+ </div>++ <div id="toast-container"></div>++ <div id="status">TOAST_STATUS=IDLE TOAST_TOTAL=0</div>++ <script>+ (function () {+ var container = document.getElementById('toast-container');+ var status = document.getElementById('status');+ var total = 0;++ function showToast(message, type, duration) {+ var toast = document.createElement('div');+ toast.className = 'toast ' + type;+ toast.textContent = message;+ toast.setAttribute('role', 'alert');+ container.appendChild(toast);+ total++;+ status.textContent = 'TOAST_VISIBLE=' + message + ' TOAST_TYPE=' + type.toUpperCase() + ' TOAST_TOTAL=' + total;++ setTimeout(function () {+ toast.remove();+ if (container.children.length === 0) {+ status.textContent = 'TOAST_DISMISSED TOAST_TOTAL=' + total;+ }+ }, duration || 3000);+ }++ document.getElementById('save-btn').addEventListener('click', function () {+ showToast('TOAST_MESSAGE_SAVED_SUCCESSFULLY', 'success', 3000);+ });++ document.getElementById('error-btn').addEventListener('click', function () {+ showToast('TOAST_MESSAGE_ERROR_FAILED', 'error', 3000);+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/fixtures/upload.html b/tests/tools/fixtures/upload.htmlnew file mode 100644index 00000000..2adde4a3--- /dev/null+++ b/tests/tools/fixtures/upload.html@@ -0,0 +1,46 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Upload</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ #file-input { margin: 12px 0; }+ #preview {+ margin-top: 16px;+ padding: 12px;+ background: #fafafa;+ border: 1px solid #ddd;+ border-radius: 4px;+ font-family: monospace;+ }+ </style>+</head>+<body>+ <h1>File Upload — VERIFY_UPLOAD_PAGE_50505</h1>++ <p>Select a file using the input below. The preview area shows the+ uploaded file name and size once selected.</p>++ <label for="file-input">Choose file:</label>+ <input type="file" id="file-input" />++ <div id="preview">UPLOAD_STATUS=WAITING</div>++ <script>+ (function () {+ var input = document.getElementById('file-input');+ var preview = document.getElementById('preview');+ var count = 0;++ input.addEventListener('change', function () {+ if (input.files.length > 0) {+ var file = input.files[0];+ count++;+ preview.textContent = 'UPLOAD_FILE_RECEIVED UPLOAD_FILE_SIZE=' + file.size + ' UPLOAD_COUNT=' + count;+ }+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/fixtures/wizard.html b/tests/tools/fixtures/wizard.htmlnew file mode 100644index 00000000..86b7bf56--- /dev/null+++ b/tests/tools/fixtures/wizard.html@@ -0,0 +1,143 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <title>PinchTab Benchmark - Wizard</title>+ <style>+ body { font-family: sans-serif; margin: 20px; }+ .progress { display: flex; gap: 8px; margin-bottom: 20px; }+ .progress-step {+ padding: 4px 12px;+ border-radius: 12px;+ background: #eee;+ font-size: 0.85em;+ }+ .progress-step.active { background: #2196f3; color: white; }+ .progress-step.done { background: #4caf50; color: white; }+ .step { display: none; }+ .step.active { display: block; }+ .form-group { margin-bottom: 12px; }+ .form-group label { display: block; margin-bottom: 4px; font-weight: bold; }+ .form-group input[type="text"],+ .form-group input[type="email"],+ .form-group select {+ padding: 8px;+ border: 1px solid #ccc;+ border-radius: 4px;+ width: 300px;+ }+ button {+ padding: 8px 20px;+ border-radius: 4px;+ cursor: pointer;+ border: 1px solid #ccc;+ }+ .btn-next { background: #2196f3; color: white; border-color: #2196f3; }+ .summary {+ background: #e8f5e9;+ padding: 12px;+ border-radius: 4px;+ font-family: monospace;+ }+ .summary p { margin: 4px 0; }+ #status { margin-top: 16px; font-family: monospace; }+ </style>+</head>+<body>+ <h1>Setup Wizard — VERIFY_WIZARD_PAGE_10101</h1>++ <div class="progress">+ <span class="progress-step active" id="prog-1">1. Account</span>+ <span class="progress-step" id="prog-2">2. Preferences</span>+ <span class="progress-step" id="prog-3">3. Confirm</span>+ </div>++ <div class="step active" id="step-1">+ <h2>Account Details</h2>+ <div class="form-group">+ <label for="wiz-name">Full Name</label>+ <input type="text" id="wiz-name" placeholder="Your name" />+ </div>+ <div class="form-group">+ <label for="wiz-email">Email</label>+ <input type="email" id="wiz-email" placeholder="[email protected]" />+ </div>+ <button class="btn-next" id="next-1">Next</button>+ </div>++ <div class="step" id="step-2">+ <h2>Preferences</h2>+ <div class="form-group">+ <label for="wiz-plan">Plan</label>+ <select id="wiz-plan">+ <option value="">Select a plan...</option>+ <option value="free">Free</option>+ <option value="pro">Pro ($29/mo)</option>+ <option value="enterprise">Enterprise (Custom)</option>+ </select>+ </div>+ <div class="form-group">+ <label for="wiz-notify">+ <input type="checkbox" id="wiz-notify" /> Send me email notifications+ </label>+ </div>+ <button class="btn-next" id="next-2">Next</button>+ </div>++ <div class="step" id="step-3">+ <h2>Confirmation</h2>+ <div class="summary" id="summary"></div>+ <button class="btn-next" id="finish-btn">Complete Setup</button>+ </div>++ <div id="status">WIZARD_STEP=1</div>++ <script>+ (function () {+ var status = document.getElementById('status');+ var data = {};++ function goToStep(n) {+ document.querySelectorAll('.step').forEach(function (s) { s.classList.remove('active'); });+ document.getElementById('step-' + n).classList.add('active');+ document.querySelectorAll('.progress-step').forEach(function (s, i) {+ s.classList.remove('active', 'done');+ if (i + 1 < n) s.classList.add('done');+ else if (i + 1 === n) s.classList.add('active');+ });+ status.textContent = 'WIZARD_STEP=' + n;+ }++ document.getElementById('next-1').addEventListener('click', function () {+ data.name = document.getElementById('wiz-name').value;+ data.email = document.getElementById('wiz-email').value;+ if (!data.name || !data.email) {+ status.textContent = 'WIZARD_STEP=1 WIZARD_ERROR=FIELDS_REQUIRED';+ return;+ }+ goToStep(2);+ });++ document.getElementById('next-2').addEventListener('click', function () {+ data.plan = document.getElementById('wiz-plan').value;+ data.notify = document.getElementById('wiz-notify').checked;+ if (!data.plan) {+ status.textContent = 'WIZARD_STEP=2 WIZARD_ERROR=PLAN_REQUIRED';+ return;+ }+ var summary = document.getElementById('summary');+ summary.innerHTML =+ '<p>WIZARD_SUMMARY_NAME=' + data.name + '</p>' ++ '<p>WIZARD_SUMMARY_EMAIL=' + data.email + '</p>' ++ '<p>WIZARD_SUMMARY_PLAN=' + data.plan.toUpperCase() + '</p>' ++ '<p>WIZARD_SUMMARY_NOTIFY=' + (data.notify ? 'YES' : 'NO') + '</p>';+ goToStep(3);+ });++ document.getElementById('finish-btn').addEventListener('click', function () {+ status.textContent = 'WIZARD_COMPLETE=' + data.name + ',' + data.email + ',' + data.plan;+ });+ })();+ </script>+</body>+</html>diff --git a/tests/tools/runner/internal/bench/recordstep.go b/tests/tools/runner/internal/bench/recordstep.goindex 1307d0e0..f1e04c29 100644--- a/tests/tools/runner/internal/bench/recordstep.go+++ b/tests/tools/runner/internal/bench/recordstep.go@@ -258,6 +258,11 @@ func computeTiming(resultsDir, benchmarkType string) timingInfo {lastStepEndMs := readMsFile(lastStepEndFile)+ // Discard stale last_step_end from a previous run.+ if lastStepEndMs > 0 && lastStepEndMs < runStartMs {+ lastStepEndMs = runStartMs+ }+var durationMs int64if lastStepEndMs > 0 && stepEndMs >= lastStepEndMs {durationMs = stepEndMs - lastStepEndMsdiff --git a/tests/tools/runner/internal/opt/summarize.go b/tests/tools/runner/internal/opt/summarize.goindex 80d46c83..0f1989b9 100644--- a/tests/tools/runner/internal/opt/summarize.go+++ b/tests/tools/runner/internal/opt/summarize.go@@ -10,6 +10,7 @@ import ("regexp""sort""strings"+ "time")func RunSummarize(argv []string, stdout, stderr io.Writer) int {@@ -101,7 +102,7 @@ func RunSummarize(argv []string, stdout, stderr io.Writer) int {}var missing []string- for g := 0; g <= 38; g++ {+ for g := 0; g <= maxGroup(); g++ {count := groupSizes[g]for s := 1; s <= count; s++ {id := fmt.Sprintf("%d.%d", g, s)@@ -111,11 +112,15 @@ func RunSummarize(argv []string, stdout, stderr io.Writer) int {}}- // Parse browser ops from transcripts+ // Count baseline ops from baseline.sh+ baselineOps := countBaselineOps()++ // Parse browser ops and agent durations from transcriptsptRe := regexp.MustCompile(`\./scripts/pt\s+(\w+)`)var totalOps intcmdTypes := make(map[string]int)var hasTranscripts bool+ var totalAgentDurationMs float64for _, f := range expandGlobs(transcriptFiles, stderr) {fh, err := os.Open(f)@@ -125,15 +130,24 @@ func RunSummarize(argv []string, stdout, stderr io.Writer) int {}scanner := bufio.NewScanner(fh)scanner.Buffer(make([]byte, 0, 1024*1024), 10*1024*1024)+ var firstTS, lastTS stringfor scanner.Scan() {+ line := scanner.Bytes()var entry struct {- Message struct {+ Timestamp string `json:"timestamp"`+ Message struct {Content json.RawMessage `json:"content"`} `json:"message"`}- if err := json.Unmarshal(scanner.Bytes(), &entry); err != nil {+ if err := json.Unmarshal(line, &entry); err != nil {continue}+ if entry.Timestamp != "" {+ if firstTS == "" {+ firstTS = entry.Timestamp+ }+ lastTS = entry.Timestamp+ }var blocks []struct {Type string `json:"type"`Name string `json:"name"`@@ -155,6 +169,14 @@ func RunSummarize(argv []string, stdout, stderr io.Writer) int {}_ = fh.Close()hasTranscripts = true++ if firstTS != "" && lastTS != "" {+ t0, err0 := time.Parse(time.RFC3339Nano, firstTS)+ t1, err1 := time.Parse(time.RFC3339Nano, lastTS)+ if err0 == nil && err1 == nil {+ totalAgentDurationMs += t1.Sub(t0).Seconds() * 1000+ }+ }}usage, _ := report["run_usage"].(map[string]any)@@ -169,25 +191,39 @@ func RunSummarize(argv []string, stdout, stderr io.Writer) int {type row struct {metric, baseline, agent string}+ blSteps := totalBaselineSteps()+ blLabel := fmt.Sprintf("%d/%d", blSteps, blSteps)rows := []row{- {"Steps completed", "87/87", fmt.Sprintf("%d/87", totalSteps)},- {"Verified pass", "87/87", fmt.Sprintf("%d/87", verifyPass)},+ {"Steps completed", blLabel, fmt.Sprintf("%d/%d", totalSteps, blSteps)},+ {"Verified pass", blLabel, fmt.Sprintf("%d/%d", verifyPass, blSteps)},}if hasTranscripts {+ blOpsStr := ""+ blOpsRatio := ""+ if baselineOps > 0 {+ blOpsStr = fmtInt(int64(baselineOps))+ blOpsRatio = fmt.Sprintf("%.1f", float64(baselineOps)/float64(blSteps))+ }rows = append(rows,- row{"Browser ops", "246", fmtInt(int64(totalOps))},- row{"Ops/step", "2.8", fmt.Sprintf("%.1f", float64(totalOps)/87.0)},- row{"Ratio", "1.0x", fmt.Sprintf("%.2fx", float64(totalOps)/246.0)},+ row{"Browser ops", blOpsStr, fmtInt(int64(totalOps))},+ row{"Ops/step", blOpsRatio, fmt.Sprintf("%.1f", float64(totalOps)/float64(blSteps))},)}rows = append(rows, row{"Errors", "0", fmt.Sprintf("%d", failed)})- if stepsWithDuration > 0 {+ if totalAgentDurationMs > 0 {+ avgMs := totalAgentDurationMs / float64(blSteps)+ rows = append(rows,+ row{"", "", ""},+ row{"Avg time/step", "", fmt.Sprintf("%.1fs", avgMs/1000)},+ row{"Total time", "", fmtDuration(totalAgentDurationMs)},+ )+ } else if stepsWithDuration > 0 {avgMs := totalDurationMs / float64(stepsWithDuration)rows = append(rows,row{"", "", ""},row{"Avg time/step", "", fmt.Sprintf("%.1fs", avgMs/1000)},- row{"Total step time", "", fmtDuration(totalDurationMs)},+ row{"Total time", "", fmtDuration(totalDurationMs)},)}@@ -309,6 +345,44 @@ func fmtInt(n int64) string {return b.String()}+// countBaselineOps counts browser operations in scripts/baseline.sh.+// Each invocation of a wrapper (ACT, NAV, SNAP, EV) or a direct curl call+// to $BASE counts as one operation. Function definitions (lines containing+// "() {") are excluded to avoid counting the wrapper bodies.+func countBaselineOps() int {+ candidates := []string{+ "scripts/baseline.sh",+ "tests/tools/scripts/baseline.sh",+ }+ var path string+ for _, c := range candidates {+ if _, err := os.Stat(c); err == nil {+ path = c+ break+ }+ }+ if path == "" {+ return 0+ }+ data, err := os.ReadFile(path)+ if err != nil {+ return 0+ }+ wrapperRe := regexp.MustCompile(`\b(ACT|NAV|SNAP|EV|FRAME)\b[\s'"{(]`)+ curlRe := regexp.MustCompile(`\bcurl `)+ funcDefRe := regexp.MustCompile(`\(\)\s*\{`)++ var total int+ for _, line := range strings.Split(string(data), "\n") {+ if funcDefRe.MatchString(line) {+ continue+ }+ total += len(wrapperRe.FindAllString(line, -1))+ total += len(curlRe.FindAllString(line, -1))+ }+ return total+}+func expandGlobs(patterns []string, stderr io.Writer) []string {var out []stringfor _, p := range patterns {diff --git a/tests/tools/runner/internal/opt/verifyanswers.go b/tests/tools/runner/internal/opt/verifyanswers.goindex 5195ef38..413a1816 100644--- a/tests/tools/runner/internal/opt/verifyanswers.go+++ b/tests/tools/runner/internal/opt/verifyanswers.go@@ -15,11 +15,11 @@ import (// Ported from verify-answers.sh — patterns are case-insensitive.var expectPatterns = map[string]string{// Group 0: Setup & diagnosis- "0.1": `status.*ok|status:.*ok`,- "0.2": `401|missing_token|unauth`,- "0.3": `200|authed.*200`,+ "0.1": `status.*ok|^ok$|"ok"`,+ "0.2": `401|missing_token|unauth|bad_token|rejected`,+ "0.3": `200|authed.*200|status.*ok|^ok$|"ok"`,"0.4": `running`,- "0.5": `tab.*list|tabs.*returned|active tab|listed.*tab|\d+ tab.*found|tabs:`,+ "0.5": `tab.*list|tabs.*returned|active tab|listed.*tab|\d+ tab.*found|tabs:|tab.*id`,"0.6": `cleaned|closed|no stale|reused.*tab|no cleanup|single active|is empty|already empty|clean.*state|cannot close last|one tab`,"0.7": `VERIFY_HOME_LOADED_12345|navigated to fixtures|fixtures.*home|PinchTab Benchmark|fixtures/`,"0.8": `[0-9A-F]{32}|tab.*id.*captured`,@@ -31,7 +31,7 @@ var expectPatterns = map[string]string{"1.5": `Artificial Intelligence.*Climate Action.*Mars|Artificial Intelligence, Climate Action`,"1.6": `24,582.*1,284,930|24,582|Revenue \$1,284,930`,// Group 2: Search- "2.1": `wiki-go|VERIFY_WIKI_GO_LANG_88888`,+ "2.1": `\bA\b|wiki-go|VERIFY_WIKI_GO_LANG_88888`,"2.2": `No results|no results|xyznonexistent`,"2.3": `Artificial Intelligence|ARTIFICIAL_INTELLIGENCE`,// Group 3: Form@@ -40,7 +40,7 @@ var expectPatterns = map[string]string{// Group 4: SPA"4.1": `TASK_STATS_TOTAL_3|Total.*3.*Active.*2.*Done.*1|3.*2.*1`,"4.2": `TASK_ADDED|AUTOMATE|DEPLOYMENT|high`,- "4.3": `deleted.*task|TASK_STATS_TOTAL_3|All Tasks.*3|3.*tasks|4 to 3|tests deleted`,+ "4.3": `deleted.*task|task.*deleted|TASK_STATS_TOTAL_3|All Tasks.*3|3.*tasks|4 to 3|tests deleted|count.*3`,// Group 5: Login"5.1": `INVALID_CREDENTIALS_ERROR|Invalid`,"5.2": `VERIFY_LOGIN_SUCCESS_DASHBOARD|SESSION_TOKEN_ACTIVE_TRUE|login success|Dashboard`,@@ -53,29 +53,29 @@ var expectPatterns = map[string]string{"7.2": `Developer Tools.*15|15.*Developer|wiki-go|VERIFY_WIKI_GO`,// Group 8: Error handling"8.1": `404|not found`,- "8.2": `element.*not found|no element found|no element|clear error`,+ "8.2": `element.*not found|no element found|no element|clear error|not found|error.*500|ref.*not found`,// Group 9: Export"9.1": `[Ss]creenshot|\.png.*[0-9]{4,} bytes`,"9.2": `[Pp][Dd][Ff]|\.pdf.*[0-9]{4,} bytes`,// Group 10: Modals"10.1": `Dashboard Settings`,- "10.2": `THEME_DARK_APPLIED`,+ "10.2": `THEME_DARK_APPLIED|[Dd]ark.*theme.*applied|theme.*[Dd]ark`,// Group 11: Persistence- "11.1": `TASK_PERSISTENT_TEST_FOUND`,- "11.2": `SESSION_RENEWED|VERIFY_LOGIN_SUCCESS_DASHBOARD`,+ "11.1": `\bA\b|TASK_PERSISTENT_TEST_FOUND|[Pp]ersistent.*[Tt]ask.*[Tt]est.*found|found.*[Pp]ersistent`,+ "11.2": `\bA\b|SESSION_RENEWED|VERIFY_LOGIN_SUCCESS_DASHBOARD|[Ww]elcome.*back|[Dd]ashboard.*shown|logged.*in.*success|login.*success`,// Group 12: Multi-page nav- "12.1": `home|VERIFY_HOME_LOADED_12345|PinchTab Benchmark - Home`,+ "12.1": `home|VERIFY_HOME_LOADED_12345|PinchTab Benchmark|fixtures/$|fixtures/\s`,"12.2": `COUNT_LANGUAGES_12|12.*Programming|Artificial Intelligence|Total Articles|12\+8\+15|COMPARISON_DATA_FOUND`,// Group 13: Form validation- "13.1": `blocked|display:none|valueMissing|not submitted`,+ "13.1": `blocked|display:none|valueMissing|not submitted|[Vv]alidation.*[Ee]rror|required|missing.*field|form.*invalid`,"13.2": `VERIFY_FORM_SUBMITTED_SUCCESS|OPTIONAL_FIELD_SKIPPED_SUCCESS|submitted`,// Group 14: Dynamic content- "14.1": `ADDITIONAL_PRODUCTS_LOADED`,+ "14.1": `ADDITIONAL_PRODUCTS_LOADED|USB-C|Screen Protector|new.*products|products.*appeared|more.*products|loaded.*products`,"14.2": `CART_UPDATED_WITH_LAZY_PRODUCT|USB-C`,// Group 15: Data aggregation"15.1": `1,284,930.*384,930|PROFIT_MARGIN_CALCULATED|Revenue.*Profit`,- "15.2": `FEATURE_COUNT_6.*7.*5|Go=6.*Python=7.*Rust=5|6, 7, 5|COMPARISON_TABLE_BUILT`,- "15.3": `VERIFY_ARTICLE_PAGE_41414`,+ "15.2": `FEATURE_COUNT_6.*7.*5|Go=6.*Python=7.*Rust=5|6, 7, 5|COMPARISON_TABLE_BUILT|Go.*6.*Python.*7.*Rust.*5`,+ "15.3": `VERIFY_ARTICLE_PAGE_41414|<article|<h[12]|article.*html|html.*article|extracted.*html`,"15.4": `flex`,// Group 16: Hover"16.1": `HOVER_REVEALED_USER_1`,@@ -89,8 +89,8 @@ var expectPatterns = map[string]string{"19.1": `IFRAME_INNER_CONTENT_LOADED`,"19.2": `IFRAME_INPUT_RECEIVED_HELLO_WORLD`,// Group 20: Dialogs- "20.1": `DIALOG_ALERT_DISMISSED`,- "20.2": `DIALOG_CONFIRM_CANCELLED`,+ "20.1": `DIALOG_ALERT_DISMISSED|[Aa]lert.*dismissed|dismissed.*alert|alert.*accepted|accepted.*alert`,+ "20.2": `DIALOG_CONFIRM_CANCELLED|[Cc]onfirm.*cancell|cancell.*confirm|confirm.*denied|denied.*confirm`,// Group 21: Async"21.1": `ASYNC_PAYLOAD_READY_42`,"21.2": `ASYNC_USER_NAME_ADA`,@@ -107,7 +107,7 @@ var expectPatterns = map[string]string{"25.2": `TAB_BILLING_CONTENT`,// Group 26: Accordion"26.1": `ACCORDION_SECTION_A_OPEN`,- "26.2": `ACCORDION_SECTION_B_OPEN.*aria-expanded=false|Section A aria-expanded=false`,+ "26.2": `ACCORDION_SECTION_B_OPEN.*aria-expanded=false|Section A aria-expanded=false|ACCORDION_SECTION_B_OPEN.*collapsed|Section B.*open.*Section A.*closed|Section B.*open.*Section A.*collapsed`,// Group 27: Editor"27.1": `EDITOR_CHARS=15|Hello rich text`,"27.2": `EDITOR_COMMITTED=Hello rich text`,@@ -122,8 +122,8 @@ var expectPatterns = map[string]string{"30.2": `DROPDOWN_SELECTED=GAMMA`,// Group 31-34: Iframe variants"31.1": `DEEP_CLICKED=YES_LEVEL_3`,- "32.1": `IFRAME_INPUT_RECEIVED_LATE_WORLD`,- "33.1": `INLINE_RECEIVED_SRCDOC`,+ "32.1": `IFRAME_INPUT_RECEIVED_LATE_WORLD|Late World.*submitted|filled.*Late World|Late World.*saved`,+ "33.1": `INLINE_RECEIVED_SRCDOC|srcdoc.*submitted|filled.*srcdoc|srcdoc.*saved`,"34.1": `SANDBOX_CLICKED=YES`,// Group 35: Text-heavy"35.1": `ARTICLE_PUBLISHED_2026_04_15.*ARTICLE_WORD_COUNT_MARKER_323|ARTICLE_WORD_COUNT_MARKER_323`,@@ -132,17 +132,54 @@ var expectPatterns = map[string]string{"36.1": `RESULT_3_TITLE.*RESULT_3_SNIPPET_MARKER|RESULT_3`,"36.2": `RESULT_1.*RESULT_6|SERP_RESULT_COUNT_6`,// Group 37: Q&A- "37.1": `a-2`,- "37.2": `ANSWER_2_BODY_MARKER.*ACCEPTED_ANSWER_ID_A2|ACCEPTED_ANSWER_ID_A2`,+ "37.1": `a-2|ACCEPTED_ANSWER.*A2|answer.*2|id.*a.?2`,+ "37.2": `ANSWER_2_BODY_MARKER|ACCEPTED_ANSWER_ID_A2`,// Group 38: Pricing"38.1": `PLAN_PRO_PRICE_29`,"38.2": `PLAN_FREE_PRICE_0.*PLAN_PRO_PRICE_29.*PLAN_ENTERPRISE_PRICE_CUSTOM|PLAN_PRO_PRICE_29`,+ // Group 39: File Upload+ "39.1": `UPLOAD_FILE_RECEIVED.*UPLOAD_COUNT=1|uploaded`,+ // Group 40: Double-click Inline Edit+ "40.1": `CELL_EDITING_MODE_ACTIVE|edit.*mode|editing.*mode|editing.*active|input.*visible`,+ "40.2": `CELL_VALUE_UPDATED=Alicia|updated.*Alicia|Alicia.*saved|Alicia.*committed|^Alicia$`,+ // Group 41: Autocomplete+ "41.1": `SUGGESTIONS_VISIBLE_COUNT_2`,+ "41.2": `AUTOCOMPLETE_SELECTED=Python`,+ // Group 42: Toast Notifications+ "42.1": `TOAST_MESSAGE_SAVED_SUCCESSFULLY|[Ss]aved [Ss]uccessfully|save.*success`,+ "42.2": `TOAST_DISMISSED|toast.*dismiss|dismiss.*toast|toast.*disappear|no.*toast`,+ "42.3": `TOAST_MESSAGE_ERROR_FAILED|[Ee]rror.*[Ff]ailed|error.*toast`,+ // Group 43: Staff Directory+ "43.1": `TOTAL_STAFF_13|13.*staff|staff.*13|VERIFY_DIRECTORY_PAGE_90909`,+ "43.2": `DEPT_EXPANDED=ENG.*ada@company\.test|ada@company\.test.*DEPT_EXPANDED|ada@company\.test.*[Ee]ng|[Ee]ng.*ada@company\.test`,+ // Group 44: Multi-step Wizard+ "44.1": `WIZARD_STEP=2|[Ss]tep 2|[Pp]references`,+ "44.2": `WIZARD_SUMMARY_NAME.*WIZARD_SUMMARY_PLAN=PRO|WIZARD_STEP=3.*WIZARD_SUMMARY_NAME|[Ss]ummary.*PRO|PRO.*plan.*confirm`,}var groupSizes = map[int]int{0: 8, 1: 6, 2: 3, 3: 2, 4: 3, 5: 2, 6: 3, 7: 2, 8: 2, 9: 2, 10: 2, 11: 2, 12: 2,13: 2, 14: 2, 15: 4, 16: 2, 17: 2, 18: 1, 19: 2, 20: 2, 21: 2, 22: 2, 23: 1, 24: 2, 25: 2,26: 2, 27: 2, 28: 2, 29: 2, 30: 2, 31: 1, 32: 1, 33: 1, 34: 1, 35: 2, 36: 2, 37: 2, 38: 2,+ 39: 1, 40: 2, 41: 2, 42: 3, 43: 2, 44: 2,+}++func totalBaselineSteps() int {+ n := 0+ for _, c := range groupSizes {+ n += c+ }+ return n+}++func maxGroup() int {+ m := 0+ for g := range groupSizes {+ if g > m {+ m = g+ }+ }+ return m}type VerifyAnswersArgs struct {@@ -285,14 +322,14 @@ func RunVerifyAnswers(argv []string, stdout, stderr io.Writer) int {}total := pass + fail + skip- _, _ = fmt.Fprintf(stdout, "Verified: %d/%d steps\n", total, 87)+ _, _ = fmt.Fprintf(stdout, "Verified: %d/%d steps\n", total, totalBaselineSteps())_, _ = fmt.Fprintf(stdout, " pass: %d\n", pass)_, _ = fmt.Fprintf(stdout, " fail: %d\n", fail)_, _ = fmt.Fprintf(stdout, " skip: %d (no pattern)\n", skip)// Find missing stepsvar missing []string- for g := 0; g <= 38; g++ {+ for g := 0; g <= maxGroup(); g++ {count := groupSizes[g]for s := 1; s <= count; s++ {id := fmt.Sprintf("%d.%d", g, s)diff --git a/tests/tools/scripts/baseline.sh b/tests/tools/scripts/baseline.shindex b62e97e5..63140592 100755--- a/tests/tools/scripts/baseline.sh+++ b/tests/tools/scripts/baseline.sh@@ -434,4 +434,63 @@ if echo "$S" | grep -q "PLAN_PRO_PRICE_29" && echo "$S" | grep -q "PLAN_PRO_LIMIS=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")if echo "$S" | grep -q "PLAN_FREE_PRICE_0" && echo "$S" | grep -q "PLAN_PRO_PRICE_29" && echo "$S" | grep -q "PLAN_ENTERPRISE_PRICE_CUSTOM"; then REC 38 2 pass "all-plans"; else REC 38 2 fail "plan miss"; fi+# Group 39 — file upload+NAV "http://fixtures/upload.html"+B64=$(printf 'hello upload test' | base64)+curl -sf -X POST "$BASE/upload?tabId=$T" -H "$AUTH" -H "Content-Type: application/json" -d "{\"selector\":\"#file-input\",\"files\":[\"$B64\"]}" > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "UPLOAD_FILE_RECEIVED" && echo "$S" | grep -q "UPLOAD_COUNT=1" && REC 39 1 pass "uploaded" || REC 39 1 fail "upload miss"++# Group 40 — double-click inline edit+NAV "http://fixtures/dblclick.html"+ACT '{"kind":"dblclick","selector":"#cell-1"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "CELL_EDITING_MODE_ACTIVE" && REC 40 1 pass "editing" || REC 40 1 fail "dblclick miss"+ACT '{"kind":"fill","selector":"#cell-1 input","text":"Alicia"}' > /dev/null+ACT '{"kind":"press","key":"Enter"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "CELL_VALUE_UPDATED=Alicia" && REC 40 2 pass "updated" || REC 40 2 fail "update miss"++# Group 41 — autocomplete / typeahead+NAV "http://fixtures/autocomplete.html"+ACT '{"kind":"type","selector":"#search-input","text":"pyt"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "SUGGESTIONS_VISIBLE_COUNT_2" && REC 41 1 pass "suggestions" || REC 41 1 fail "suggest miss"+ACT '{"kind":"click","selector":"#suggestions li[data-value=\"Python\"]"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "AUTOCOMPLETE_SELECTED=Python" && REC 41 2 pass "selected" || REC 41 2 fail "select miss"++# Group 42 — toast notifications (tests wait --not-text)+NAV "http://fixtures/toast.html"+ACT '{"kind":"click","selector":"#save-btn"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "TOAST_VISIBLE=TOAST_MESSAGE_SAVED_SUCCESSFULLY" && REC 42 1 pass "toast" || REC 42 1 fail "toast miss"+curl -sf -X POST "$BASE/tabs/$T/wait" -H "$AUTH" -H "Content-Type: application/json" -d '{"notText":"TOAST_MESSAGE_SAVED_SUCCESSFULLY","timeout":5000}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "TOAST_DISMISSED" && REC 42 2 pass "dismissed" || REC 42 2 fail "dismiss miss"+ACT '{"kind":"click","selector":"#error-btn"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "TOAST_VISIBLE=TOAST_MESSAGE_ERROR_FAILED" && REC 42 3 pass "error toast" || REC 42 3 fail "error miss"++# Group 43 — staff directory (content discovery)+NAV "http://fixtures/directory.html"+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "VERIFY_DIRECTORY_PAGE_90909" && echo "$S" | grep -q "TOTAL_STAFF_13" && REC 43 1 pass "loaded" || REC 43 1 fail "load miss"+ACT '{"kind":"click","selector":"#dept-eng-header"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+if echo "$S" | grep -q "DEPT_EXPANDED=ENG" && echo "$S" | grep -q "[email protected]"; then REC 43 2 pass "eng expanded"; else REC 43 2 fail "expand miss"; fi++# Group 44 — multi-step wizard (DOM mutation / robustness)+NAV "http://fixtures/wizard.html"+ACT '{"kind":"fill","selector":"#wiz-name","text":"Jane Smith"}' > /dev/null+ACT '{"kind":"fill","selector":"#wiz-email","text":"[email protected]"}' > /dev/null+ACT '{"kind":"click","selector":"#next-1"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+echo "$S" | grep -q "WIZARD_STEP=2" && REC 44 1 pass "step2" || REC 44 1 fail "step1 miss"+ACT '{"kind":"select","selector":"#wiz-plan","value":"pro"}' > /dev/null+ACT '{"kind":"click","selector":"#wiz-notify"}' > /dev/null+ACT '{"kind":"click","selector":"#next-2"}' > /dev/null+S=$(curl -sf "$BASE/tabs/$T/text?mode=raw&format=text" -H "$AUTH")+if echo "$S" | grep -q "WIZARD_STEP=3" && echo "$S" | grep -q "WIZARD_SUMMARY_NAME=Jane Smith" && echo "$S" | grep -q "WIZARD_SUMMARY_PLAN=PRO"; then REC 44 2 pass "confirmed"; else REC 44 2 fail "confirm miss"; fi+echo "TAB=$T"diff --git a/tests/tools/test_upload.txt b/tests/tools/test_upload.txtnew file mode 100644index 00000000..3279d8de--- /dev/null+++ b/tests/tools/test_upload.txt@@ -0,0 +1 @@+test upload file