Как отправить сохраненный auth-токен в другой запрос? - PullRequest
0 голосов
/ 19 ноября 2018
Scenario: Verify that Authentication is done or not
Given url '***********'
Given path 'authenticate'
And form field username = 'admin_cs'
And form field password = '********'
When method post
Then status 200
And header tokenn = response.token

* def accessToken = response.token

* print accessToken


Scenario: Verify Get all Clients

Given url '************'
Given path 'users/usersAssignable'
* header x-auth-token = accessToken
When method get
Then status 200
* def response = response
* print response

1 Ответ

0 голосов
/ 19 ноября 2018

Пожалуйста, объедините два Scenario в один. Или переместите первый здесь в Background. Пожалуйста, прочитайте это очень внимательно: https://github.com/intuit/karate#script-structure

...