Build an App End to End
Let an AI agent build a BoxLang application end to end: write the code, validate it, run it, drive it in a real browser with bx-playwright, and leave browser tests behind.
An agent that writes code but never runs the application is guessing. With bx-playwright, the agent closes the loop: it builds a feature, starts the app, uses it in a real browser like a person would, sees what is broken, fixes it, and leaves browser tests behind so the feature stays working.
🔁 The Loop
Write the feature: handlers, views, classes.
Validate every edit with
boxlang check.Run the app, for example with
boxlang-miniserver.Drive it with bx-playwright: visit pages, fill forms, click, read the accessibility snapshot, check for console errors and accessibility issues, and take screenshots to look at.
Fix whatever the browser shows is wrong, and repeat.
Keep the verification as browser tests, so the next change cannot silently break the feature.
🧰 Setup
Install the module, the browser, and the skills that teach the agent how to use them:
Then tell the agent about the loop in your project's AGENTS.md:
🤖 What the Agent Runs
A verification script the agent writes and runs after building a sign-up page:
Everything the agent needs to recover is in the output:
Accessibility snapshots are compact and token efficient, with refs (
[ref=e12]) the agent can act on directly:page.click( "ref=e12" ).Errors are typed and explain the fix:
Playwright.Timeout,Playwright.AssertionFailedandPlaywright.ActionFailedcarry Playwright's call log and adetailwith what to try next.Screenshots let a multimodal agent look at the result, not just the DOM.
help()on any object (page.help( "fill" )) andbxplaywright help --jsondescribe the API, so the agent does not have to guess.
✅ What the Agent Leaves Behind
The same steps become a browser test that runs in CI:
The ci profile keeps screenshots, traces, and videos when a test fails, so both you and the agent can see what went wrong. assertScreenshotMatches() catches visual regressions and writes a diff image with the changed pixels in red.
💬 Example Prompt
🔗 Going Further
Record instead of write:
bxplaywright codegen http://localhost:8080 --output=flow.bxsrecords your clicks as bx-playwright code the agent can build on.No shell access?
bxplaywright mcpstarts Playwright's MCP server, so MCP-only agents can still drive the browser.AI features inside your app: give a BoxLang AI agent a browser with Browser Agents.
Full documentation for agents and humans: bxplaywright.boxlang.io, also as llms.txt.
Last updated
Was this helpful?
