← Back to Docs

Design Test Case

Create test cases from scenarios or APIs

WellTested can design test cases in two ways: from scenarios (covering business flows) or from APIs (covering endpoint functionality).

Design Test Case in Onboarding

After selecting scenarios in the previous step, WellTested automatically designs scenario-based test cases. You will see these cases in the Scenario Testing tab.

What AI Does:

  • Analyzes each selected scenario
  • Designs one or more test cases per scenario
  • Generates test case title and description
  • Identifies which APIs to test

What is a Test Case?

A test case is a specific test with:

  • Title: Clear name describing what’s being tested
  • Description: Detailed explanation of the test
  • Type: Scenario-based or API-based
  • Parent: The scenario or API it belongs to
  • APIs: Which endpoints will be called

Two Types of Test Cases

Scenario-Based Test Cases

Test cases designed to cover a business scenario’s testing points.

Purpose: Validate a complete business workflow or user journey

Example Scenario: User Registration and Login Flow

Test Cases:

  1. Test successful user registration and login

    • Register new user with valid data
    • Login with registered credentials
    • Verify user profile is accessible
  2. Test registration with duplicate email

    • Attempt to register with existing email
    • Verify 409 Conflict error is returned
  3. Test login with invalid credentials

    • Attempt to login with wrong password
    • Verify 401 Unauthorized error is returned

API-Based Test Cases

Test cases designed to cover a single API’s testing points.

Purpose: Validate all aspects of one API endpoint

Example API: POST /users

Test Cases:

  1. Test create user with valid data

    • Send valid user data
    • Verify 201 Created response
    • Verify user data in response
  2. Test create user with missing required fields

    • Send request without email
    • Verify 400 Bad Request error
  3. Test create user with invalid email format

    • Send request with invalid email
    • Verify 400 Bad Request error
  4. Test create user with duplicate email

    • Send request with existing email
    • Verify 409 Conflict error

Review Test Cases

Review the generated test cases and:

  • Check titles are clear
  • Verify descriptions match your intent
  • Confirm correct APIs are selected

Generate Test Cases Later

In the homepage, you can generate test cases in two ways:

From Scenario

Navigate to the ‘Scenario Test’ tab. Select a scenario to generate test cases covering that business flow.

From API

Navigate to the ‘API Test’ tab. Select an API to generate test cases covering that endpoint’s functionality.

Edit Test Cases

In the test case list, you can:

  • Edit test case title and description
  • Add new test cases
  • Delete test cases

Next Steps

After designing test cases:

  1. Generate Test - Generate test plan and code

← Back: Generate Scenario | ← Documentation | Next: Generate Test →