Skip to content

Agent visual verification: reporting extension, semantic snapshot, and skill (#114) - #115

Merged
jcgueriaud1 merged 2 commits into
masterfrom
issue-114
Jul 22, 2026
Merged

Agent visual verification: reporting extension, semantic snapshot, and skill (#114)#115
jcgueriaud1 merged 2 commits into
masterfrom
issue-114

Conversation

@jcgueriaud1

Copy link
Copy Markdown
Collaborator

Closes #114.

Adds an agent-oriented visual verification loop so AI coding agents can verify Vaadin UIs via one cheap DramaFinder batch run instead of dozens of Playwright MCP round-trips and large accessibility-tree dumps.

What's included

1. AgentReporting JUnit 5 extension

AfterTestExecutionCallback that fires before @AfterEach closes the page, so it captures the real failing state. On failure it writes to target/agent-report/ (Maven) or build/agent-report/ (Gradle):

  • failure.txt — assertion message + trimmed stack trace (drops JDK/JUnit/Spring frames, capped) + URL
  • failure.png — full-page screenshot at failure time
  • component-snapshot.txt — semantic snapshot (below)

2. VisualVerificationTest base class

Connects to an already-running app (no Spring boot-up — keeps iterations cheap), 1920×1080 viewport, shot(name) for deterministic numbered screenshots (01-…png, 02-…png), and open(path) relative to a configurable base URL (dramafinder.agent.baseUrl / DRAMAFINDER_BASE_URL, default localhost:8080). Carries @ExtendWith(AgentReporting.class). AgentReportProvider lets standalone @ExtendWith users expose their page; a reflection fallback finds a Page/AgentReport field otherwise.

3. ComponentSnapshot utility

Walks the light DOM for vaadin-* elements in one page.evaluate() and emits terse lines, e.g. vaadin-grid — 100 rows, columns [First Name, Last Name, Email], 1 selected, vaadin-combo-box "Category" = "Travel", notification: "Saved". Skips internal/structural tags and selection-overlay items.

4. Bundled skill

skills/visual-verification/SKILL.md (from the ticket's draft, adapted to the real API), plus .claude-plugin/plugin.json, a marketplace.json entry, and README docs.

Tests

AgentReportingIT (6 tests, all passing): grid snapshot content, exclusion of internal cell elements, numbered shot() output, the failure bundle, and — via a dynamic-proxy ExtensionContext — that the extension fires on failure and stays silent on success.

🤖 Generated with Claude Code

jcgueriaud1 and others added 2 commits July 21, 2026 21:26
…114)

Adds an agent-oriented visual verification loop so AI coding agents can
verify Vaadin UIs via one cheap batch test run instead of many Playwright
MCP round-trips.

- AgentReporting: JUnit 5 AfterTestExecutionCallback that, on failure,
  writes target/agent-report/{failure.txt, failure.png, component-snapshot.txt}
  before @AfterEach closes the page.
- VisualVerificationTest: base class (connects to an already-running app,
  1920x1080 viewport, numbered shot() screenshots, configurable base URL)
  plus AgentReportProvider for @ExtendWith users, with a reflection fallback.
- ComponentSnapshot: compact semantic summary of vaadin-* components, orders
  of magnitude smaller than an accessibility-tree dump.
- skills/visual-verification/SKILL.md + marketplace/plugin registration and
  README docs.
- AgentReportingIT covers the snapshot, screenshot numbering, failure bundle,
  and the extension wiring (fires on failure, silent on success).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n-playwright-test

- Drop the Java skeleton example; point to the vaadin-playwright-test skill for
  how to write the DramaFinder test.
- Prerequisite no longer prescribes run commands/profiles — the project knows
  how to run its app (defer to its README/CLAUDE.md/AGENTS.md).
- Replace the seeded/ui-flow verification-preferences machinery with a short
  'Reaching the state' note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jcgueriaud1
jcgueriaud1 merged commit 64aeee7 into master Jul 22, 2026
2 checks passed
@jcgueriaud1
jcgueriaud1 deleted the issue-114 branch July 22, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New skill visual verification

1 participant