Skip to content

Commit ff92463

Browse files
authored
Add Chrome extension, select tests (#596)
* Add Chrome extension, select tests * chore : Select and edit suites, add in sidebar * added line irreversible
1 parent e32cfbd commit ff92463

File tree

3 files changed

+100
-10
lines changed

3 files changed

+100
-10
lines changed
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. |

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,19 @@ Mix-and-match them as needed—every example below can live inside the same `ass
7070
| **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…` |
7171
| **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` |
7272

73-
> **Tip 🛠️**
73+
> **Tip **
7474
> 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.
7575
76-
## Edit or Delete a Test Suite
76+
## Edit and Manage Test Suites
7777

78-
Manage entire suites easily from the **Test Suites** list:
78+
In the Test Suites list, hover over any row to reveal the ︙ (more-options) menu:
7979

80-
- **︙ Menu**: Hover over any suite row to reveal options:
81-
- ✏️ **Rename** – Update the title and description.
82-
- 📄 **Duplicate** – Clone the suite with all steps and tags.
83-
- 🗑️ **Delete** – Permanently remove the suite (with confirmation).
80+
**︙ Menu**: Hover over any suite row to reveal options:
8481

85-
All changes are saved instantly and logged.
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.
8686

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

versioned_sidebars/version-3.0.0-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"label": "Getting Started",
1313
"collapsed": false,
1414
"items": [
15-
"running-keploy/generate-api-tests-using-ai"
15+
"running-keploy/generate-api-tests-using-ai",
16+
"running-keploy/api-testing-chrome-extension"
1617
]
1718
},
1819
{

0 commit comments

Comments
 (0)