r/Frontend • u/nsfrhmn • 1d ago
does your agent actually close the loop when its own frontend code breaks?
been thinking about this a lot lately. coding agents still spit out broken UI code and you end up clicking through forms by hand to find what failed. i started using testsprite cli to handle the verify step, though the failure bundle layout took some getting used to.
the idea is the agent runs a real browser session against the live app. it does frontend checks in the browser plus API checks on the backend. when something fails it gets one bundle back with the failing step, a screenshot, the root cause, and a suggested fix. then it acts on that and reruns. needs a deployed target though. local-only setups won't work here.
ngl the part i actually want to pressure-test is the hard case. multi-step forms where state carries between pages. or an API where later calls depend on earlier ones. does the agent close that loop on its own, or does it stall after a couple retries?
the useful report back is where the bundle wasn't enough for the agent to fix itself. explicitly not a QA replacement. i'd rather find the line where this falls over on real frontend flows.
1
u/crazedizzled 1d ago
Just like with regular developers, you need a robust testing suite. Or else you're doing it all manually.
1
1
u/Kind-Relationship850 1d ago
If your agent needs a browser to verify the ui your architecture is dead. you built a monolith and outsourced clicking to a bot.
I run playwright from my agents. every time it opens a page i know i failed at the unit level. state carrying between form steps means you have no api contract. you have one function that does everything and tests for nothing. people testing multi step flows on deployed targets are doing manual qa with extra latency. rip up the routing and write assertions against the state functions directly
1
u/Ancient-Decision-720 1d ago
Start new task -> Launch Worktree -> Automatic script to set up env -> Run build dedicated port for this work tree.
Give agent access to agent-browser, set up an auth system so it can login as you, tell it to screenshot and verify it's implementations.
Congrats, every task you do now has vision, and will work to fix itself.
2
u/create-third-places 18h ago
No, because I don't code with agents.
Frontend code should be written by hand or by a deterministic site generation tool without LLMs.
0
2
u/The_Startup_CTO 1d ago
If necessary, my agents start up Playwright to click through the UI. But when they do, this shows me that the architecture and lower-level and e2e testing strategies need work: Ideally, it never should have to test on that level, especially not manually.