how to include saved value in the next stage request url
colinshin opened this issue · 2 comments
colinshin commented
We have a service with the URL, https://www.domain.com/parallel/tests/uuid
I would like to run the test stage(name: Verify tests get API) with the saved value newtest_uuid
How can I use newtest_uuid
in the second stage?
includes:
- !include includes.yaml
stages:
- name: Verify tests post API
request:
url: "{HOST:s}/parallel/tests/"
method: POST
json:
name: 'co-test-9'
apptype: 'parallel'
user: 'wangxi'
product: 'centos'
build : 'ob-123'
resolution: '1600x1200'
start_url: 'https://www.github.com/'
locales: "['192.168.0.1']"
response:
strict:
- json:off
status_code: 200
save:
json:
newtest_uuid: "testcase.uuid"
- name: Verify tests get API
request:
url: "{HOST:s}/parallel/tests/{newtest_uuid}"
method: GET
response:
strict:
- json:off
status_code: 200
I did this, but it doesn't work, and got errors
- name: Verify tests get API
request:
url: !force_format_include"{HOST}/parallel/tests/{newtest_uuid}"
method: GET
response:
strict:
- json:off
status_code: 200
How can i use the saved newtest_uuid
in the second stage?
Thanks
colinshin commented
use like below
- name: Verify tests get API
request:
url: "{HOST:s}/parallel/tests/{newtest_uuid:s}"
method: GET
response:
strict:
- json:off
status_code: 200
I got error
to_format = '{HOST:s}/parallel/tests/{newtest_uuid:s}'
box_vars = <Box: {'HOST': 'http://127.0.0.1:9000', 'TESTCASE_ID': '5087', 'SCRIPT_ID': '5863', 'PARALLEL_TEST_UUID': '7cd9...RENT_TEST': 'parallel/test_04_update_tests.tavern.yaml::Make sure tests api functions (call)'}}, 'newtest_uuid': None}>
newtest_uuid is None
colinshin commented
iit works like below
- name: Verify tests get API
request:
url: "{HOST:s}/parallel/tests/{newtest_uuid}"
method: GET
response:
strict:
- json:off
status_code: 200