空手道 - 响应 cookie 不会自动传递给下一个请求
Karate - response cookies not being passed automatically to the next request
当我从不同的特征文件调用第一个请求时,第一个请求的响应 cookie 没有传递给下一个请求
下面是我的代码:
##First request##
Given def createUserResponsePayload = call
read('classpath:helper/bi/createBiAccount.feature@createBiUser')
## Second request##
* def updateBIAccountNegativeRequestPayload = read('classpath:data/atg/payload/bi/updateBIAccount.json')
* set updateBIAccountNegativeRequestPayload.!gender = 'female'
Given path '/v1/bi/account'
When request updateBIAccountNegativeRequestPayload
When method PUT
Then status 200
目前我们正在使用以下解决方法,@PeterThomas 如果您有更好的解决方案,您能提出建议吗?
And cookie JSESSIONID = createUserResponsePayload.responseCookies
这是意料之中的。您有责任传递变量和响应。
如果您使用“共享范围”,您可能不必这样做:https://github.com/intuit/karate#shared-scope
当我从不同的特征文件调用第一个请求时,第一个请求的响应 cookie 没有传递给下一个请求 下面是我的代码:
##First request##
Given def createUserResponsePayload = call
read('classpath:helper/bi/createBiAccount.feature@createBiUser')
## Second request##
* def updateBIAccountNegativeRequestPayload = read('classpath:data/atg/payload/bi/updateBIAccount.json')
* set updateBIAccountNegativeRequestPayload.!gender = 'female'
Given path '/v1/bi/account'
When request updateBIAccountNegativeRequestPayload
When method PUT
Then status 200
目前我们正在使用以下解决方法,@PeterThomas 如果您有更好的解决方案,您能提出建议吗?
And cookie JSESSIONID = createUserResponsePayload.responseCookies
这是意料之中的。您有责任传递变量和响应。
如果您使用“共享范围”,您可能不必这样做:https://github.com/intuit/karate#shared-scope