Visual Verification
Use Playwright MCP to visually validate the implemented use case.
Unless the use case specifies a particular resolution, use 1920x1080 as the browser resolution.
Set up state cheaply — seed, don't click
The dominant cost of a Playwright run is setup clicks and large
browser_snapshot accessibility-tree dumps, not the assertions. Remove both:
- Seed, don't click. Running the app in the
local profile on an empty DB
seeds labelled DRAFT/SUBMITTED/APPROVED report fixtures via LocalReportSeeder,
so you log in and land directly on the screen under test — never click through
create → add line → save → submit just to reach a state. The fixtures, the
logins (form-stub, dev password expense), and the deep-link routes are in
docs/manual-verification.md.
- Deep-link with stable selectors. Navigate straight to the route and drive
elements by button text /
aria-label / stable name attributes rather than
browser_snapshot → find-ref → click loops. For the login form,
input[name="username"] / input[name="password"] + Enter submits without
hunting for the shadow-DOM submit button.
- Batch form entry with
browser_fill_form (one call, many fields) instead
of many browser_type calls.
- Don't re-verify behaviour the browserless tests (pyramid layer 3) already
cover — those assertions belong there. Screenshot only the unique visual
states.
- Scope any snapshot you do need (
depth, filename) rather than dumping the
full tree into context.
Steps
All the steps listed here must be done and all details are important. The goal is to be thorough instead of quick.
- Ensure the application is running, with the seeded fixtures present (see above)
- Navigate to every route defined in the use case's UI/Routes section
- Perform each step from the use case's main flow
- Take screenshots of key interaction points
- Validate the visual appearance according to the validation rules below
- Record results -- note any visual issues in the per-use-case checklist below
Validating Visual Appearance
The most important part is to verify what the user sees, i.e. a screenshot.
DOM, CSS rules etc can be used as helpers but the screenshot is what really matters.
- Layout matches expectations (spacing, alignment, sizing)
- Spacing & padding are consistent -- content has appropriate breathing room, no cramped or excessively spaced areas. Verify that nested layouts (e.g., AppLayout > VerticalLayout > card) don't double-up padding or collapse it.
Compare padding between similar views (e.g., all admin views should have the same content padding).
- Typography is readable and consistent
- Interactive elements are clearly identifiable
- Responsive behaviour works at common breakpoints (mobile, tablet, desktop)
- Text contrast and readability
- All text is clearly readable against its background (titles, labels, values, badges)
- Colored text (warning/error values, status badges) has sufficient contrast
- Elements that inherit from a different color scheme (e.g., dark sidebar vs light content) render correctly -- CSS custom properties like
var(--vaadin-background-color) may resolve differently depending on the inherited color scheme
- No backgrounds swallow their content text
1---2name: visual-verification3description: Visually verify an implemented use case using Playwright MCP. Use after implementing UI changes.4---56# Visual Verification78Use Playwright MCP to visually validate the implemented use case.910Unless the use case specifies a particular resolution, use **1920x1080** as the browser resolution.1112## Set up state cheaply — seed, don't click1314The dominant cost of a Playwright run is **setup clicks** and **large15`browser_snapshot` accessibility-tree dumps**, not the assertions. Remove both:1617- **Seed, don't click.** Running the app in the `local` profile on an empty DB18 seeds labelled DRAFT/SUBMITTED/APPROVED report fixtures via `LocalReportSeeder`,19 so you log in and land directly on the screen under test — never click through20 create → add line → save → submit just to reach a state. The fixtures, the21 logins (form-stub, dev password `expense`), and the deep-link routes are in22 [`docs/manual-verification.md`](../../../docs/manual-verification.md).23- **Deep-link with stable selectors.** Navigate straight to the route and drive24 elements by button text / `aria-label` / stable `name` attributes rather than25 `browser_snapshot` → find-ref → click loops. For the login form,26 `input[name="username"]` / `input[name="password"]` + **Enter** submits without27 hunting for the shadow-DOM submit button.28- **Batch form entry** with `browser_fill_form` (one call, many fields) instead29 of many `browser_type` calls.30- **Don't re-verify behaviour** the browserless tests (pyramid layer 3) already31 cover — those assertions belong there. Screenshot only the **unique visual32 states**.33- **Scope any snapshot you do need** (`depth`, `filename`) rather than dumping the34 full tree into context.3536## Steps3738All the steps listed here must be done and all details are important. The goal is to be thorough instead of quick.39401. Ensure the application is running, with the seeded fixtures present (see above)412. Navigate to every route defined in the use case's UI/Routes section423. Perform each step from the use case's main flow434. Take screenshots of key interaction points445. Validate the visual appearance according to the validation rules below456. Record results -- note any visual issues in the per-use-case checklist below4647## Validating Visual Appearance4849The most important part is to verify what the user sees, i.e. a screenshot.50DOM, CSS rules etc can be used as helpers but the screenshot is what really matters.51521. Layout matches expectations (spacing, alignment, sizing)532. Spacing & padding are consistent -- content has appropriate breathing room, no cramped or excessively spaced areas. Verify that nested layouts (e.g., AppLayout > VerticalLayout > card) don't double-up padding or collapse it.54Compare padding between similar views (e.g., all admin views should have the same content padding).553. Typography is readable and consistent564. Interactive elements are clearly identifiable575. Responsive behaviour works at common breakpoints (mobile, tablet, desktop)586. Text contrast and readability59 - All text is clearly readable against its background (titles, labels, values, badges)60 - Colored text (warning/error values, status badges) has sufficient contrast61 - Elements that inherit from a different color scheme (e.g., dark sidebar vs light content) render correctly -- CSS custom properties like `var(--vaadin-background-color)` may resolve differently depending on the inherited color scheme62 - No backgrounds swallow their content text