Mini-project: Automated PR and live UI smoke-tester
Combine Code + Browser into one release gate
In this capstone for Code and browser, you chain a coding review agent and a UI smoke-test verifier inside an AgentFlow so a release passes only when both unit tests and rendered UI checks succeed.
Example
from praisonai import Agent, AgentFlow
def check_unit_tests() -> str:
"""Return unit test status from the feature worktree."""
return 'UNIT_PASS: 14 passed, 0 failed'
def check_ui_smoke() -> str:
"""Return browser smoke-test status."""
return 'UI_PASS: 0 console errors, checkout button visible'
code_verifier = Agent(name='CodeVerifier', instructions='Call check_unit_tests and return its output.', tools=[check_unit_tests], output='silent')
ui_verifier = Agent(name='UIVerifier', instructions='Call check_ui_smoke and emit VERDICT: SHIP or HOLD in one sentence.', tools=[check_ui_smoke], output='silent')
release_flow = AgentFlow(steps=[code_verifier, ui_verifier])
print(release_flow.start('Verify PR #42 before merge')['output'])Example explained
- CodeVerifier — Executes the worktree unit test check as Step 1 of the release pipeline.
- UIVerifier — Verifies live browser health as Step 2 and emits a final SHIP or HOLD verdict.
- AgentFlow(steps=[…]) — Chains code verification and browser smoke testing in a deterministic sequence.
Run the real local CLI sequence on your own repo
Swap the mock tool helpers above for real terminal commands when running locally before opening a pull request.
Example
# 1. Isolate fix in a worktree
git worktree add ../wt-pr42 -b fix/pr-42 main
cd ../wt-pr42
# 2. Apply fix & run tests with praisonai code
praisonai code "Fix checkout total bug and make pytest pass"
# 3. Smoke-test the rendered page with praisonai browser
praisonai browser nav http://127.0.0.1:3000/checkout
praisonai browser get-console-logsExample explained
- git worktree add ../wt-pr42 — Keeps your main branch clean while the coding agent works.
- praisonai browser get-console-logs — Verifies zero browser runtime errors before you push the PR.
Reference: documentation