Skip to content

Commit 6da7a45

Browse files
authored
Merge branch 'main' into ctr-improvement
2 parents f81c108 + 40966d8 commit 6da7a45

File tree

8 files changed

+294
-22
lines changed

8 files changed

+294
-22
lines changed

src/components/KeployCloud.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const KeployCloud = () => {
66
id="cloud"
77
className="mb-12 mt-24 flex max-w-7xl items-center space-x-5 rounded-lg bg-[color:var(--ifm-card-background-color)] p-5"
88
>
9-
<div className="max-w-3xl mx-auto prose prose-orange">
9+
<div className="prose prose-orange mx-auto max-w-3xl">
1010
<h1> Question? 🤔💭</h1>
1111
<p className="my-3 block">
1212
For any support please{" "}

versioned_docs/version-3.0.0/quickstart/java-spring-postgres.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ This project has two parts - the frontend and backend, since Keploy is a backend
3737

3838
## Setup the frontend
3939

40+
### Prerequisites For Frontend:
41+
42+
1. Node version 16.x and above
43+
4044
```bash
4145
git clone https://github.com/keploy/samples-java.git
4246
cd samples-java/spring-petclinic/spring-petclinic-angular
43-
npm uninstall -g angular-cli @angular/cli
44-
npm cache clean
45-
npm install -g @angular/cli@latest
46-
npm install --save-dev @angular/cli@latest
47-
npm i
47+
npm i --legacy-peer-deps
4848
```
4949

5050
## Start the frontend
@@ -64,13 +64,12 @@ You can start the backend using Keploy in 2 ways:
6464
- [Using Keploy's binary](#instructions-for-starting-using-binary)
6565
- [Using Keploy's docker image](#instructions-for-starting-using-docker)
6666

67-
# Instructions For Starting Using Binary
67+
# Instructions For Starting Using API backend Binary
6868

69-
Prerequisites For Binary:
69+
Prerequisites For API backend Binary:
7070

71-
1. Node 20.11.0 LTS
72-
2. OpenJDK 17.0.9
73-
3. MVN version 3.6.3
71+
1. OpenJDK 17+
72+
2. MVN version 3.6+
7473

7574
## Setup the backend
7675

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
id: api-testing-chrome-extension
3+
title: API Test Recorder (Chrome Extension)
4+
sidebar_label: API Test Recorder
5+
description: Learn how to install, record, export, and auto-generate Keploy tests straight from your browser.
6+
---
7+
8+
Install the extension, hit **Record API Calls**, exercise your web app, then press **Generate Tests** to send the captured traffic to Keploy.
9+
10+
## What the API Test Recorder does
11+
12+
**Browser-side traffic capture** — Sniffs XHR / fetch calls as you click around.
13+
14+
**Instant replay formats** — Export the captured calls as cURL, JSON, or native Keploy YAML.
15+
16+
**URL filtering & debugging** — Limit capture to specific endpoints and auto-repair partial request/response pairs.
17+
18+
**One-click test generation** — Push traffic to Keploy Console and instantly get ready-to-run API tests with assertions.
19+
20+
## Installation
21+
22+
1. [Open the Chrome Web Store listing for **Keploy API Test Recorder**](https://chromewebstore.google.com/detail/keploy-api-test-recorder/ohcclfkaidblnjnggclkiecgkpgldihe)
23+
24+
2. Click **Add to Chrome → Add Extension**.
25+
Chrome will download the signed build and enable it automatically.
26+
27+
3. Pin the **Keploy API Test Recorder** icon for quick access:
28+
**Extensions** **⋮ → Pin**.
29+
30+
## Quick-start workflow
31+
32+
1. **Log in** with the same email you use on app.keploy.io.
33+
2. Click **Record API Calls**.
34+
3. In another tab, **exercise your app** as a normal user (create an account, add to cart, etc.).
35+
4. Watch the live counters:
36+
- **Captured calls** – total XHR/fetch requests intercepted.
37+
- **Complete req/resp** – pairs where both request _and_ response were fully captured.
38+
5. If the count of req/res is lower than expected, hit **Debug** to repair missing pairs.
39+
Example :
40+
41+
```
42+
DEBUG SUMMARY:
43+
44+
Total calls: 33
45+
Complete (status+body): 2
46+
Incomplete: 31
47+
Has status but no body: 13
48+
Has body but no status: 0
49+
Flagged as complete: 30
50+
Records repaired: 15
51+
```
52+
53+
6. Press **Generate Tests**.
54+
- The extension POSTs the capture set to `https://app.keploy.io`.
55+
- Your browser opens a new tab showing test-case generation progress.
56+
- When done, you’ll see a **Test Suite** with runnable cases
57+
7. From **Export Format**, choose:
58+
- **cURL Commands** – one-liner per call, shareable in Slack/Gist.
59+
- **Keploy YAML** – ready for `keploy run`.
60+
- **JSON** – raw payloads for custom tooling.
61+
8. Click **Export Data** to download **or** **Copy** to clipboard.
62+
63+
## UI reference
64+
65+
| Button / Field | Purpose | Notes |
66+
| --------------------- | ------------------------------------------------- | ------------------------------------------ |
67+
| **Logout** | Clear auth token & stop background listeners. | Re-login any time. |
68+
| **Record API Calls** | Starts/stops the capture session. | Active state is shown in red. |
69+
| **Captured calls** | Blue counter of total requests. | Includes incomplete pairs. |
70+
| **Complete req/resp** | Green counter of fully captured pairs. | This is the number exported. |
71+
| **Check Status** | Quick health-check of the local capture DB. |
72+
| **Debug** | Attempts to stitch orphaned requests & responses. |
73+
| **Reset DB** | DANGER: Wipes all local capture data. | Irreversible; handy before a new test run. |
74+
| **URL Filter** | Regex or plain URL substring. | Leave blank to capture everything. |
75+
| **Copy** | Copies the export to clipboard. | Good for quick pastes into terminal. |
76+
| **Generate Tests** | Sends data to Keploy Console & redirects. | Requires active internet. |
77+
78+
## Best practices
79+
80+
- **Enter URL** – Set the URL Filter to the base domain you want Keploy to record. This keeps captures focused on the traffic that matters.
81+
- **Keep sessions short** – Generate tests for one functional flow at a time; iterate rather than record everything in one go.
82+
83+
## Troubleshooting
84+
85+
| Symptom | Possible cause | Fix |
86+
| ------------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------ |
87+
| `Captured calls` increments, but `Complete req/resp` stays 0 | Responses blocked by CORS or Service Worker. | Click **Debug**, or whitelist the domain in extension permissions. |
88+
| “Network error” when pressing **Generate Tests** | Auth token expired. | Log out, log back in. |
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
id: api-testing-cicd
3+
title: API Test Setup for GitHub CI/CD
4+
sidebar_label: CI/CD Integration
5+
description: Learn how to seamlessly integrate Keploy's AI-powered API tests with GitHub Actions for continuous testing.
6+
tags:
7+
- API testing
8+
- test automation
9+
- AI testing
10+
- ci testing
11+
- plugin
12+
- ci pipeline
13+
keywords:
14+
- fix failing tests
15+
- ci testing
16+
- ci/cd
17+
- github
18+
---
19+
20+
Keploy makes it super simple to run API tests during your CI/CD pipeline on GitHub. Here’s a step-by-step guide to help you set it up in just a few minutes!
21+
22+
## Step 1: Get the Test Command from Keploy Dashboard
23+
24+
1. Go to [app.keploy.io](https://app.keploy.io)
25+
2. Click on **Test Suite** in the sidebar
26+
27+
![Test Suite Page](https://keploy-devrel.s3.us-west-2.amazonaws.com/testsuite-apitesting.png)
28+
29+
3. You'll see an option to “Run test suites natively”
30+
31+
![Run Natively Button](https://keploy-devrel.s3.us-west-2.amazonaws.com/apitestsuites.png)
32+
33+
4. **Copy the command**
34+
![Copy Command](https://keploy-devrel.s3.us-west-2.amazonaws.com/apitesting-ci-cmd.png)
35+
36+
## Step 2: Set Up GitHub Actions Workflow
37+
38+
Add the following steps to your `.github/workflows/ci.yml` file:
39+
40+
### Install Keploy CLI
41+
42+
```yaml
43+
- name: Install Keploy CLI
44+
run: |
45+
curl --silent -L https://keploy.io/ent/install.sh | bash
46+
```
47+
48+
### Run Keploy API Tests
49+
50+
Paste the command copied from the dashboard here:
51+
52+
```yaml
53+
- name: Run Keploy Test Suite
54+
run: |
55+
export KEPLOY_API_KEY=${{ secrets.KEPLOY_API_KEY }}
56+
keploy test-suite --app=03d24177-315c-4ee1-a3ac-64ed0ab38567 --base-path http://localhost:8080/books --cloud
57+
```
58+
59+
### ⚠️ **Note**
60+
61+
Don’t forget to add your `KEPLOY_API_KEY` as a GitHub secret!
62+
**Go to your repo → Settings → Security → Actions → _New Repository Secret_**
63+
64+
Replace `--app` and `--base-path` with your actual values from the Keploy Dashboard.
65+
66+
## Output Example: Real-time Test Execution Logs
67+
68+
Once integrated, here’s what a successful run may look like in your GitHub Actions console:
69+
70+
```sh
71+
🐰 Keploy: Running test suite {"name": "Create and update one book verify other is unaffected via list"}
72+
🐰 Keploy: Running test case {"name": "Create Book A"}
73+
🐰 Keploy: step passed {"step": "Create Book A"}
74+
...
75+
76+
+------------------------------------------+--------+-------+
77+
| Test Case | Status | Runs |
78+
+------------------------------------------+--------+-------+
79+
| Create book with only title | PASSED | 1 |
80+
| Create book with invalid progress | PASSED | 1 |
81+
| Delete book by very large ID | PASSED | 1 |
82+
| Update book by invalid ID format | PASSED | 1 |
83+
| ... | ... | ... |
84+
+------------------------------------------+--------+-------+
85+
86+
Test suite execution summary
87+
Total suites: 122
88+
Passed suites: 122
89+
Failed suites: 0
90+
```
91+
92+
## That's it!
93+
94+
With just a few lines of YAML, you’ve added **AI-powered API test automation** into your GitHub CI pipeline. Now every PR or deployment will be automatically tested with Keploy’s smart test engine.
95+
96+
import GetSupport from '../concepts/support.md'
97+
98+
<GetSupport/>

versioned_docs/version-3.0.0/running-keploy/cli-commands.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Here are some examples of how to use some common flags:
2525

2626
| Mode | Flags Available |
2727
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28-
| `record` | `-c, --command`, `--config-path`, `--containerName`, `-d, --delay`, `-n, --networkName`, `--passThroughPorts`, `-p, --path`, `--proxyport`, `--debug` |
28+
| `record` | `-c, --command`, `--config-path`, `--containerName`, `-d, --delay`, `--metadata`, `-n, --networkName`, `--passThroughPorts`, `-p, --path`, `--proxyport`, `--debug` |
2929
| `test` | `--apiTimeout`, `-c, --command`, `--config-path`, `--containerName`, `-d, --delay`, `--mongoPassword`, `-n, --net, --networkName`, `--passThroughPorts`, `-p, --path`, `--proxyport`, `-t, --testsets`, `--debug`, `-g, --generateTestReport`, `--removeUnusedMocks`, `--coverage`, `--goCoverage`, `--ignoreOrdering`, `--skip-preview` |
3030
| `gen` | `--sourceFilePath`, `--testFilePath`,`--coverageReportPath`,`--testCommand`,`--coverageFormat`,`--expectedCoverage`,`--maxIterations`,`--testDir`,`--llmBaseUrl`,`--model`,`--llmApiVersion` |
3131
| `normailze` | `-p, --path`, `--test-run`, `--tests` |
@@ -72,6 +72,18 @@ keploy record [flags]
7272
keploy record -c "node src/app.js" -d 10
7373
```
7474

75+
- `--metadata string` - Key-value pairs to be added as metadata in the config.yaml file. If a `name` key is provided, it will be used as the test set name.
76+
77+
```bash
78+
keploy record -c "node src/app.js" --metadata "name=mac,env=production,service=gin-mongo,version=2.0.0,team.members[0]=alice,team.members[1]=bob,team.members[2]=carol,labels[0]=canary,labels[1]=stable,config.timeout=30s,config.timeout=60s,complex=a\\,b\\,c\\,d,database.urls[0]=db1.internal,database.urls[1]=db2.internal,database.urls[2]=db3.internal,mode=fast,mode=slow"
79+
```
80+
81+
```bash
82+
keploy record -c "node src/app.js" --metadata "name=mac,env=production,service=gin-mongo,version=2.0.0,team.members[0]=alice,team.members[1]=bob,team.members[2]=carol,labels[0]=canary,labels[1]=stable,config.timeout=30s,config.timeout=60s,complex=a\\,b\\,c\\,d,database.urls[0]=db1.internal,database.urls[1]=db2.internal,database.urls[2]=db3.internal,mode=fast,mode=slow"
83+
```
84+
85+
> **Note:** If the same key is used multiple times, the last occurrence will be used.
86+
7587
- `- n, --network-name string` - Name of the docker network in which the user application is running.
7688

7789
```bash

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

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,36 @@ 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-
## Edit or Delete a Test Suite
56+
## 📚 Assertion Types & Examples
5757

58-
Manage entire suites easily from the **Test Suites** list:
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.
5960

60-
- **︙ Menu**: Hover over any suite row to reveal options:
61-
- ✏️ **Rename** – Update the title and description.
62-
- 📄 **Duplicate** – Clone the suite with all steps and tags.
63-
- 🗑️ **Delete** – Permanently remove the suite (with confirmation).
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` |
6472

65-
All changes are saved instantly and logged.
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+
76+
## Edit and Manage Test Suites
77+
78+
In the Test Suites list, hover over any row to reveal the ︙ (more-options) menu:
6679

67-
> ⚠️ Deletion is irreversible. Use Git history or backups to restore.
80+
**︙ Menu**: Hover over any suite row to reveal options:
81+
82+
- **Add Test Suite** – Create a new suite and give it a clear, descriptive title.
83+
- **Select Test Suite** – Choose an existing suite for running or further changes.
84+
- **Edit Test Suite** – Update the suite’s name, description, or included tests.
85+
- **Delete Test Suite** – Permanently remove a suite you no longer need.
86+
87+
All changes are saved instantly and logged.
88+
⚠️ Deletion is irreversible. Use Git history or backups to restore.

0 commit comments

Comments
 (0)