AI Test Generation

circle-info

Who is this for? All roles — developers, QA engineers, and managers — who want to generate test cases automatically from Jira tickets, Figma designs, Swagger specs, videos, or plain English descriptions.

ContextQA can generate complete test cases from 10 different source types. You do not need to write steps manually — supply a source artifact (a ticket, a design file, a video, a git diff) and the AI produces a ready-to-execute test case with all steps, assertions, and expected results filled in.

This page covers each generation method, when to use it, and how to invoke it — both from the ContextQA UI and from the MCP tool interface.


1. From Natural Language (Most Common)

The simplest and most flexible generation path. Describe what the test should do in plain English and ContextQA generates all the steps.

In the UI

  1. Navigate to Test Development in the left sidebar

  2. Click the + button to create a new test case

  3. Select Start with AI Assistance

  4. Enter the URL of the application page you want to test

  5. Type your task description in the text area — describe the user journey in plain English

  6. Click Generate — ContextQA creates the test case with all steps filled in

  7. Review the generated steps, make any adjustments, and click Save

Example task descriptions:

Log in as [email protected] with password Test123!, navigate to the
Products page, search for "wireless headphones", and verify that
at least one product appears in the search results.

Via MCP

Best for:

  • Creating new tests quickly when you know the user journey

  • Exploratory testing where you are discovering application behavior

  • One-off tests for specific regression scenarios

  • Any scenario where you can describe the workflow in 1-3 sentences

Tips for better results:

  • Include the starting URL in the task description or url parameter

  • Mention specific field names, button labels, and page section names as they appear in the UI

  • Include any setup state the test needs (e.g., "already logged in", "with an empty cart")

  • For assertions, be specific: "verify the success message says 'Order placed'" is better than "verify success"


2. From Jira / Azure DevOps Tickets

Generate tests directly from user stories and bug tickets. The AI reads the ticket description and acceptance criteria to create comprehensive test scenarios.

Prerequisites

Connect your issue tracker via Settings → Integrations → Bug Tracking → Jira (or Azure DevOps). You will need:

  • Jira base URL (e.g., https://yourorg.atlassian.net)

  • Email address associated with your Jira account

  • Jira API token (create one at id.atlassian.com/manage-profile/security/api-tokens)

In the UI

  1. Navigate to Test Development → + New Test Case

  2. Select Generate from Jira Ticket

  3. Enter the ticket ID (e.g., MYAPP-123)

  4. Choose whether to include acceptance criteria

  5. Click Generate

ContextQA creates one test case for the main scenario described in the ticket. If acceptance criteria are present and you enabled that option, it creates additional test cases — one per acceptance criterion — covering each condition separately.

Via MCP

What the AI reads:

  • Ticket summary (title)

  • Ticket description

  • Acceptance criteria (if present)

  • Labels and priority (used to suggest edge cases for high-priority or bug tickets)

Best for:

  • Agile teams who want test cases that map directly to user stories

  • Ensuring every acceptance criterion has a corresponding automated test

  • Bug tickets — the AI generates a reproduction test case from the steps-to-reproduce section

  • Teams that manage requirements in Jira and want to maintain traceability

Example output for a ticket like:

MYAPP-123: As a user, I want to reset my password so I can regain access if I forget it. AC1: User can request a reset link by entering their email AC2: Reset link expires after 24 hours AC3: New password must be at least 8 characters

ContextQA generates three test cases:

  • "Password Reset - Request Link Flow" (main scenario)

  • "Password Reset - Link Expiry After 24 Hours" (AC2)

  • "Password Reset - Password Minimum Length Validation" (AC3)


3. From Figma Designs

Generate tests from Figma design files before the application is even built. The AI analyzes design screens and creates tests matching the intended UX flows.

Prerequisites

  • A Figma URL with view access (the AI does not require edit access)

  • For private files: Figma personal access token configured in Settings → Integrations → Design

Via MCP

How It Works

The AI receives the Figma file and:

  1. Identifies all screens and frames in the design

  2. Analyzes the interactive elements (buttons, inputs, links, navigation)

  3. Infers the intended user flows by connecting screens that share navigation patterns

  4. Creates test cases for each distinct flow it identifies

For a three-screen checkout flow (cart → shipping → payment → confirmation), the AI creates a test case that navigates through each screen in sequence, fills the forms with realistic test data, and asserts the correct content on each screen.

Best for:

  • Design-driven development — testing the intended UX before it is built

  • Catching mismatches between design intent and implementation during QA

  • Generating a test suite in parallel with development to reduce QA bottlenecks

  • Design reviews — sharing generated test scenarios with stakeholders to validate flows

Tips:

  • Use frames (not groups) for individual screens in Figma for best results

  • Name your frames descriptively — "Step 1: Shipping Address" is more useful to the AI than "Frame 123"

  • For complex flows, link the Figma file URL to the specific flow's starting screen using node-id


4. From Excel / CSV Files

Migrate existing manual test case libraries into ContextQA. The AI parses your spreadsheet and maps columns to test steps, expected results, and metadata.

Supported Formats

  • .xlsx (Excel 2007+)

  • .xls (Excel 97-2003)

  • .csv (comma-separated)

Expected Column Structure

ContextQA recognizes common column names automatically:

Detected Column
Mapped To

Test Case Name, Name, Title

Test case name

Step, Step Description, Action

Step description

Expected Result, Expected, Assertion

Expected result

URL, Page, Base URL

Test case URL

Tags, Labels, Category

Test case tags

Priority, Severity

Test case priority

If your column names do not match these patterns, ContextQA presents a mapping UI where you can assign each column to the appropriate field before importing.

Via MCP

For remote files:

Best for:

  • Migrating from manual QA processes to automation

  • Teams that maintain test cases in shared spreadsheets

  • One-time import of a large legacy test library

  • Taking over a QA process from another team that used Excel


5. From Swagger / OpenAPI Specifications

Generate API contract tests for every endpoint in your OpenAPI specification. ContextQA creates test cases that verify each endpoint's request/response contract, status codes, and data shapes.

Supported Spec Formats

  • OpenAPI 3.0 (.json or .yaml)

  • OpenAPI 3.1

  • Swagger 2.0

Via MCP

Or from a local file:

What Gets Generated

For each endpoint, ContextQA creates:

  • Happy path test: valid request with all required parameters, asserts 2xx response

  • Validation test: missing required fields, asserts 4xx response

  • Response schema test: verifies the response body matches the declared schema

  • Auth test (if security schemes are defined): verifies unauthorized requests get 401/403

Best for:

  • API testing coverage — ensure every endpoint has at least one automated test

  • Contract testing — catch breaking changes when the API changes

  • Microservice teams where API test coverage is a release gate requirement

  • Generating a baseline test suite immediately after a new service is deployed


6. From Video Screen Recordings

Convert screen recordings of user journeys into automated tests. The AI watches the video and extracts each distinct user action as a test step.

Supported Video Formats

  • .mp4 (H.264 codec recommended)

  • .mov (QuickTime)

  • .webm

Via MCP

How It Works

The AI processes the video frame by frame to identify:

  • Navigation events (URL changes, page loads)

  • Click actions (identifies what was clicked based on visual context)

  • Text input (captures what was typed, including field context)

  • Assertions implied by visible state changes (a success banner appearing, a list populating)

Each identified action becomes a test step. The AI uses the visual context of each action (what is on screen, what the user interacted with) to write the step description in natural language.

Best for:

  • Converting screen recordings from user research sessions into regression tests

  • Capturing complex multi-page workflows that would take a long time to write manually

  • Onboarding documentation — record a product demo once and generate tests from it

  • Creating tests for legacy applications where no design files or specifications exist

Tips for best video quality:

  • Record at normal speed — avoid fast-forwarding through steps

  • Keep the cursor visible — use a cursor highlight tool if possible

  • Pause briefly on each page before clicking to allow the AI to capture the page state

  • Avoid recording over remote desktop connections (additional latency causes frame artifacts)


7. From Requirements Documents

Paste a requirements document in plain text format and ContextQA generates test scenarios covering all stated requirements.

Via MCP

What Gets Generated

ContextQA generates test cases for:

  • Each positive requirement (the happy path that must work)

  • Validation rules (each constraint described in the requirements)

  • Error states (each failure mode mentioned)

For the example above, it would generate tests for: successful registration, duplicate email error, password too short, password no uppercase, password no number, email verification sent, redirect after registration, and inline error message display.

Best for:

  • Documentation-driven projects (government, regulated industries, large enterprises)

  • Teams that maintain formal requirements specifications

  • Converting BRDs (Business Requirements Documents) or FRDs into test suites

  • Ensuring full traceability between requirements and tests


8. From Code Changes (PR-Level Testing)

Analyze a git diff and generate tests that specifically target the application flows affected by the changed code. This is the recommended approach for CI/CD integration.

Via MCP

How It Works

The AI analyzes the diff to understand:

  • Which files changed and what those files are responsible for (route handlers, models, UI components)

  • What the behavioral change is (new validation rule, new feature, bug fix, configuration change)

  • Which user-facing flows are affected by the changed code paths

It then generates tests that specifically exercise those affected flows — in the example above, it would generate a test that attempts to check out with a crypto payment method and asserts the appropriate error message is shown.

Best for:

  • CI/CD pipelines — run targeted tests on every pull request instead of the full suite

  • Reducing test execution time in PRs while maintaining meaningful coverage

  • Automated test generation as part of a code review process

  • Ensuring every meaningful code change has a corresponding test

GitHub Actions Example


9. From n8n Workflows

Map n8n automation workflow nodes to ContextQA test steps. Each node type in the n8n workflow becomes a corresponding verification step in the test case.

Via MCP

Or from a published n8n workflow URL:

Node Mapping

n8n Node Type
Generated Test Step

HTTP Request

API call assertion: verify endpoint returns expected status and body

Code

Logic verification: verify output data matches expected transformation

AI / LLM

AI response validation: verify response contains expected content

Webhook

Webhook trigger test: send test payload and verify processing

Database

Data assertion: verify database state after workflow execution

Email

Notification test: verify email delivery and content

Conditional (IF)

Branch coverage: generate separate test cases for each branch

Loop

Iteration test: verify correct behavior across N iterations

Best for:

  • Teams using n8n for business automation who want to test their workflows

  • Ensuring n8n workflow changes do not break downstream processes

  • Validating webhook integrations end to end

  • CI/CD testing for n8n workflow deployments


10. Edge Case Generation

Generate boundary conditions, invalid input scenarios, and error state tests for any feature described in natural language.

Via MCP

Example Output

For the login edge case query, ContextQA generates scenarios including:

  • Empty email field submission

  • Empty password field submission

  • Email address without @ symbol

  • Email address with consecutive dots

  • Password exceeding maximum length (if any)

  • Login with valid email but wrong password (N times, to trigger lockout if applicable)

  • Login with correct credentials after account lockout

  • Login with SQL injection attempt in the email field

  • Login with XSS payload in the password field

  • Login with Unicode characters in the password

  • Login with leading/trailing whitespace in both fields

  • Concurrent login from two different browsers

Best for:

  • QA engineers who want comprehensive negative test coverage without writing each scenario manually

  • Security-minded teams who need to cover injection attacks and boundary conditions

  • Feature completeness reviews before release — run edge case generation on every new feature

  • Augmenting a happy path test suite with systematic negative testing


Comparing Generation Methods

Method
Best Input Quality
Time to Generate
Test Quality

Natural language

Any — works with vague descriptions

Seconds

High for clear descriptions, lower for vague ones

Jira ticket

Well-written tickets with ACs

Seconds

Very high — traces directly to requirements

Figma design

Complete, screen-based designs

15-30 seconds

High for UI flows

Excel/CSV

Structured, well-labeled spreadsheets

30-60 seconds

Depends on existing test quality

Swagger/OpenAPI

Any valid spec

30-60 seconds

Very high for API tests

Video

Clear, normal-speed recordings

1-3 minutes

High — captures exact interactions

Requirements

Formal, numbered requirements

Seconds

Very high — systematic coverage

Code change

Git diff with clear intent

15-30 seconds

High for targeted regression

n8n workflow

Valid n8n JSON export

15-30 seconds

High for integration tests

Edge cases

Any feature description

Seconds

High breadth, AI-inferred scenarios


After Generation

Regardless of which method you use, after generation you should:

  1. Review the generated steps — open the test case in the ContextQA UI and scan through the steps. The AI is highly accurate but may occasionally misinterpret an ambiguous instruction.

  2. Execute the test — run it once to verify it works against your current application state. Use execute_test_case via MCP or the Run button in the UI.

  3. Review the results — if any step fails on the first run, use AI root cause analysis to understand whether the failure is a test issue (step was generated incorrectly) or an application issue (a real bug).

  4. Add to a suite — once the test passes, add it to the appropriate test suite so it runs as part of your regular regression cycle.

circle-info

70% less human effort with AI test generation and self-healing. Book a Demo →arrow-up-right — See AI generate, execute, and maintain tests for your application.

Last updated

Was this helpful?