Skip to content

Commit 3d7a396

Browse files
authored
Added run, edited existing with changes (#590)
1 parent e41c3b8 commit 3d7a396

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

versioned_docs/version-3.0.0/running-keploy/review-and-improve-ai-generated-tests.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ Keploy lets you refine both the **request definition** and the **assertions** fr
5353

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

56+
## 📚 Assertion Types & Examples
57+
58+
Keploy supports nine assertion primitives out-of-the-box.
59+
Mix-and-match them as needed—every example below can live inside the same `assertions:` array of a test step.
60+
61+
| **Type** | **What It Checks** | **YAML Snippet** | **Passing Example** |
62+
| --------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
63+
| **Status Code** | Response code equals an exact number. | `yaml<br>- type: status_code<br> comparator: equal<br> expected: 201<br>` | `POST /users` returns **201 Created** |
64+
| **Status Code Class** | Response code falls within a class (2xx, 3xx …). | `yaml<br>- type: status_code_class<br> comparator: equal<br> expected: 2xx<br>` | `PATCH /users/42`**204 No Content** |
65+
| **Status Code In** | Response 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 |
66+
| **JSON Equal** | **Entire** 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 }` |
67+
| **JSON Contains** | Body **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 |
68+
| **Header Contains** | Specific header **includes** a substring. | `yaml<br>- type: header_contains<br> field: content-type<br> expected: json<br>` | `content-type: application/**json**; charset=utf-8` |
69+
| **Header Equal** | Header 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) |
70+
| **Header Exists** | Header key is present (value ignored). | `yaml<br>- type: header_exists<br> field: x-request-id<br>` | Reverse-proxy injects `x-request-id: 4b087…` |
71+
| **Header Matches** | Header 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` |
72+
73+
> **Tip 🛠️**
74+
> 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.
75+
5676
## Edit or Delete a Test Suite
5777

5878
Manage entire suites easily from the **Test Suites** list:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: run-ai-generated-api-tests
3+
title: Run AI-Generated API Tests
4+
sidebar_label: Run Tests
5+
description: Discover how to execute Keploy’s AI-generated API test suites—locally, on-demand from the console, or automatically in CI/CD—and interpret the results to keep your API stable.
6+
---
7+
8+
Once you’ve finished curating a suite , it’s time to hit **Run** and see how your API behaves against the latest contract.
9+
10+
## Open the **Run Tests** Modal
11+
12+
1. In the top-right of the Test-Suite workspace, click the green **Run Tests** button.
13+
14+
2. The modal will open with **two tabs**:
15+
16+
| Tab | What to Fill In |
17+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18+
| **Endpoint** | **API Endpoint URL** – the base URL Keploy will prepend to every request in the suite (e.g. `https://jsonplaceholder.typicode.com`). |
19+
| **Authentication** | (Optional) Drop in a **Bearer**, **Basic**, or **API-key** credential that applies to every step.<br />You can also add per-step auth later in the test-step editor. |
20+
21+
3. Click **Run Tests** to start execution. A toast confirmation appears and the modal closes.
22+
23+
## Watch the Run Spin Up
24+
25+
A **Run Badge** next to each suite row flips from _queued__running__✔ passed_ or _✖ failed_ in real time.
26+
27+
## View the Test-Run Report
28+
29+
1. Click the **📄 View Test Run Report** link that appears in the toast, or switch to the **Run Reports** icon in the sidebar.
30+
2. The summary table shows:
31+
32+
| Column | Meaning |
33+
| --------------------------- | ---------------------------------------------------------- |
34+
| **Report ID** | UUID of this run (use it in CI logs or API calls). |
35+
| **Created At** | Timestamp the run was triggered. |
36+
| **Creator** | Email or token that kicked off the run. |
37+
| **Total / Passed / Failed** | Quick health check of your suite. |
38+
| **Status** | `QUEUED`, `RUNNING`, or `COMPLETED` (green if 100 % pass). |
39+
40+
3. Click any **Report ID** to drill into per-test details: request/response dumps, assertion diff views, execution time, and re-run buttons for flaky steps.
41+
42+
## Re-running After Fixes
43+
44+
Iterate quickly:
45+
46+
1. Patch your API or tweak assertions from the "Test Suite".
47+
2. Re-click **Run Tests**—Keploy re-uses the same Endpoint/Auth settings you last entered.
48+
3. Compare the new report with the previous one right in the dashboard to verify the fix.
49+
50+
You now have a pipeline—from triggering the run to an all-green build—that safeguards your API contract in every environment.

versioned_sidebars/version-3.0.0-sidebars.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"items": [
2323
"running-keploy/review-and-improve-ai-generated-tests",
2424
"running-keploy/share-tests",
25-
"running-keploy/self-healing-ai-api-tests"
25+
"running-keploy/self-healing-ai-api-tests",
26+
"running-keploy/run-ai-generated-api-tests"
27+
2628
]
2729
},
2830
{

0 commit comments

Comments
 (0)