Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize for request parameters (path, query) #892

Closed
jykae opened this issue Nov 15, 2023 · 1 comment
Closed

Parametrize for request parameters (path, query) #892

jykae opened this issue Nov 15, 2023 · 1 comment

Comments

@jykae
Copy link

jykae commented Nov 15, 2023

Seems like parametrize is only supported in request json data
Or is it only I use it somehow improper way

Would it be possible to add parametrize support for request path & query parameters ?

Thank you for creating such great declarative API testing tool @michaelboulton 👏

@michaelboulton
Copy link
Member

It is possible to parametrize those things, if not documented, I've added an example / test for this in

---
test_name: Test parametrizing query parameters
marks:
- parametrize:
key: query_param
vals:
- example_value
stages:
- name: Echo back parametrized value from query parameter
request:
url: "{global_host}/echo_params"
method: GET
params:
example_param: "{query_param}"
response:
status_code: 200
json:
example_param: example_value

https://github.com/kiril-me/tavern/blob/722b40b786d7933e0243e47996922b45114fdb08/tests/integration/test_parametrize.tavern.yaml#L21-L40 and

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants