Commit c287e04
Add step-authoring actions: headers, variables, and scripts (#29)
* Fix missing return for unsupported body_type in add_body_to_step
An unsupported body_type constructed the error BaseResult but did not
return it, so execution fell through and PUT the step with an empty
body and no Content-Type header.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
* Fix copy-pasted error message in add_assertion_to_step
The non-request-step guard reported "cannot have a body added" when
rejecting an assertion.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
* Emit Content-Type header values as arrays in add_body_to_step
The REST API documents header values as arrays of strings
(e.g. {"Content-Type": ["application/json"]}); bare strings relied
on undocumented server leniency.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
* Add step authoring actions: headers, variables, and scripts
New actions on the steps tool, following the existing read-modify-PUT
mutation pattern with the request-step guard:
- add_headers_to_step: merge request headers into an existing step.
Values are normalized to arrays per the REST API contract; a new
header replaces an existing one whose name matches case-insensitively.
- add_variable_to_step: append an extraction variable ({name, source,
property}) for passing response values to later steps. Source is
validated against the documented enum and property is required for
header/JSON/XPath sources.
- add_script_to_step: append a pre-request (before_scripts) or
post-response (scripts) JavaScript snippet, control-char sanitized.
add_request_step now accepts optional headers and note so a complete
step can be created in a single POST.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
* Document new step-authoring capabilities in README
Reflect the headers, variables, scripts, and note support added to
the steps tool: the Test Step Management use-case list and the
blazemeter_apitest_steps tool summary previously described only
Pause/Request creation with Body and Assertions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2Ym1SshabyXjWNdeGFDfx
* Address Copilot review: validate note type, scope variable_property
- add_request_step: reject non-string note with a clear validation
error instead of falling through to the generic unexpected-error;
strip the sanitized note.
- add_variable_to_step: validate variable_property is a string when
provided, strip it, treat whitespace-only as missing, and only send
"property" for sources that require it (dropped for response_status
and response_text, matching the tool contract).
- Docstring: note must be a string; variable_property is ignored for
sources that do not use it.
- Tests: 5 new cases covering the above.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ULzi7DRzKEuqaSEiJf3Few
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 48a7b49 commit c287e04
3 files changed
Lines changed: 733 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | | - | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| |||
0 commit comments