Can AI Generate E2E Tests from a PRD?

Zeshi Du
Can AI Generate E2E Tests from a PRD? cover

Yes, and the honest version of the answer includes what has to be true for it to work. Generating E2E tests from a PRD is two hard problems chained together: understanding what a document means, and turning that meaning into tests that actually run against a real product. AI tools that solve only the first half produce impressive-looking artifacts that verify nothing.

So here's the full picture: what the capability requires, where naive approaches break, and how TestSprite implements the chain end to end.

What "From a PRD" Has to Mean

A PRD describes intent: users can do this, the system should enforce that, this flow ends in this outcome. E2E tests verify behavior: a browser performs the steps and checks the results. Between the two sit three transformations, and each is a place the chain can break.

The document has to become structured intent, features, flows, rules, extracted accurately from prose that was written for humans. The intent has to become executable steps, real navigation against the real product, not pseudocode against an imagined one. And the steps have to stay valid as the product evolves, because the PRD's promises outlive any single build of the UI.

Any tool claiming PRD-to-E2E should be evaluated against all three, not just the first.

Where the Naive Version Breaks

The straightforward approach, feed the PRD to a model, ask for test scripts, fails at predictable points.

It hallucinates the implementation: the PRD says users log in, so the generated script clicks a #login-button that may not exist, on a page whose structure the model invented. It inherits the document's gaps and staleness: PRDs are incomplete and outdated in ways their authors know and models don't, so tests get generated for features that shipped differently or never shipped. And it produces static artifacts: scripts anchored to a guessed implementation, decaying from the moment they're written.

The pattern across all three failures is the same: the document alone isn't enough, because a PRD describes a product, and tests have to run against the product itself.

How TestSprite Implements the Chain

TestSprite's approach grounds each transformation in something checkable.

The PRD becomes an Editable Feature Map: the agent parses the document into a structured picture of features and flows, and that map, not the raw prose, serves as the ground truth for test generation. Editable is the key property. Before anything runs, you review the map, correct a misread requirement, delete what's out of scope, add what the document omitted. The document's gaps get closed by a human glance instead of inherited silently, and teams without a PRD at all can still start: the agent reverse-engineers intent from the codebase and product, and the map is where you confirm it got things right.

Then the intent meets reality. The exploration agents open the deployed application and navigate the flows the feature map describes, as real users would.

Other verification tools read your code and guess. TestSprite opens your app and uses it.

The executable steps come from this exploration, real elements, real navigation, real data flowing through multi-step journeys, so nothing is anchored to an imagined implementation. Where the PRD's promises involve the backend, Backend Testing 2.0 calls the actual endpoints and observes real responses before generating assertions. The tests are executable because they were derived from executing.

And the third transformation, staying valid, is handled by anchoring tests to behavior rather than structure. When the UI drifts, Auto-Heal Rerun adapts and verifiably reruns; when behavior breaks, the finding surfaces in PRD-shaped language: which promised flow, what should have happened, what did.

What This Looks Like in a Workflow

The practical loop is short. Upload the PRD, or point the agent at the project, review and adjust the feature map, and run. Findings land where the work happens: in Cursor or Claude Code through the MCP Server, where the coding agent fixes gaps in the same session, or as PR comments through GitHub Actions. The feature map persists as the product's testable definition, so subsequent runs verify new work against the same ground truth, and the run history in the Web Portal becomes something PRDs never had: a live record of how much of the document is currently true.

A Scenario: A PRD, Its Product, and the Gap Between

A four-person team builds a home-cleaning services marketplace with Claude Code. Their PRD defines the booking promise: customers pick a service, choose a time window, cleaners accept jobs, and a customer can cancel free until 24 hours before the window.

They upload the PRD. The feature map comes back with booking, matching, cancellation, and payments structured as flows, plus one artifact of the document's age: a referral program that was cut in planning. They delete it from the map in the review pass, thirty seconds, and run.

The agents book, match, and cancel like real users on the deployed product. Most of the map verifies green. The cancellation rule fails in a specific way: canceling at 23 hours correctly charges the late fee, but canceling a booking that was rescheduled measures the 24-hour window against the original time, not the new one, so a customer who moves a Tuesday booking to Friday and cancels on Wednesday gets charged a late fee for a job three days out. The PRD's rule was clear; the implementation's clock was anchored to the wrong field.

The finding lands in the Claude Code terminal referencing the promise it violates, the fix re-anchors the window, and the rerun closes it. The referral program, meanwhile, generated no phantom tests, because the map, not the document, was the ground truth.

Conclusion

Can AI generate E2E tests from a PRD? Yes, when the implementation respects what the task actually is: a chain from document to structured intent to executed reality to maintained coverage. The naive version breaks by trusting the document too much and touching the product too little.

TestSprite's chain is grounded at every link, an Editable Feature Map as reviewable ground truth, tests derived from exploring the real application, evidence-based backend assertions, and behavior-anchored maintenance, so the PRD's promises become something they've never been before: continuously executable.

Turn your PRD into running E2E tests with TestSprite today. Free plan, no credit card required.