@postman/postman-plugin 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -8
- package/dist/hosts/antigravity.js +47 -0
- package/dist/hosts/copilot.js +60 -0
- package/dist/hosts/index.js +3 -1
- package/mcp.pi.json +2 -2
- package/package.json +1 -1
- package/skills/ai-readiness/SKILL.md +40 -44
- package/skills/api-discovery/SKILL.md +64 -145
- package/skills/api-discovery/reference/orbit.md +17 -5
- package/skills/api-documentation/SKILL.md +41 -46
- package/skills/api-engineer/SKILL.md +78 -23
- package/skills/api-mocking/SKILL.md +117 -163
- package/skills/api-monitoring/SKILL.md +52 -129
- package/skills/api-simulation/SKILL.md +130 -178
- package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
- package/skills/api-testing/SKILL.md +48 -95
- package/skills/bootstrap/SKILL.md +123 -224
- package/skills/ci-integration/SKILL.md +53 -113
- package/skills/collection-schema-v3/SKILL.md +43 -204
- package/skills/collection-schema-v3/reference/http.md +150 -0
- package/skills/datasets/SKILL.md +89 -315
- package/skills/datasets/reference/spreadsheets.md +25 -0
- package/skills/flows/SKILL.md +57 -206
- package/skills/flows/reference/flow_cli_flags.md +3 -2
- package/skills/performance-testing/SKILL.md +46 -62
- package/skills/performance-testing/references/jmeter-import/README.md +113 -0
- package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
- package/skills/performance-testing/references/jmeter-import/mapping-table.md +97 -0
- package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
- package/skills/performance-testing/references/jmeter-import/script-translation.md +98 -0
- package/skills/performance-testing/references/jmeter-import/scripts/groovy_to_js.py +83 -0
- package/skills/performance-testing/references/jmeter-import/scripts/jmx_to_postman.py +1433 -0
- package/skills/postman-mcp-server/SKILL.md +53 -59
- package/skills/postman-mcp-server/references/docs.md +0 -1
- package/skills/postman-mcp-server/references/learn.md +10 -9
- package/skills/postman-mcp-server/references/mock.md +0 -1
- package/skills/postman-mcp-server/references/search.md +0 -1
- package/skills/postman-mcp-server/references/security.md +0 -1
- package/skills/postman-mcp-server/references/setup.md +0 -1
- package/skills/postman-mcp-server/references/sync.md +0 -1
- package/skills/postman-mcp-server/references/test.md +0 -1
- package/skills/variables/SKILL.md +44 -87
- package/skills/webhook-testing/SKILL.md +103 -0
- package/skills/webhook-testing/reference/forwarding.md +10 -0
- package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
- package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
|
@@ -1,112 +1,50 @@
|
|
|
1
|
-
# `.sim.yaml`
|
|
1
|
+
# `.sim.yaml` reference
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`postman
|
|
5
|
-
|
|
6
|
-
same shape with `id:` fields added.
|
|
3
|
+
Read this when writing or debugging a `.sim.yaml` by hand.
|
|
4
|
+
`postman simulation create` writes the same shape; the Postman app adds
|
|
5
|
+
`id:` fields, which a local run ignores.
|
|
7
6
|
|
|
8
7
|
```yaml
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- routeKey: shopping-cart
|
|
19
|
-
path: ../mocks/shopping-cart/config.yaml
|
|
8
|
+
simulation: checkout-dev # required: the name
|
|
9
|
+
routing: path # path (default) or header
|
|
10
|
+
mocks: # required: one entry per member
|
|
11
|
+
- routeKey: catalog # lowercase letters, digits, - and _
|
|
12
|
+
path: ../mocks/catalog/config.yaml # a mock's config.yaml, or a .js handler
|
|
13
|
+
scenarios: # optional: conditions, below
|
|
14
|
+
- overrides:
|
|
15
|
+
conditions:
|
|
16
|
+
latency: { delay_ms: 250 }
|
|
20
17
|
```
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
Run the `.sim.yaml` rather than a simulation id: a run by id drops every
|
|
20
|
+
member's conditions (CLI 1.70.0–1.73.0).
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
| --- | --- | --- |
|
|
26
|
-
| `simulation` | Yes | The simulation's name. |
|
|
27
|
-
| `mocks` | Yes | Non-empty list of members. |
|
|
28
|
-
| `routing` | No | `path` (default) or `header`. Any other value means `path`. |
|
|
29
|
-
| `id` | No | The simulation's id in its workspace. A local run ignores it; leave it as written. |
|
|
30
|
-
|
|
31
|
-
## Member
|
|
32
|
-
|
|
33
|
-
| Key | Required | Notes |
|
|
34
|
-
| --- | --- | --- |
|
|
35
|
-
| `path` | Yes | The mock's `config.yaml`, or a `.js` handler. Relative paths resolve from the `.sim.yaml`'s folder, then from the working directory. `file` is a legacy alias. |
|
|
36
|
-
| `routeKey` | No | The member's address. Lowercase letters, digits, `-` and `_`, at most 64 characters, unique per simulation. Defaults to the kebab-cased name. |
|
|
37
|
-
| `name` | No | Display name. Defaults to the mock's folder name for a `config.yaml`, else the file name. Must be unique. |
|
|
38
|
-
| `scenarios` | No | Fault conditions, below. |
|
|
39
|
-
| `id` | No | The mock's id in its workspace. A local run ignores it. |
|
|
40
|
-
| `port` | No | Ignored by `simulation run`, which gives each member an internal port. |
|
|
41
|
-
|
|
42
|
-
## Routing
|
|
43
|
-
|
|
44
|
-
- **`path`**: a member is at `http://localhost:<port>/<routeKey>`. The first
|
|
45
|
-
path segment selects the member and is stripped, so `/payments/cart` reaches
|
|
46
|
-
the `payments` member as `/cart`. Point the service's base URL for that
|
|
47
|
-
dependency at `http://localhost:<port>/<routeKey>`.
|
|
48
|
-
- **`header`**: every member shares `http://localhost:<port>`, and the caller
|
|
49
|
-
picks one with an `x-mock-slug: <routeKey>` header. Use it only when the
|
|
50
|
-
caller can send that header.
|
|
51
|
-
|
|
52
|
-
The router answers on its own, without reaching a member:
|
|
53
|
-
|
|
54
|
-
| Response | Cause |
|
|
55
|
-
| --- | --- |
|
|
56
|
-
| `400 {"error":"Prefix the request path with the member routing token, e.g. /<routeKey>/path."}` | No routeKey under `path` routing: the path was `/`. Under `header` routing the error asks for the `x-mock-slug` header instead. |
|
|
57
|
-
| `404 {"error":"Unknown simulation member '<x>'.","available":[...]}` | `<x>` isn't a routeKey. Under `path` routing this is often a client that dropped the base URL's path, so `<x>` is the endpoint's own first segment. |
|
|
58
|
-
|
|
59
|
-
## `scenarios`
|
|
60
|
-
|
|
61
|
-
Each entry is a selection, and only its `overrides.conditions` inject faults:
|
|
62
|
-
|
|
63
|
-
```yaml
|
|
64
|
-
scenarios:
|
|
65
|
-
- overrides:
|
|
66
|
-
conditions:
|
|
67
|
-
latency:
|
|
68
|
-
delay_ms: 250 # hold each request 250 ms, then go on
|
|
69
|
-
error:
|
|
70
|
-
status_code: 503 # every request fails with 503
|
|
71
|
-
rate_limit:
|
|
72
|
-
requests_per_minute: 30 # the 31st request in a minute gets 429
|
|
73
|
-
chaos:
|
|
74
|
-
failure_rate: 10 # 10% of requests fail with 500
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
This example sets all four to show their fields. They run in a fixed order,
|
|
78
|
-
`latency`, `error`, `rate_limit`, `chaos`, whatever order you write them in,
|
|
79
|
-
and the first to fail a request ends it: with `error` set, `rate_limit` and
|
|
80
|
-
`chaos` never fire. Set one failure at a time, optionally with `latency`.
|
|
81
|
-
|
|
82
|
-
The mock's default handler always serves, and conditions run in front of it.
|
|
83
|
-
An entry with only `path` or `id`, as the Postman app writes, injects nothing.
|
|
84
|
-
Unknown condition names are ignored, so a misspelled one fails silently.
|
|
85
|
-
`overrides.bypass` prints a warning and is ignored.
|
|
86
|
-
|
|
87
|
-
The legacy form `- type: error` with `config: { status_code: 503 }` is still
|
|
88
|
-
accepted and validated strictly: an unknown `type` is an error.
|
|
22
|
+
## Conditions
|
|
89
23
|
|
|
90
24
|
| Condition | Field | Effect |
|
|
91
25
|
| --- | --- | --- |
|
|
92
|
-
| `latency` | `delay_ms`
|
|
93
|
-
| `error` | `status_code` (
|
|
94
|
-
| `rate_limit` | `requests_per_minute`
|
|
95
|
-
| `chaos` | `failure_rate` (0–100) | That
|
|
96
|
-
|
|
97
|
-
A condition
|
|
98
|
-
its siblings succeed,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
`listening
|
|
112
|
-
|
|
26
|
+
| `latency` | `delay_ms` | Holds each request that long, then serves it. |
|
|
27
|
+
| `error` | `status_code` (400–599) | Every request gets that status as JSON, with `"scenario":"error"`. |
|
|
28
|
+
| `rate_limit` | `requests_per_minute` | Requests over the limit get `429` and `Retry-After`. |
|
|
29
|
+
| `chaos` | `failure_rate` (0–100), optional `status_code` | That share of requests, at random, get `500` or that status. |
|
|
30
|
+
|
|
31
|
+
- A condition covers every route on its member. To fail one endpoint while
|
|
32
|
+
its siblings succeed, give that endpoint a mock of its own.
|
|
33
|
+
- They run in a fixed order (`latency`, `error`, `rate_limit`, `chaos`), and
|
|
34
|
+
the first to fail a request ends it, so set one failure at a time,
|
|
35
|
+
optionally with `latency`.
|
|
36
|
+
- An unknown condition name is ignored silently, so a misspelling injects
|
|
37
|
+
nothing. `overrides.bypass` prints a warning and is ignored.
|
|
38
|
+
- A `latency` request is served and logged, with a `duration` that leaves
|
|
39
|
+
out the delay.
|
|
40
|
+
|
|
41
|
+
## The log (`--output ndjson`)
|
|
42
|
+
|
|
43
|
+
One JSON event per line on stdout; notices go to stderr, so keep them apart.
|
|
44
|
+
|
|
45
|
+
- `listening`: every member has started; a member that fails to start
|
|
46
|
+
stops the run with `Error: …` and exit code 1.
|
|
47
|
+
- `request`: one per request a member served.
|
|
48
|
+
- `summary`, on stop: `requestsServed` (under 400), `requestsFailed` (400
|
|
49
|
+
and up), `uptimeMs` and `signal`. Injected failures and the simulation's
|
|
50
|
+
own `400`, `404` and `502` aren't counted.
|
|
@@ -1,104 +1,57 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-testing
|
|
3
|
-
description:
|
|
3
|
+
description: Use when testing an endpoint, running collection assertions, or checking real application traffic against an API contract. Reuses saved requests and reports what live, mocked, or captured-traffic results actually establish. Use for requests such as "test this endpoint".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API Testing
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Debugging a request's behavior during a run (why a `pm.test` failed, what a
|
|
53
|
-
request actually sends) means reading the request's own YAML — see the
|
|
54
|
-
`collection-schema-v3` skill for that file format before assuming a field's
|
|
55
|
-
shape.
|
|
56
|
-
|
|
57
|
-
Runs every request in a collection (or a subset via `-i`, repeatable),
|
|
58
|
-
executing whatever `pm.test` scripts are already saved in it.
|
|
59
|
-
`-d`/`--iteration-data` (or the beta `--iteration-data-dataset` +
|
|
60
|
-
`--iteration-data-view` pair) drives data-driven runs across a CSV/JSON
|
|
61
|
-
file or a Postman Dataset. `-r junit,html` for CI-consumable reports.
|
|
62
|
-
`--use-mock`/`--mock` redirects the run at a mock instead of a real backend
|
|
63
|
-
(see the `api-mocking` skill) — reach for this to test request/assertion
|
|
64
|
-
logic without depending on a live service.
|
|
65
|
-
|
|
66
|
-
## `application test` — contract-matching real traffic
|
|
67
|
-
|
|
68
|
-
This doesn't send its own requests. It runs your existing test command
|
|
69
|
-
(`--command "npx playwright test"`, or config-driven via
|
|
70
|
-
`postman.config.cjs` targets), captures the network traffic that command
|
|
71
|
-
generates, and matches/asserts it against your Postman collections —
|
|
72
|
-
answering "did my app's actual calls conform to the contract," not "does
|
|
73
|
-
this endpoint respond correctly." `--capture-only` skips the matching step
|
|
74
|
-
entirely and just exports what was captured as a new v3 collection,
|
|
75
|
-
organized by host — a way to bootstrap a collection from real traffic
|
|
76
|
-
rather than authoring one from scratch. Results are published to the connected
|
|
77
|
-
workspace after each run, so the evidence of the run outlives the terminal
|
|
78
|
-
session; `--report-events=false` keeps a run local when it shouldn't be
|
|
79
|
-
recorded.
|
|
80
|
-
|
|
81
|
-
## Critical Rules
|
|
82
|
-
|
|
83
|
-
1. **Don't reach for `application test` for something a plain
|
|
84
|
-
`collection run` covers.** It exists specifically for matching *captured*
|
|
85
|
-
app traffic (via Playwright or similar), not for driving requests itself.
|
|
86
|
-
2. **`postman request`'s exit code reflects failed `pm.test` assertions, not
|
|
87
|
-
HTTP status alone.** A nonzero exit on a 200 response usually means a
|
|
88
|
-
post-request script assertion failed, not a network problem.
|
|
89
|
-
3. **Assertions meant to be reused belong in the collection, not on the
|
|
90
|
-
command line.** A `--script-post-request` test on `collection run` runs
|
|
91
|
-
once and leaves nothing for the next person; save it as a `pm.test` in
|
|
92
|
-
the request instead.
|
|
93
|
-
4. **`--use-mock` is the way to test without a live backend** — prefer it
|
|
94
|
-
over standing up ad hoc fakes or skipping tests that need a dependency.
|
|
95
|
-
5. **Reuse a saved request instead of reconstructing it.** If a matching v3
|
|
96
|
-
request exists, use `collection run <collection-path> -i <request>`; reserve
|
|
97
|
-
`postman request` for genuinely ad-hoc requests.
|
|
8
|
+
Saved requests preserve the auth, payloads, variables, and assertions that make
|
|
9
|
+
an API check reproducible. The useful result is evidence about an intended
|
|
10
|
+
guarantee; a successful HTTP exchange alone does not establish correctness.
|
|
11
|
+
|
|
12
|
+
1. Choose the smallest execution mode that answers the question:
|
|
13
|
+
|
|
14
|
+
| Evidence needed | Use |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| One endpoint with no saved request | `postman request <url>` |
|
|
17
|
+
| Behavior of an existing saved request | `postman collection run <collection-path> -i <request-id-name-or-path>` |
|
|
18
|
+
| Reusable regression checks | `postman collection run <path-or-id>` |
|
|
19
|
+
| Whether a real app's calls match the contract | `postman application test` |
|
|
20
|
+
|
|
21
|
+
2. Reuse a matching request under `postman/collections/` before reconstructing
|
|
22
|
+
its HTTP fields. Running it through the collection retains inherited auth,
|
|
23
|
+
variables, and scripts. `postman request` takes a URL, not a request YAML
|
|
24
|
+
path; for an unsaved request with an existing payload file, `--body @path`
|
|
25
|
+
preserves that file as the source. See **collection-schema-v3** when
|
|
26
|
+
editing the saved request.
|
|
27
|
+
3. Derive assertions from the contract and the behavior at risk. A test that
|
|
28
|
+
merely repeats the current implementation can bless its bug. Preserve
|
|
29
|
+
existing guarantees and add checks for the changed behavior; put reusable
|
|
30
|
+
`pm.test` assertions in the collection so later runs and teammates inherit
|
|
31
|
+
them. Inline `--script-post-request` assertions suit a one-off check.
|
|
32
|
+
4. Choose a real or mocked target according to the claim. `--use-mock` lets a
|
|
33
|
+
collection run exercise request and assertion logic without a live
|
|
34
|
+
backend; `--mock` alone only starts one. `--use-mock` replaces the
|
|
35
|
+
variable's whole value, base path included (see **api-mocking**). Passing
|
|
36
|
+
against that mock does not verify the service the mock stands in for.
|
|
37
|
+
5. Reuse environment resolution with `-e` and **variables**. Use a CSV/JSON
|
|
38
|
+
file through `-d` for simple iteration; use **datasets** when the inputs
|
|
39
|
+
need queries, joins, or reusable views. Export reports such as
|
|
40
|
+
`-r junit,html` when **ci-integration** needs evidence beyond terminal output.
|
|
41
|
+
6. Use `application test` when the application's actual traffic is the subject.
|
|
42
|
+
It runs an existing command, such as `--command "npx playwright test"`,
|
|
43
|
+
captures its traffic, and matches it against collections. `--capture-only`
|
|
44
|
+
instead exports a v3 collection organized by host; that captures behavior
|
|
45
|
+
without validating it. Results are recorded in the connected workspace by
|
|
46
|
+
default; `--report-events=false` keeps the run local when required.
|
|
47
|
+
|
|
48
|
+
Use command-specific `-h` for supported options and **bootstrap** for unresolved
|
|
49
|
+
CLI setup or authentication when using workspace resources. A bare URL or
|
|
50
|
+
local collection does not require a workspace binding.
|
|
98
51
|
|
|
99
52
|
## Verification
|
|
100
53
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
54
|
+
Report the target, tested behavior, assertion counts, and exit code. The exit
|
|
55
|
+
code reflects failed assertions, not HTTP status alone: a 200 can fail a test.
|
|
56
|
+
For application testing, distinguish matching from capture-only mode, and for
|
|
57
|
+
mocked runs state which real behavior remains unverified.
|