Skip to main content
UI tests streaming into the project view as generation runs

What Test Generation Does

For each test case in the reviewed plan, TestSprite writes:
  • A Python + Playwright test file that opens a real browser, drives your app through the flow, and asserts on the visible state at each step
  • A step list that gets followed at runtime — clicks, fills, navigations, assertions
The output is real Playwright code you can drop into your CI/CD or regression suite if you want — but the primary use is execution within TestSprite’s cloud sandbox where every step is observed.

What Code Gets Generated

For each plan row, TestSprite writes a Python + Playwright test that drives a real browser through the flow and asserts on visible state. Roughly:
Generated UI test (illustrative)
What this gets you:
  • Coverage from observed behavior, not speculation. Tests are grounded in flows TestSprite actually walked through during exploration — including the edge cases (form validation, error states, redirects) that handwritten suites typically skip until a customer hits them.
  • Survives your refactors. Paired with Auto-Heal (Pro), tests recover automatically when your UI changes but the underlying flow is intact. A button rename or component swap doesn’t turn into a green-the-suite ticket.
  • Auditable, not magical. Generated code is plain Python + Playwright — actions and assertions are line-by-line readable. Your QA team can review what’s being checked; there’s no proprietary DSL or opaque runtime to trust.
  • Maintained for you. Refine a test in your own words and TestSprite regenerates the steps. Keeping the suite green is a paragraph of feedback, not a sprint of selector hunting.

How Generation Runs

TestSprite generates each test from its plan row, verifies the output, and surfaces failures clearly. If a test can’t be generated cleanly, it’s marked Failed, the credit is refunded, and a Regenerate button appears on the row so you can try again.

Watching Generation Live

Generation runs across plan rows in parallel. As each test finishes, it streams into the project test list with status:
UI tests streaming into the project view as generation runs
Generation typically completes in 1–3 minutes total for a 20-test plan.

What “Run” Does

When a UI test executes (initially after generation, or via Rerun later), TestSprite spins up a Playwright browser in the cloud sandbox, signs in with your test account, drives your app through the flow, captures per-step screenshots, records a full session video, and decides Pass/Fail from the assertions. Once the run finishes, open the test detail page to play back the recorded video and step through the screenshots.

How UI Tests Differ from API Tests

Reviewing a Failed Test

Click any Failed row to land on its detail page (see Step-by-Step Walkthrough for the rich view). You get:
UI tests streaming into the project view as generation runs

Iterating on a Test

To iterate on a generated test, open its detail page and edit the test description — saving re-triggers generation against the new wording.
UI tests streaming into the project view as generation runs
For coverage on an entirely new feature or scenario, create a new project for it.

Edge Cases & Troubleshooting

Two paths:
  • Refine in chat: “The Sign In button uses data-testid='login-btn', not the role-based selector”
  • Regenerate: click Regenerate on the test row — generates a fresh test from scratch. Often picks up better selectors on a re-roll.
Plan generation produced a spec-based case for that feature. The test code is best-effort; first run may fail. Refine with actual UI details after the failure.
Likely a single test stuck mid-generation. Check the project test list — if all rows are Idle except one in Generating, that’s the culprit. Give it a couple of minutes; it will eventually surface as Failed and the rest of the suite continues.
Standard generation uses playwright.sync_api + standard library + pytest. If your description accidentally implied something exotic (“use playwright async”), generation may follow. Refine to standard or accept the variant.
Recording is on by default. If video is missing, the cloud sandbox failed to capture (rare). The screenshots and Playwright trace should still be there — file a bug if all three are missing.

Where to Go Next

Step-by-Step Walkthrough

Per-step screenshots, video, and run trace

Auto-Heal (Pro)

Subsequent runs handle UI drift automatically

Refining Tests

Natural-language adjustments

Test Detail

Drill into one test’s full result