Tutorial: Generate Tests from Requirements
Turn a requirements document into a full test suite. Upload a specification, answer the AI's clarifying questions, review the generated test cases with traceability back to each requirement, and run t
Who is this for? QA managers, SDETs, and agile teams who maintain requirements in documents or tickets and want a complete test suite generated from them — with each test traceable back to the requirement it covers.
ContextQA reads a requirements artifact — a specification document, a user story, or a set of acceptance criteria — and generates a complete set of test cases from it. Instead of translating each requirement into steps by hand, you upload the source, answer a few clarifying questions, and review the test cases the AI produces. Every generated case maps back to a requirement, so you can show coverage at a glance.
In this tutorial you:
Start an import from a requirements document
Configure the target platform, publish mode, and suite creation
Let ContextQA analyze the requirements and answer its clarifying questions
Review the generated test cases and approve the ones you want
Run a generated test and confirm it works
End result: A reviewed test suite generated from a requirements document, with each test case traceable to the requirement that produced it — ready to run as part of your regression cycle.
Prerequisites
A ContextQA account with at least one workspace (sign up)
A requirements document to import — a
.pdf,.docx,.xlsx,.csv, or.txtfile describing the behavior you want to testThe URL of the web application the requirements describe
Familiarity with core concepts — specifically test cases, suites, and test plans
If you don't have a requirements document handy, create a plain text file named registration-requirements.txt with the following content and use it throughout this tutorial:
User Registration Requirements
1. The registration form collects first name, last name, email address, and password.
2. Email addresses must be unique across all accounts.
3. Passwords must be at least 8 characters and contain one uppercase letter,
one lowercase letter, and one number.
4. On successful registration, the user is redirected to the dashboard.
5. If the email is already in use, an inline error appears next to the email field.
6. If the password does not meet the rules, an inline error appears next to the
password field.Step 1: Start a requirements import
Begin by opening the test case creation panel and choosing the import path.
In the left sidebar, select Test Cases.
Click the + icon to open the creation panel. A full-height panel slides in from the right.
On the method selection screen, click Import File.
The panel asks What type of file would you like to import? Select the Import Requirements card.
Verify it worked: The panel switches to a stepper with three steps — Inputs, Analysis, and Clarifications — with Inputs active.
Tip: Import Requirements generates test cases from a specification. The other card, Import Test Cases, is for a different task — migrating an existing test library from an Excel spreadsheet where the steps are already written.
Step 2: Configure the import
On the Inputs step, set how ContextQA generates and publishes the test cases before you upload the file.
Click Show Configuration Options to expand the settings.
Under Select Target Platform, choose Web Application.
Under Publish Mode, choose Require Approval. Generated test cases stay in a draft state until you review them, which is the right choice while you learn the workflow.
(Optional) Add context that helps the AI generate more accurate cases:
Name
User registration requirements
Additional information
Web app at https://yourapp.com/register. Email and password are the only required fields.
Tip: Attach UI mockups or screenshots alongside the document. Visual context helps the AI generate more relevant and complete test cases.
Upload your requirements file. You can add up to 10 files per import — documents (
.pdf,.docx,.xlsx,.csv,.txt), images, or video recordings.Continue to the next step.
Verify it worked: The stepper advances to Analysis and ContextQA begins reading the document.
Note: Require Approval keeps the generated test cases as drafts until you approve them. Auto Publish publishes them immediately and lets you also create a test suite, create a test plan, and run the plan as part of the same import. Use Auto Publish once you trust the generation quality for a given source.
Step 3: Review the analysis and answer clarifications
ContextQA reads the document, extracts the testable requirements, and then asks about anything ambiguous.
On the Analysis step, ContextQA lists the requirements it identified from your document. Confirm the list reflects the behavior you want covered.
The flow advances to the Clarifications step. The AI presents follow-up questions about details the document left open — for example, What's the exact wording of the duplicate-email error? or What URL should the registration test start from?
Answer each question in its field. Specific answers produce more accurate tests. If a question doesn't apply, leave it blank.
Submit your answers to start generation. If you have no answers to add, skip the questions instead — generation still runs.
Verify it worked: ContextQA generates a set of test cases covering the requirements and their failure modes. For the registration example, it produces cases for successful registration, the duplicate-email error, and each password validation rule.
Why clarifications matter: Generation quality tracks input quality. A requirement that says "passwords must be strong" produces a vague test; answering the clarification with "at least 8 characters, one uppercase, one lowercase, one number" produces a precise one. The more explicitly you describe expected behavior, the better the generated tests.
Step 4: Review and approve the generated test cases
Generated cases from a requirements import appear under the uploaded file so you can review coverage in one place.
In the left sidebar, go to Assets → Requirements. Your imported file appears in the list with a Status of Completed and a count of generated test cases.
Click the file row to open its detail view. The Test Cases tab lists every generated case.
Review the table. Each row shows:
Test Case
The name and an inline description — click to open the detail drawer
Type
The test type — Positive, Functional, Negative, Edge, Field Validation, End to End, or Boundary Value
Status
Whether the case is New or matches an Existing test
Decision
Pending, Approved, or Rejected
Click any test case to open the detail drawer and inspect its steps, expected results, and variables.
For each case you want to keep, click Approve. To discard one, click Reject. To send an approved or rejected case back for another look, use Revert to Review.
Verify it worked: The test cases you approved move to an Approved decision and are published to your test case list. Because you chose Require Approval in Step 2, only the cases you approved are published.
Tip: Open the Gaps tab in the file detail view to see requirements the generated suite doesn't yet cover. Address gaps by adding context and regenerating. See Requirements coverage gaps.
Step 5: Run a generated test
Confirm a generated test works against your live application.
Open one of the approved test cases — for example, Registration — successful sign-up.
Review the steps. The AI fills in the starting URL, the form interactions, and the assertions from your requirement and clarification answers. Edit any step whose wording doesn't match your application's exact labels.
Click Run in the top toolbar.
Select an execution environment and start the run.
Verify it worked: The execution viewer shows each step with a real-time pass/fail indicator. When the run finishes, click View Detailed Report to see the step-by-step breakdown, screenshots, and video.
Common mistake: If a step fails because a button or field label doesn't match, the requirement described the behavior in different words than your application uses. Edit the step to use the exact label, or add a Knowledge Base entry so future generations use your application's real terminology.
Summary
You generated a test suite from a requirements document in five steps:
Started a requirements import from the test case creation panel
Configured the target platform, publish mode, and context for generation
Reviewed the AI analysis and answered clarifying questions to sharpen the output
Approved the generated test cases, each traceable to the requirement that produced it
Ran a generated test and reviewed the evidence
A specification that existed only as a document is now a reviewed, runnable test suite.
Next steps
Generate from a Jira ticket: If you manage requirements in Jira, the same flow can pull test cases from ticket descriptions and acceptance criteria. See Jira integration and AI test generation.
Close coverage gaps: Use the Gaps tab to find requirements without a test, then add context and regenerate. See Requirements coverage gaps.
Improve accuracy with application context: Add a Knowledge Base so the AI knows your login flow, navigation, and terminology before it generates.
Organize and schedule: Add the approved cases to a suite and schedule them. See Managing test suites and Tutorial: Build and schedule a regression suite.
Run on every change: Trigger the suite from your pipeline. See GitHub Actions or Tutorial: CI/CD with GitHub Actions.
Related pages
AI test generation — every generation source, including requirements, Jira, Figma, OpenAPI, and video
Creating test cases — all four creation methods in the unified panel
Uploaded test files — manage imported files and their generated test cases
Requirements coverage gaps — find and close gaps in generated coverage
Knowledge Base — give the AI application context for more accurate generation
Turn your requirements into tests — no code required. Start Free Trial → — Or Book a Demo → to see ContextQA generate a suite from your specifications.
Last updated
Was this helpful?
