Skip to main content

Playwright Generation

Shipped today: Desktop Validation sidebar replay and export_validation_flow on Browser MCP emit a Playwright test from a saved validation flow. See Behavioral validation flows.

Direction

Generated tests should prefer semantic locators, avoid brittle selectors, generate assertions from visible outcomes, produce readable code, and follow Playwright best practices. Inferring user intent from raw history is not the current exporter.

Behavioral validation flows

A validation flow belongs to one workspace application and starts at an application-relative initial path. It records the meaningful route through the GUI plus an observable expectation at the initial place and after each step. Agents must describe user intent and visible behavior—not DOM structure, framework components, backend calls, or other implementation detail.

The Server persists flow definitions in the workspace project at .agent-up/validation-flows.json, so validation checks are versioned with the repository. Supplying an existing flow ID replaces it as a new version, which supports editing and re-recording without creating duplicates. The Desktop Validation sidebar lists checks for the selected application, expands each flow into its steps and assertions while replay runs, and shows pass or fail icons for individual checks, stages, and the overall flow. Replay plays in the embedded WebView with staged mouse movement, half-second attention pings, navigation, and page-load waits so the user can follow the journey.

Playwright export prefers role, accessible name, label, test ID, and visible text locators in that order; CSS is only an export fallback; click and fill steps retain a stable selector fallback so the same flow can also replay in the Desktop WebView. Agents should infer routes and controls from application source or router files when that is quicker than inspecting every page, perform the journey once, then call save_validation_flow with user-meaningful descriptions and visible expectations after each step. Navigation is restricted to single-slash application-relative paths and exports resolve them against AGENT_UP_BASE_URL, preventing a recorded flow from escaping to another origin while allowing the same check to use dynamically allocated local ports and a CI-provided headless target. Assertions belong after the action whose user-visible outcome they describe, rather than relying on sleeps or incidental implementation state.