You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix agent test generation page per review feedback
1. Replace Windsurf with Antigravity (rebranded)
2. Point installation to /docs/keploy-cloud/cloud-installation/
instead of GitHub repo links (enterprise is proprietary)
3. Move doc from keploy-cloud/ to running-keploy/ (API Testing section)
4. Use "Keploy Enterprise" and "keploy test-gen" instead of "keploy-runner"
5. Remove all GitHub links to keploy/enterprise (private repo)
6. Make OpenAPI spec explicitly optional; note platform builds
schema coverage progressively from test runs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: slayerjain <shubhamkjain@outlook.com>
Copy file name to clipboardExpand all lines: versioned_docs/version-4.0.0/running-keploy/agent-test-generation.md
+67-69Lines changed: 67 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
---
2
2
id: agent-test-generation
3
-
title: Agent-Based Test Generation
4
-
sidebar_label: Agent Test Generation
5
-
description: Generate API tests using AI coding agents (Claude Code, Cursor, Windsurf) with the keploy-runner CLI
3
+
title: Agent-Based API Test Generation
4
+
sidebar_label: AI Agent Testing
5
+
description: Generate API tests using AI coding agents like Claude Code, Cursor, and Antigravity with Keploy Enterprise
6
6
tags:
7
7
- AI Agent
8
8
- Test Generation
9
9
- Claude Code
10
10
- Cursor
11
-
- Windsurf
12
-
- keploy-runner
13
-
- CLI
11
+
- Antigravity
12
+
- API Testing
14
13
keywords:
15
14
- AI agent test generation
16
15
- Claude Code
17
16
- Cursor
18
-
- keploy-runner
17
+
- Antigravity
18
+
- Keploy Enterprise
19
19
- API testing
20
20
- coverage feedback loop
21
21
---
@@ -26,56 +26,52 @@ import ProductTier from '@site/src/components/ProductTier';
26
26
27
27
## Overview
28
28
29
-
Keploy's agent-based test generation lets AI coding assistants (Claude Code, Cursor, Windsurf, GitHub Copilot) generate and iterate on API tests directly in your IDE. Instead of using a separate web UI, the agent:
29
+
Keploy Enterprise supports agent-based test generation, allowing AI coding assistants (Claude Code, Cursor, Antigravity, GitHub Copilot) to generate and iterate on API tests directly in your IDE.
30
30
31
-
1.**Generates test YAML** using the Keploy test format (taught via CLAUDE.md or .cursorrules)
32
-
2.**Runs tests** via the `keploy-runner` CLI with structured JSON output
31
+
Instead of switching to a separate web UI, the agent:
32
+
33
+
1.**Generates test YAML** using the Keploy test format
34
+
2.**Runs tests** via Keploy Enterprise with structured JSON output
33
35
3.**Reads coverage gaps** from the output and generates targeted tests
34
36
4.**Syncs results** to the Keploy platform for team-wide visibility
35
37
36
-
This eliminates the "double LLM tax"—the agent writes tests directly instead of calling a second LLM.
38
+
The Keploy platform automatically builds and refines the API schema over time from your test runs, so providing an OpenAPI spec upfront is **optional**.
37
39
38
40
## Prerequisites
39
41
40
-
-Go 1.26+ installed (the version required by the enterprise module)
- An OpenAPI spec (optional, enables coverage feedback loop)
43
-
44
-
## Installation
44
+
- An OpenAPI spec (optional; the platform generates schema coverage over time)
45
45
46
-
```bash
47
-
# From the keploy/enterprise repository
48
-
go install github.com/keploy/enterprise/v3/cmd/keploy-runner@latest
49
-
```
46
+
## Setup for AI Agents
50
47
51
-
Or build from source:
48
+
To teach your AI agent the Keploy test format, add a context file to your project root. The agent reads this file and learns how to generate valid test suites.
Create a `CLAUDE.md` file in your project root with the Keploy test format reference. Claude Code automatically reads project-level markdown files. The file should document:
60
53
61
-
### Claude Code
54
+
- The YAML test suite schema (name, description, steps)
55
+
- Available assertion types (status_code, json_equal, json_contains, etc.)
56
+
- Variable extraction and substitution rules
57
+
- The CLI commands to run and validate tests
62
58
63
-
Copy `CLAUDE.md` from the [agent-docs directory](https://github.com/keploy/enterprise/tree/main/agent-docs) to your project root. Claude Code will automatically read it and learn the test format.
59
+
See the [Test Suite YAML Format](#test-suite-yaml-format) section below for the complete schema to include.
64
60
65
61
### Cursor
66
62
67
-
Copy the `cursorrules` file from agent-docs to `.cursorrules`in your project root.
63
+
Create a `.cursorrules` file in your project root with the same test format reference.
68
64
69
-
### Windsurf / Other MCP-compatible agents
65
+
### Antigravity
70
66
71
-
Use the same CLAUDE.md content as system instructions or project context.
67
+
Use the same test format documentation as system instructions or project context.
72
68
73
69
## Workflow
74
70
75
71
### 1. Initialize the test directory
76
72
77
73
```bash
78
-
keploy-runner init --dir ./keploy
74
+
keploy test-gen init --dir ./keploy
79
75
```
80
76
81
77
This creates:
@@ -85,36 +81,37 @@ This creates:
85
81
86
82
### 2. Generate tests with your AI agent
87
83
88
-
Ask your agent to generate tests. It will use the format from CLAUDE.md:
84
+
Ask your agent to generate tests:
89
85
90
-
> "Generate API tests for my user CRUD endpoints based on the OpenAPI spec"
86
+
> "Generate API tests for my user CRUD endpoints"
91
87
92
88
The agent writes YAML test files directly to `keploy/tests/`.
93
89
94
90
### 3. Run tests
95
91
96
92
```bash
97
-
keploy-runner run --base-url http://localhost:8080 --output json
93
+
keploy test-gen run --base-url http://localhost:8080 --output json
98
94
```
99
95
100
-
The JSON output includes pass/fail status, assertion failures, and extracted variables—the agent reads this to fix failing tests.
96
+
The JSON output includes pass/fail status, assertion failures, and extracted variables. The agent reads this to fix failing tests.
101
97
102
-
### 4. Coverage feedback loop
98
+
### 4. Coverage feedback loop (optional)
103
99
104
-
Add `--spec`to include coverage analysis:
100
+
If you have an OpenAPI spec, add `--spec`for coverage analysis:
105
101
106
102
```bash
107
-
keploy-runner run --base-url http://localhost:8080 --spec openapi.yaml --output json
103
+
keploy test-gen run --base-url http://localhost:8080 --spec openapi.yaml --output json
108
104
```
109
105
110
-
The output now includes a `coverage` section with `next_steps`—prioritized suggestions for uncovered endpoints. The agent reads these and generates targeted tests automatically.
106
+
The output includes a `coverage` section with `next_steps`—prioritized suggestions for uncovered endpoints. The agent reads these and generates targeted tests automatically.
107
+
108
+
Even without a spec, the Keploy platform builds schema coverage over time from your test runs. You can view this on the Keploy dashboard.
| 1 | Test failures, validation errors, coverage below threshold, or sync failure (in `--ci` mode) |
265
261
266
262
## Coverage Feedback Loop
@@ -287,3 +283,5 @@ When `--spec` is provided, every `run` output includes a `coverage` section:
287
283
```
288
284
289
285
The agent reads `next_steps` and generates targeted tests for uncovered endpoints. This loop continues automatically until coverage targets are met.
286
+
287
+
Without an OpenAPI spec, you can still run tests and sync results. The Keploy platform builds schema coverage progressively from your test execution data over time.
0 commit comments