【发布时间】:2020-03-10 07:00:12
【问题描述】:
正如我从this question 的答案中看到的那样:空手道将在下一个请求中自动发送服务器返回的任何 cookie。
但是当我发送请求时,我在响应的 Set-Cookie 中看到两组 cookie:一组是自动创建的,另一组是真实的,从服务器返回。
当我打印 responseCookies 时,我看到那里只有自动 cookie
并为下一个请求生成并发送新的 cookie。
对于我的测试,我需要使用第一次请求后返回的 cookie,因为它是对登录服务的调用。
Feature: Using cookies in next request
Background:
Given url baseUrl
And path LOGOUT_SERVICE_ENDPOINT
And configure headers = read('classpath:headers.js')
And def filename = 'classpath:resources/users/' + brand.toLowerCase() + '/user.json'
And json user = read(filename)
Scenario: Login
When def login = callonce read('classpath:features/login_service/login.feature') user
* print login.responseCookies
And request { arg1: '#(brand)'}
And method post
Then status 200
我的功能有什么问题还是空手道问题?
【问题讨论】: