You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There can be many combinations of headers, body, etc. when composing a request:
no headers, no body
no headers, with body inline (in the .feature file)
ho headers, with body from file
with headers, no body
with headers
with headers, with inline form parameters body (table in the .feature file)
with headers, multipart body
etc.
The current approach is to have a step for each combination. This leads to an explosion in the number of required steps.
Refactor to allow the request to be composed using multiple steps:
Given the request headers
| Content-Type | application/x-www-form-urlencoded |
And the form body parameters
| grant_type | password |
| client_id | com.farbodsaraf |
When I call 'POST' on '/authserver/oauth/token'
This way, you can compose whatever request is needed, and the code remains maintainable.
The intermediary information (headers, body, etc.) can be saved in story variables. Important note: the steps that perform the actual request should clear all such story variables, so that another request in the same scenario will not be affected.
The text was updated successfully, but these errors were encountered:
cvmocanu
changed the title
Request Builder Complexity Reduction
HTTP client steps: remove combinatorial complexity
Sep 11, 2016
There can be many combinations of headers, body, etc. when composing a request:
The current approach is to have a step for each combination. This leads to an explosion in the number of required steps.
Refactor to allow the request to be composed using multiple steps:
This way, you can compose whatever request is needed, and the code remains maintainable.
The intermediary information (headers, body, etc.) can be saved in story variables.
Important note: the steps that perform the actual request should clear all such story variables, so that another request in the same scenario will not be affected.
The text was updated successfully, but these errors were encountered: