-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Ability to write variables in test file #748
Comments
You can do something like by doing test_name: test name
includes:
- name: variables
description: variables
variables:
a: b
but it's not very nice. I may just remove the need to put the 'name' and 'description' fields in a configuration file (or at least the description) as this is often not needed |
Umm.. Looks good solution but the only thing that makes me worried is I have Example: I have global domain_name, port variables in common.yaml test_name: test name includes:
- name: variables
description: variables
variables:
list_all_users: "https://{domain_name}:{port}/users/"
select_user: "https://{domain_name}:{port}/users/55"
Now I want to use |
Ah sorry, I didn't realise you meant inside one file and not just in one test. Each test in Tavern is a separate YAML document and are all basically treated as separate files so you can't do something like that. Do you want something like: variables:
list_all_users: "https://{domain_name}:{port}/users/"
select_user: "https://{domain_name}:{port}/users/55"
---
test_name: test 1
stages:
...
---
test_name: test 2
stages:
... ? |
@michaelboulton Have similar interest and what you described is the solution I would hope for? |
What I mean is I have a
|
Looking forward for something like
where users are able to declare their own variables inside tavern file. I know there is a way to use !include and declare but I want it to be specific to this test case file.
The text was updated successfully, but these errors were encountered: