For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tutorial: Generate Tests from Requirements

Upload requirements, answer AI clarifications, review traceable generated test cases, and run the accepted ContextQA coverage without writing test steps.

Quick answer

Upload requirements, answer AI clarifications, review traceable generated test cases, and run the accepted ContextQA coverage without writing test steps. Follow the documented prerequisites and steps, then verify the expected result before using the workflow in a shared or production process.

What this page covers

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:

  1. Start an import from a requirements document

  2. Configure the target platform, publish mode, and suite creation

  3. Let ContextQA analyze the requirements and answer its clarifying questions

  4. Review the generated test cases and approve the ones you want

  5. 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.

Business use case: Import a release specification once, generate positive and negative coverage together, and keep approval with the QA owner before the cases enter a shared regression plan.

Prerequisites

  • A ContextQA account with at least one workspace (sign up)

  • A requirements document to import — a .pdf, .docx, .xlsx, .csv, or .txt file describing the behavior you want to test

  • The 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:


Step 1: Start a requirements import

Begin by opening the test case creation panel and choosing the import path.

  1. In the left sidebar, select Test Cases.

  2. Click the + icon to open the creation panel. A full-height panel slides in from the right.

  3. On the method selection screen, click Import File.

  4. 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.

  1. Click Show Configuration Options to expand the settings.

  2. Under Select Target Platform, choose Web Application.

  3. 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.

  4. (Optional) Add context that helps the AI generate more accurate cases:

Requirements generation options showing publish mode, test-case types, and optional suite and plan creation
Field
Example value

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.

  1. Upload your requirements file. You can add up to 10 files per import — documents (.pdf, .docx, .xlsx, .csv, .txt), images, or video recordings.

  2. 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.

  1. On the Analysis step, ContextQA lists the requirements it identified from your document. Confirm the list reflects the behavior you want covered.

  2. 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?

  3. Answer each question in its field. Specific answers produce more accurate tests. If a question doesn't apply, leave it blank.

  4. 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.

  1. 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.

  2. Click the file row to open its detail view. The Test Cases tab lists every generated case.

  3. Review the table. Each row shows:

Column
What it tells you

Test Case

The under-review ID, name, and description. An existing-case icon and linked TC-<id> identify a match already in the repository.

Type

The test type — Positive, Functional, Negative, Edge, Field Validation, End to End, or Boundary Value

Priority / Prerequisite

Triage metadata and any reusable setup case

Variables

Test-data, environment, or global references detected in the generated steps

Decision

Pending, Approved, or Rejected

  1. Click any test case to open the detail drawer and inspect its steps, expected results, and variables.

  2. 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.

When the existing-case icon appears, open its linked TC-<id> and compare the match reason and steps before approving anything new. This preserves traceability without silently duplicating repository coverage.

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.

  1. Open one of the approved test cases — for example, Registration — successful sign-up.

  2. 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.

  3. Click Run in the top toolbar.

  4. 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.


Summary

You generated a test suite from a requirements document in five steps:

  1. Started a requirements import from the test case creation panel

  2. Configured the target platform, publish mode, and context for generation

  3. Reviewed the AI analysis and answered clarifying questions to sharpen the output

  4. Approved the generated test cases, each traceable to the requirement that produced it

  5. 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

  • 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. Book a Demo → to see ContextQA generate a suite from your specifications.

Last updated

Was this helpful?