Skip to main content

Playwright Generation

This page is the Playwright export from a saved validation flow. Desktop Validation sidebar replay and export_validation_flow emit that test today.

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 appears only while an application is selected, starts collapsed, lists checks for that 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.

CI proves the first-party docker and dotnet capabilities by starting the repository-root agent-up.json from Desktop and replaying the recorded Example Web flow. That check lives in AgentUp.Tests under Category=RuntimeCapabilityE2E and runs in the Runtime capability E2E job rather than the 180-second GUI E2E watchdog. Desktop POST /start waits for those launches to finish; the fixture heartbeats application state during that wait and does not occupy the Avalonia UI thread for it.

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.