Skip to content

Commit 0972d2c

Browse files
Merge branch 'main' into lint-issue
Signed-off-by: Pratik Mahalle <[email protected]>
2 parents 616e6f3 + a86767f commit 0972d2c

File tree

6 files changed

+46
-8
lines changed

6 files changed

+46
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ MinAlertLevel = error
120120

121121
### Running Vale
122122

123-
1. Linting Documentation: To check all markdown files in versioned_docs/version-2.0.0/ for errors, run:
123+
1. Linting Documentation: To check all markdown files in versioned_docs/version-3.0.0/ for errors, run:
124124

125125
```bash
126-
vale versioned_docs/version-2.0.0/**/*.md
126+
vale versioned_docs/version-3.0.0/**/*.md
127127
```
128128

129129
2. Review Errors:

versioned_docs/version-3.0.0/quickstart/python-flask-mongo.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ We'll be running our sample application right on Linux, but just to make things
214214
pip install -r requirements.txt
215215
```
216216

217-
## Start the MongoDB server
217+
## Start the MongoDB container
218218

219219
```bash
220-
sudo service mongod start
220+
docker run -p 27017:27017 -d --network backend --name mongo mongo
221221
```
222222

223+
> **Since we are using a MongoDB container, we need to update the `client` on line 11 in `app.py`, to `localhost`.**
224+
223225
## Lights, Camera, Record! 🎥
224226

225227
To initiate the recording of API calls, execute this command in your terminal:

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,30 @@ keploy normalize [flags]
299299

300300
## [rerecord](#rerecord)
301301

302-
The `rerecord`cmd allow user to record new keploy testcases/mocks from the existing test cases for the given testsets.
302+
The `rerecord` command allows users to record new Keploy test cases and mocks from existing test cases for the given testset(s).
303303

304-
<b> Usage: </b>
304+
**Usage:**
305305

306306
```bash
307307
keploy rerecord -c "node src/app.js" -t "test-set-0"
308308
```
309309

310+
**Docker Example:**
311+
312+
To re-record test cases for an application running inside a Docker container, use the Docker run command as the value for the `-c` flag:
313+
314+
```bash
315+
keploy rerecord -c "sudo docker run -p 5000:5000 --name flask-jwt-app --network keploy-network flask-jwt-app" -t "test-set-0" --delay 10
316+
```
317+
318+
**`--delay` flag:**
319+
320+
The `--delay` flag specifies the number of seconds Keploy should wait after starting your application before replaying requests to re-record.
321+
This is useful if your application takes some time to start (for example, when running inside a Docker container or a heavy framework).
322+
323+
- Adjust the delay to match your app's startup time.
324+
- For example, use `--delay 10` to wait for 10 seconds.
325+
310326
## [templatize](#templatize)
311327

312328
The `templatize` cmd allows the user to templatize important fields in the testcases who's values are used in the request of testcases and that may change in the future.

versioned_docs/version-3.0.0/running-keploy/configuration-file.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,25 @@ The tests section enables you to specify conditions for recording tests during A
238238

239239
You can use the **`path`**, **`urlMethods`**, **`headers`**, and **`host`** filters together or independently based on your testing scenarios. This flexibility allows you to precisely define the conditions under which tests are recorded.
240240

241+
### Managing Secrets with `secret.yaml`
242+
243+
Keploy allows you to manage sensitive information like API keys or tokens securely, without hardcoding them into your test files. This is done using a `secret.yaml` file within each test set directory.
244+
245+
1. **Create `secret.yaml`**: Inside your test set directory (e.g., `keploy/test-set-0/`), create a file named `secret.yaml`.
246+
247+
2. **Define Your Secrets**: Add your secrets as key-value pairs.
248+
249+
```yaml
250+
Authorization: Bearer xyz.abc.123
251+
```
252+
253+
3. **Use Secrets in Tests**: Reference these values in your test cases or mocks using the `{{.secret.KEY}}` syntax.
254+
```yaml
255+
header:
256+
Authorization: "{{string .secret.Authorization }}"
257+
```
258+
For your security, Keploy will automatically add `/*/secret.yaml` to your `.gitignore` file to prevent accidentally committing secrets.
259+
241260
### Bypass Rules Section
242261

243262
The `bypassRules` section in the Keploy-config file allows you to define parameters for bypassing and mocking API calls.

versioned_docs/version-3.0.0/running-keploy/generate-api-tests-using-ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Learn how to use Keploy’s API Test Generator to generate high-qua
77

88
This guide will help you generate automated API tests using Keploy's AI-based test engine by providing structured inputs like OpenAPI specs, curl commands, Postman collections, or live endpoints.
99

10-
> 👉 If you want to record API flows by interacting with your web app through a browser, follow this guide instead: Record API Tests via Chrome Extension
10+
> 👉 If you want to record API flows by interacting with your web app through a browser, follow this guide instead: [Record API Tests via Chrome Extension](https://keploy.io/docs/running-keploy/api-testing-chrome-extension/)
1111
1212
## Getting Started
1313

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ 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**
74+
7475
> 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.
7576
7677
## Edit or Delete a Test Suite

0 commit comments

Comments
 (0)