Skip to main content
Version: 3.0.0

Review & Improve AI-Generated API Tests

After you’ve generated a starter test suite with Keploy’s AI engine, the next step is to review, refine, and harden those tests so they stay trustworthy as your API evolves.

Open the Test Review Workspace

Head to the Keploy Console → API Test Generation › Test Suite Based on the app that is selected, you can view the test suite for that app

Filtering by Status, Method & Endpoint

Use the Filter Options bar in the left Test‑Suites pane to slice large suites down to exactly what you need:

Filter TabHow It Helps
Status CodeType 2 to list every 2xx, 30 for redirects, or an exact code like 404.
HTTP MethodToggle to isolate GET, POST, PUT, DELETE, and other verbs.
EndpointStart typing a path fragment (e.g. /orders, /auth) to instantly narrow matching flows.

You can combine these filters with the search bar—for example, view only failed DELETE calls on eg: /employees—making it painless to triage huge test suites.

Edit Test Step – Request & Assertions

Keploy lets you refine both the request definition and the assertions from a single modal:

  1. Click the ✏️ Edit icon on any step card.
  2. The modal opens with two tabs:

📨 Request Details

  • Change the HTTP method (GET, POST, …)
  • Update the URL path
  • Add or remove headers via + Add Header
  • Edit the request body (JSON, form‑data, etc.)

✅ Assertions

  • Append new checks with + Add Assertion
  • Pick the assertion type:
    • Status Code
    • Header Equal / Contains
    • Body JSONPath
    • Regex
    • Numeric > / <, etc.
  • Modify comparators or expected values in‑place

Save & Rollback

Hit Save Changes – every edit is version‑controlled so you can roll back anytime.

📚 Assertion Types & Examples

Keploy supports nine assertion primitives out-of-the-box.
Mix-and-match them as needed—every example below can live inside the same assertions: array of a test step.

TypeWhat It ChecksYAML SnippetPassing Example
Status CodeResponse code equals an exact number.yaml<br>- type: status_code<br> comparator: equal<br> expected: 201<br>POST /users returns 201 Created
Status Code ClassResponse code falls within a class (2xx, 3xx …).yaml<br>- type: status_code_class<br> comparator: equal<br> expected: 2xx<br>PATCH /users/42204 No Content
Status Code InResponse code is one of a whitelist of codes.yaml<br>- type: status_code_in<br> expected: [200, 201, 202]<br>Upload API may respond with 202 Accepted while processing async
JSON EqualEntire JSON body matches exactly (order-agnostic).yaml<br>- type: json_equal<br> expected:<br> id: 42<br> status: "shipped"<br>Warehouse service returns { "status": "shipped", "id": 42 }
JSON ContainsBody contains a subset of fields/values.yaml<br>- type: json_contains<br> expected:<br> status: "error"<br> message: "invalid token"<br>Auth service returns a long error payload that includes those two fields
Header ContainsSpecific header includes a substring.yaml<br>- type: header_contains<br> field: content-type<br> expected: json<br>content-type: application/**json**; charset=utf-8
Header EqualHeader equals an exact value (case-insensitive).yaml<br>- type: header_equal<br> field: cache-control<br> expected: "no-store"<br>cache-control: No-Store (case doesn’t matter)
Header ExistsHeader key is present (value ignored).yaml<br>- type: header_exists<br> field: x-request-id<br>Reverse-proxy injects x-request-id: 4b087…
Header MatchesHeader value matches a regex pattern.yaml<br>- type: header_matches<br> field: set-cookie<br> pattern: "sessionId=.*; Path=/; HttpOnly"<br>set-cookie: sessionId=abc123; Path=/; HttpOnly; SameSite=Lax

**Tip **
Combine multiple assertions in one step to cover status, headers and body in a single round-trip. Every assertion is evaluated independently, so one failure pinpoints the exact mismatch.

Edit and Manage Test Suites

In the Test Suites list, hover over any row to reveal the ︙ (more-options) menu:

︙ Menu: Hover over any suite row to reveal options:

  • Add Test Suite – Create a new suite and give it a clear, descriptive title.
  • Select Test Suite – Choose an existing suite for running or further changes.
  • Edit Test Suite – Update the suite’s name, description, or included tests.
  • Delete Test Suite – Permanently remove a suite you no longer need.

All changes are saved instantly and logged. ⚠️ Deletion is irreversible. Use Git history or backups to restore.

Question? 🤔💭

For any support please join keploy slack community to get help from fellow users, or book a demo if you're exploring enterprise use cases.