Skip to main content

Verifying Web UI changes (Playwright + rich HTML report)

When you modify the Web UI (any Vue file under frontend/src/), verify it end-to-end with a Playwright sweep that captures screenshots and packages them into a self-contained HTML report. This is the same workflow used to verify Spec 046 v2 — see specs/046-local-first-onboarding/verification/ for a worked example.

The standing sweep (one command)​

The core-screen sweep is committed and scripted — run it before you hand-roll anything:

./scripts/run-web-smoke.sh --show-report # boots a throwaway instance, runs e2e/web-ui-sweep

The launcher builds ./mcpproxy if needed, serves a throwaway instance on 127.0.0.1:18080 under a freshly generated throwaway API key (your own MCPPROXY_API_KEY is deliberately ignored — the key ends up in report URLs and traces), installs Chromium from the committed e2e/web-ui-sweep/package-lock.json via npm ci, and runs e2e/web-ui-sweep/web-ui-sweep.spec.ts — servers list, server detail (+ security tab), tools page and search, activity log, settings — failing on uncaught page exceptions. Pass MCPPROXY_FIXTURE_PATH=$(go build -o /tmp/mcpfixture ./cmd/mcpfixture && echo /tmp/mcpfixture) to register a live stdio upstream so the server- and tool-dependent checks run instead of skipping. The HTML report lands in tmp/web-smoke-artifacts/playwright-report/.

Alongside it, e2e/web-ui-sweep/visual-a11y-sweep.spec.ts guards the appearance contract that the 2026-08 UX audit found broken: it walks every visible text node on the main screens in both shipped themes, resolves the effective foreground/background through a canvas (theme tokens are oklch(), so a naive rgb() parse silently measures nothing) and fails anything below WCAG AA; it also checks the 390/820/1440px layouts, accessible names on every form control, the activity log's aria-live region and caption, and the system-theme resolution. Same launcher, same environment variables.

e2e/web-ui-sweep/navigation-consistency.spec.ts guards the Spec 109 navigation contract (specs/109-ux-navigation-consistency): server row heights (FR-013, restated by Spec 134 FR-020); the header and sidebar at 1440/1100/900/390px in both themes (one header row, no horizontal scroll, no clipped control, the phone header holds exactly the drawer toggle, search icon, status pill, attention pill and +); the sidebar groups and order; the command palette (⌘K and /, no /index/search request until there is text, one debounced limit=8 request, Enter to Tools); the + Add menu (Server, Client, Token); every redirect keeping its query; and the link-map rows that must land filtered with no unfiltered REST request (SC-009). It runs in the same launcher and skips loudly, with a reason, where a fixture has no data for a row.

e2e/web-ui-sweep/shell-pr1.spec.ts guards the Spec 134 PR 1 shell (specs/134-webui-simplify): the first Tab lands on "Skip to content" and opens nothing; Tab through the header never opens the command palette, while the search button, Ctrl/Cmd+K and / do; at 390px the menu button opens the sidebar overlay, focus moves into it and stays there, Escape closes it and returns focus, and the closed overlay holds no tab stops; the footer links stay reachable in a disclosure; Add server is reachable at every header width; the theme menu works by keyboard; View as sits in each page's filter row, never in the header; the 390px header controls are fully visible, 44px tall and do not overlap, with no horizontal page scroll; a carried view-as value on a page with no scope shows a removable "not applied on this page" chip; and no shell or sidebar link leads to the not-found page.

e2e/web-ui-sweep/settings-pr8.spec.ts guards the Spec 134 PR 8 screens: Settings opens on General with the sections as a side list and, at 390px, a select; ?tab=security and ?focus= still land on their section; long field help shows a summary with the full text behind a button; the section's Save row sits below its last field and nothing paints over it; the profile editor's Save and Discard row sits after the tool rules; and neither page scrolls sideways at 390px.

e2e/web-ui-sweep/profiles-clients.spec.ts guards the Profiles v3 screens (specs/108-profiles-v3, PR 108-i). It needs the fixture upstream (MCPPROXY_FIXTURE_PATH) and seeds everything over REST (profiles-seed.ts: a read-only profile, anonymous_profile pointing at it so the binding guard is satisfied without turning authentication on, and a custom client; no supported client's config file is written), then cleans up after itself. It drives the goal flow (create a profile, Try it, mint a token with it, move a client with the chip), the binding-guard refusal and its fix buttons, rename with its impact list, "Explain access" landing on the focused editor row, the header Viewing chip surviving navigation and Back, the layout at 1440/1100/900/390px (no page-level horizontal scroll, header controls not clipped), a real Escape on every dialog with focus returning to its trigger, and an SSE-driven chip update with no reload. The same seed lets visual-a11y-sweep.spec.ts measure contrast (both themes), layout and accessible names on /profiles, /profiles/e2e-ro and /clients, including the danger-styled missing-profile chip.

e2e/web-ui-sweep/profiles-scope.spec.ts guards the profile scope on Tools, Activity, Sessions and Usage (specs/108-profiles-v3, PR 108-j). It extends profiles-seed.ts with one locked client on a profile that denies <fixture>:echo, then makes one allowed and one refused call over MCP with that client's credential (the fixture's tools are all read-only, so a deny rule is what makes the blocked row). It checks that /tools?client= renders no unfiltered rows before the scoped answer (the scoped request is held back for 1.5s), greyed rows with their reason words and the Why? explainer closed by a real Escape with focus returning to its trigger; that /usage?profile= carries the parameter and replaces the tokens-saved tile; that /sessions?client= lands on the Activity Sessions view with the client and profile columns and "Tools it sees"; that the chip survives a link and Back and removing it refetches unscoped; that /activity?client=&status=blocked shows exactly the refused call with its attribution chips, "Allow in profile…" (landing on the focused editor row) and "Why?"; the layout at 1440/1100/900/390px (no page-level horizontal scroll, chips inside the viewport, the drawer's Attribution section below md); and the Tab order to a chip's remove button and Why?. Screenshots are report attachments; SWEEP_SCREENSHOT_DIR also keeps them as files. visual-a11y-sweep.spec.ts measures contrast on the scoped Tools and Activity pages in both themes.

e2e/web-ui-sweep/profiles-unhide.spec.ts guards the Spec 108 un-hide of Spec 109 (specs/109-ux-navigation-consistency, PR 109-l). It reuses profiles-seed.ts and adds a run-unique agent token and a client credential that expires in 7 days (a revoked token keeps its name, so a fixed name would collide on a re-run). It checks that Profiles is in the sidebar and "+ Add → Profile" opens the create dialog; that the header Viewing chip survives Activity, Usage and Tools and Back restores it; that an expanded Clients row links Activity, Sessions, "Tools it sees" and Usage by client; that an agent-token row links Activity and Usage by token; that /servers?profile= lists only that profile's servers with a removable chip; that creating the expiring credential makes a client_credential_expiring needs-attention item appear within seconds, first in the list, whose fix lands on /clients?focus=<id>; the layout at 1440/900/390px (no page-level horizontal scroll, the fix button at least 24px tall); and the Tab order to the attention fix and each Clients-row link. The binding-guard item cannot be produced through the API (the API refuses a bypassable binding, 409), so its rendering is pinned by attention-108-targets.spec.ts and the live recipe instead.

e2e/web-ui-sweep/shell-pr1.spec.ts guards the Spec 134 shell (specs/134-webui-simplify, PR 1): the skip link as the first Tab stop, the palette never opening on Tab, the phone menu overlay, the footer disclosure, "Add server" in the header and "View as" in the page filter rows.

e2e/web-ui-sweep/servers-pr2.spec.ts guards the Spec 134 Servers table (PR 2, FR-020 to FR-026). It fulfils GET /api/v1/servers from a fixture (the list is data here; the shell, router, SSE and the embedded bundle are real), so the fleets are exact: 34 servers (28 usable, 6 enabled and not usable) must show at least 14 whole rows above the page footer at 1440x900 with all 6 unusable among them; 300 servers must show the first row within 2 s of navigation and a scripted scroll of the page's scroll container must collect exactly the fixture's ids; the filter chips count and write ?filter=, More filters keep Connected, Enabled, Quarantined and a legacy ?status= works; a menu item is reached and activated by Tab; and at 390x844 the rows stack with no sideways scroll, body controls are at least 44 px tall and a bare visit defaults to "Not online".

e2e/web-ui-sweep/home-pr4.spec.ts guards Spec 134 Home: section order, the attention list visible without scrolling at 1440x900 and 390x844 (SC-011), See all, the shortcuts and the collapsed topology by keyboard, 44 px buttons at 390 px. Run it against a fleet instance to exercise SC-011.

e2e/web-ui-sweep/activity-pr5.spec.ts guards the Activity calls view (Spec 134 PR 5, FR-045..FR-049). It needs the fixture upstream (SWEEP_SERVER_NAME) and seeds 50 calls over /mcp when the instance has fewer. It checks at 1280 px the five data columns plus the row-open column with no horizontal scroll and no clipped cell; the row detail opening by keyboard with focus inside and returning on Escape; the Sort control (ten options, five keys); Group repeats on by default and a stored off respected; the filter popover opening over the results without moving the first row, and the same results boundary with a chip, an empty result and no filter; at 390 px many long filters overflowing into a list that removes each, no sideways scroll except the chip row, every body button 44 px tall, and a full-width detail panel; the Sessions view and the /sessions redirect; and the dark theme. SWEEP_SCREENSHOT_DIR keeps PNGs.

e2e/web-ui-sweep/tools-pr6.spec.ts guards the Spec 134 Tools page: grouped default with exception labels, Details by keyboard, Only exceptions, More filters and ?risk=, Flat list and its sort keys, selection across a collapsed section, and the 390px layout. It fulfils the tool list itself, so it needs no fixture.

e2e/web-ui-sweep/clients-tokens-usage-pr7.spec.ts guards the Clients, agent-tokens and Usage changes of Spec 134 PR 7 (specs/134-webui-simplify). It reuses profiles-seed.ts and adds a run-unique token with its own server list. At 1280 px it checks that the Clients table has the columns Client, State, Reach, Last seen and one button per row with no horizontal scroll, that Manage opens by keyboard to a panel with the groups What it can use, How it connects, Key and a closed Disconnect or remove, and that a real Escape closes it and returns focus to Manage; that ?focus=<id> opens the panel and an explicit Tokens tab does not; that the tokens table has no horizontal scroll and no clipped cell, shows the badge Own server list and keeps Regenerate and Revoke; and at 390 px that Clients, the full-width panel and Tokens do not scroll sideways and their buttons are at least 44 px tall. It also checks that Usage shows its four charts with data at both widths. Screenshots are report attachments.

e2e/web-ui-sweep/sessions-timeline.spec.ts guards the work-session list and the failure timeline (specs/124-session-failure-timeline, PR-3). With the fixture upstream (SWEEP_SERVER_NAME) it seeds a named REST run (X-MCPProxy-Run) of twenty-eight call_tool_read attempts (twenty-four good calls, a refused call, a good call, a second refused call and a last good one), and a second run that fails before it and is active after it, then checks at 1280 px that "Failed only" lists the door's rows in the door's order (the two runs swap places between sort=last_failure and sort=last_activity), that "Include blocked" off removes both runs and on brings them back, and that the row's Timeline link (by keyboard) reach the FIRST failed row in two actions, on screen, with the same rows and position as the answer that filled the page and 20 rows before it, one row per call (no call_tool_* row), no sideways scroll, millisecond times, "failure N of M", the CLI command of the view, bodies requested only when a row is expanded, a step to the second failure, a reload that keeps the position, and Back returning to the filtered list; that the Calls count opens the Tool calls view with work_session_id on every request, and a call's detail opens the timeline at that row. An upstream event, a trimmed start and failures removed by retention cannot be produced on a throwaway instance on demand, so one timeline page is fulfilled from a fixture (the shell, router and bundle are real) to check that a call, an event, a failed call, a recovery and the session boundary each have their own surface (a block shares the amber of an event and differs from a call), that the event row sits directly above the failed call, the outline of the positioned row and that it moves with a failure step, the two retention notes, the failure steps and "load earlier", and that the filter strip is put away while a timeline is open. A fulfilled list row checks at 390, 1024, 1280 and 1440 px that the agent token, the project, the error class and the last failure to the millisecond are on screen and not cut. It also covers the "Session not found" state, the collapsed Client connections section, both screens at 390 px (no sideways scroll, 44 px controls, no clipped header or button) and the dark theme. SWEEP_SCREENSHOT_DIR keeps PNGs.

e2e/web-ui-sweep/demo-ux-fixes.spec.ts guards the two pixel-level findings of the live Web UI demo (Spec 108 T149 and T151). It seeds a profile titled Work Read-only for very long client names 2026 and a token pinned to it, then at 1440x900 and 900x900 checks that the token's Profile chip is a single line inside its table cell with the full title on hover (a Range over its text reports one line, and its scroll height does not exceed its client height), and that the radio labels of the create-profile, custom-client and bulk-move dialogs start within 16 px of their radios. It attaches screenshots to the report.

e2e/web-ui-sweep/usertest-web-fixes.spec.ts guards three findings of the first-run user test (Spec 109 T202 and T201, Spec 108 T169) at 1440x900 and 900x900: the header status pill says "awaiting review" for the sweep's quarantined server (compact form keeps the text in its title, no sideways scroll), a secret-like Manual-add env value is a password input with a Show toggle (never submitted), and profile Try it shows no [object Object], says it uses unsaved edits, and the tool counts read "Saved profile:" while a Deny toggle is unsaved. The wizard import flow is covered by vitest and live QA, because the smoke core uses the real HOME for client paths.

e2e/web-ui-sweep/server-oauth-card.spec.ts guards the OAuth card of Server Detail → Configuration. It seeds an HTTP server with an oauth block over REST (the upstream never has to answer, so it needs no fixture) and checks that the card shows the block with the client secret masked and never the secret itself, that an extra-parameter line without a name is refused in the form, that an edit saves through PATCH /api/v1/servers/{name} and the stored secret survives (GET renders the same mask), that the secret field is a password input with a Show toggle, that a different mask typed into the secret field is refused with nothing saved, that clearing every field saves an empty block instead of deleting it, and that Remove settings deletes the block only after its confirm dialog (Cancel keeps it). It deletes the server afterwards.

e2e/web-ui-sweep/client-oauth-consent.spec.ts guards the browser-login consent page (specs/132-client-oauth-login, PR-2a). The launcher starts the sweep core with MCPPROXY_MCP_OAUTH_ENABLED=true; against a core with browser login off the spec skips with a reason. A scripted public client registers, authorizes with PKCE and follows the redirect to /ui/authorize?request=<id>; the API key reaches the page through localStorage, never a URL. It checks the per-client address (fixed client, "All servers", approve, code and state returned, tools/list with the token), the generic address (a reported name of "Cursor" pre-selects the existing cursor client, switching to "New client" pre-fills id and name and leaves cursor unchanged, an unknown name selects "New client"), deny returning access_denied with the original state, the page without an API key (no detail request until a key is set), a markup-shaped client name shown as text, and that the page is never framed.

e2e/web-ui-sweep/connect-browser-login.spec.ts guards the Connect dialog's browser-login choice (specs/132-client-oauth-login); scripts/run-connect-sweep.sh runs it against scratch-HOME cores with the feature on and off. Connect writes real client config files under the core's HOME, so the spec skips unless MCPPROXY_SWEEP_SCRATCH_HOME=<absolute dir> names the scratch HOME, and it fails before any click unless the core reports its Claude Code config path inside that dir and serves (or, for SWEEP_BROWSER_LOGIN_OFF=1, does not serve) browser login (start it with HOME=<scratch> and {} as the content of .claude.json (the spec seeds its own content), .cursor/mcp.json and VS Code's mcp.json there: Library/Application Support/Code/User/mcp.json on macOS, .config/Code/User/mcp.json on Linux; a zero-byte file counts as malformed, and .claude.json must not be a symlink). With the feature on it checks the choice for Claude Code only, the diff showing the per-client address and no credential, Cancel leaving .claude.json unchanged, connect writing the address and no credential, and Undo restoring the original bytes; SWEEP_BROWSER_LOGIN_OFF=1 against a core with the feature off checks that no choice appears.

e2e/web-ui-sweep/skills-tab.spec.ts guards the Skills tab of Server Detail (specs/125-skills-over-mcp, PR-4a). It needs enable_skills and a skills-capable upstream, so it has its own launcher, scripts/run-skills-tab-sweep.sh:

./scripts/run-skills-tab-sweep.sh # results in tmp/skills-sweep/
./scripts/run-skills-tab-sweep.sh --out DIR --report-html specs/125-skills-over-mcp/verification/report.html --no-screenshots
./scripts/run-skills-tab-sweep.sh --self-test # no browser: the clean-environment, redaction and DEBUG=1 checks

It builds the frontend and the core from the checkout (or takes MCPPROXY_BINARY_PATH, which must embed the frontend) and cmd/skillsfixture (or SKILLS_FIXTURE_BINARY), starts the fixture and a throwaway core on free loopback ports with a scratch data dir (never ~/.mcpproxy: the core and the fixture start with a clean environment, env -i with only PATH, a scratch HOME and a scratch TMPDIR, so no MCPPROXY_* of the operator's reaches them (MCPPROXY_DATA_DIR would override the config's data_dir, MCPPROXY_AUDIT_LOG_PATH would audit into the operator's file), with --data-dir naming the scratch dir and a data dir under $HOME/.mcpproxy refused; --self-test proves decoys for the data dir, audit log, TPA bundle and certs paths are not touched, and that a DEBUG=1 run, which prints progress lines and never uses xtrace, does not print the API key), enable_skills: true, a generated API key and the fixture as a trust_mode: manual streamable-http upstream, approves the server, runs the spec, and stops only what it started. The scenarios run in order against fresh state: list, one-action SKILL.md viewing and keyboard focus return, full digests in File hashes, part-by-part paging, approve and expand Unchanged files, an upstream change to an approved skill while it is open (stale review, re-open, file diff, line diff, approve), an upstream change to a pending skill while it is open (stale review with Approve disabled, re-open), a change refreshed through the REST API that marks the open review stale through the live skills.changed event alone, block and unblock, reload with no page error, mixed and skill-only Review queue links filtering out the approved skill, immediate desktop detail beside the list, and compact keyboard opening with scan evidence before Approve, Read SKILL.md focusing the reader, and Back restoring row focus. The scenarios are one serial group with retries off (a retry would replay against state the first attempt changed). The API key reaches the page through localStorage, never a URL, and the spec records no traces. It writes skills-sweep-results.json (checked_commit = git rev-parse HEAD and working_tree_dirty, with a dirty tree labelled pre-commit evidence; the fixture command as basename and arguments and its port; each scenario's pass/fail with the first failed attempt's error; and GET /api/v1/servers/<name>/skills read back after the approve, block and unblock steps: status, blocked, available, current_hash, approved_hash), plus screenshots, and exits non-zero on any failure. Every text file it writes, and every message it prints that can carry a path or a log (including the fixture or core log dumped on a startup failure), has the API key replaced by *** and local paths by <repo>, <out>, <scratch> or ~ (paths inside the checkout are printed relative to it), the configured binary and browser paths and any other path whose first segment exists on the machine by <path>/<basename> (text whose root does not exist there, such as a regex literal /approved/i or a route /skills/refresh, is kept); --self-test checks the stdout and stderr of a passing run and of a forced fixture and core startup failure for the key and for absolute paths. The release gate runs it with --self-test-first in the advisory web-ui-sweep job, recorded as the advisory manifest entry advisory/skills-tab-sweep. The committed report is specs/125-skills-over-mcp/verification/report.html, written from a clean commit with --no-screenshots (no embedded screenshots); the copy with screenshots is for artifacts.

Manual fallback (to step through by hand): go run ./cmd/skillsfixture -addr 127.0.0.1:<port> (three skills; POST /_fixture/mutate?skill=&file= with the new bytes and the header X-Skills-Fixture: mutate changes one; a request with an Origin header or a Host other than the listen address is refused), a core with "enable_skills": true and the fixture as a trust_mode: manual streamable-http upstream at http://127.0.0.1:<port>/mcp, POST /api/v1/servers/<name>/security/approve with {"force":true}, then the spec with MCPPROXY_BASE_URL, MCPPROXY_API_KEY, SWEEP_SERVER_NAME and SKILLS_FIXTURE_URL set.

The release QA gate runs this exact script on every tag as its advisory web-ui-sweep job — see Release Gate. Extend the committed sweep when you add a screen worth guarding on releases; use the ad-hoc pattern below for the deeper, spec-specific verification that ships beside a spec.

Ad-hoc, spec-specific verification​

The pattern, in order:

  1. Stand up a fresh mcpproxy. Use a throwaway data-dir so persisted state doesn't bleed between runs:
    pkill -f 'mcpproxy serve.*<port>' 2>/dev/null; sleep 1
    rm -rf /tmp/mcpproxy-uitest/{config.db,index.bleve,logs} 2>/dev/null
    cat > /tmp/mcpproxy-uitest/mcp_config.json <<'EOF'
    { "listen": "127.0.0.1:18081", "data_dir": "/tmp/mcpproxy-uitest", "api_key": "uitest", "enable_web_ui": true, "enable_socket": false, "telemetry": {"enabled": false}, "mcpServers": [] }
    EOF
    ./mcpproxy serve --config=/tmp/mcpproxy-uitest/mcp_config.json --listen=127.0.0.1:18081 --log-level=info > /tmp/mcpproxy-uitest/server.log 2>&1 &
    until curl -sf -H "X-API-Key: uitest" http://127.0.0.1:18081/api/v1/status >/dev/null; do sleep 1; done
  2. Reuse the existing Playwright install. e2e/playwright/node_modules already has Playwright + Chromium 1217. Symlink it into your scratch dir:
    mkdir -p /tmp/uitest && cd /tmp/uitest
    ln -sfn /Users/user/repos/mcpproxy-go/e2e/playwright/node_modules ./node_modules
  3. Pin the Chromium binary in playwright.config.ts so Playwright doesn't try to download a different version:
    import { defineConfig } from '@playwright/test';
    export default defineConfig({
    testDir: '.', timeout: 30000, fullyParallel: false, workers: 1, retries: 0,
    use: {
    headless: true,
    viewport: { width: 1440, height: 900 },
    launchOptions: {
    executablePath: '/Users/user/Library/Caches/ms-playwright/chromium-1217/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing',
    },
    },
    });
  4. Write the spec. Use data-test attributes already on the components (the project convention). For new components, add them. Drive scenarios with page.locator('[data-test="..."]'). Always use page.waitForLoadState('domcontentloaded') — networkidle hangs because of the SSE channel. Snapshot each state with page.screenshot({ path: ... }). Number screenshots in execution order so the report renders left-to-right.
  5. Run. ./node_modules/.bin/playwright test --reporter=list. Iterate until green.
  6. Build the rich HTML report. A short Python script that base64-embeds each PNG and wraps it in a styled <details> per scenario produces a single self-contained HTML file the user can open offline. Pattern: top summary card with pass/fail counts, then one collapsible per scenario with Expected / Observed / inline screenshot. The reference implementation is /tmp/wizard-v2-verify/build-report.py from the v2 work — clone it and update the SCENARIOS list. Output goes to specs/<feature>/verification/report.html.
  7. Drop screenshots + report alongside the spec. Always commit them with the spec changes — they're part of the trace.
  8. Surface the report. End your reply with open <path-to-report.html> so the user can review without re-running the suite.

Key gotchas:

  • The wizard's <dialog> element renders as [open] only when the Vue store sets it. To assert open/closed state robustly, query the dialog property in page.evaluate(), not aria-hidden or styling.
  • The default config from a stub file does NOT trigger applyFirstRunDockerIsolation — that only runs when the config file is absent at boot. To test the "Docker auto-enabled" path, either let mcpproxy create the config or pre-set docker_isolation.enabled: true in your stub.
  • For browser-driven verification of subtle states (badge counts, empty/loaded transitions), prefer the Playwright spec over ad-hoc screenshots from the chrome-in-chrome MCP — the spec is reproducible and a CI agent can re-run it.