下面是我的代码,我想用CartItemId从作为请求scenario2 scenario1响应,但情况不能得到它的价值。
Scenario: /api/wishlist/item/add - add to wishlist
Given path '/api/wishlist/item/add'
And headers allHeaders.HeadersToken
And request {"CultureCode":"CHS","IsSpecificSku":0,"MerchantId":"#(data.StyleMerchantId)","SkuId":"#(data.SkuId)","UserKey":"#(data.UserKey)"}
When method POST
Then status 200
* def CartItemId = response.CartItems[0].CartItemId
* print CartItemId
* print response
Scenario: /api/wishlist/item/remove - remove from wishlist
Given path '/api/wishlist/item/remove'
And headers allHeaders.HeadersToken
And request {"CartItemId":"#(CartItemId)","CultureCode":"CHS","UserKey":"#(data.UserKey)"}
When method POST
Then status 200