Skip to content

Commit d01ecb6

Browse files
committed
Add Chrome extension, select tests
1 parent 3d7a396 commit d01ecb6

File tree

2 files changed

+95
-6
lines changed

2 files changed

+95
-6
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
id: api-testing-chrome-extension
3+
title: API Test Recorder (Chrome Extension)
4+
sidebar_label: Review & Improve Tests
5+
description: Learn how to install, record, export, and auto-generate Keploy tests straight from your browser.
6+
---
7+
Install the extension, hit **Record API Calls**, exercise your web app, then press **Generate Tests** to send the captured traffic to Keploy.
8+
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+
31+
## Quick-start workflow
32+
33+
1. **Log in** with the same email you use on app.keploy.io.
34+
2. Click **Record API Calls**.
35+
3. In another tab, **exercise your app** as a normal user (create an account, add to cart, etc.).
36+
4. Watch the live counters:
37+
* **Captured calls** – total XHR/fetch requests intercepted.
38+
* **Complete req/resp** – pairs where both request *and* response were fully captured.
39+
5. If the count of req/res is lower than expected, hit **Debug** to repair missing pairs.
40+
Example :
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+
79+
## Best practices
80+
81+
* **Enter URL** – Set the URL Filter to the base domain you want Keploy to record. This keeps captures focused on the traffic that matters.
82+
* **Keep sessions short** – Generate tests for one functional flow at a time; iterate rather than record everything in one go.
83+
84+
85+
## Troubleshooting
86+
87+
| Symptom | Possible cause | Fix |
88+
|---------|----------------|-----|
89+
| `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. |
90+
| “Network error” when pressing **Generate Tests** | Auth token expired. | Log out, log back in. |
91+

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,16 @@ 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+
## Select a Test Suite
7777

7878
Manage entire suites easily from the **Test Suites** list:
7979

8080
- **︙ 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).
81+
- **Add Test Suite** – Create a new suite and give it a clear title and description.
82+
- **Select Test Suite** – Choose an existing suite to duplicate, automatically copying all its steps and tags.
8483

8584
All changes are saved instantly and logged.
8685

87-
> ⚠️ Deletion is irreversible. Use Git history or backups to restore.

0 commit comments

Comments
 (0)