Trying to do some assertion from request, which will be present in response

孤街浪徒 提交于 2020-03-23 14:12:40

问题


I am passing the request as in my feature file and i am trying to do assert from request to response.

I have tried must contains queries but i am not sure if i am doing it correct, could you please help.

**Background:**
*  configure headers = read('classpath:merchantServiceheaders.js')

Given url MservUrl 
And path '/spapis/rest/sp-ms-engine/sp/ms/v1/engine/scanandredact'

Scenario Outline: ACH Low Value Payment Rips Services Summary

] }***

What i would like to do is assert what i have in my request to what i will get back in response.

Since i am passing subject in request the same subject should be present in response


回答1:


Possible in 0.9.3: https://github.com/intuit/karate#scenario-outline-enhancements

First change the Examples: column header to data!

And request data
When method post
Then status 200 
And match response contains data 

In 0.9.2 and earlier, with the Examples: column header as data

* def data = <data>
And request data
When method post
Then status 200 
And match response contains data 


来源:https://stackoverflow.com/questions/56532046/trying-to-do-some-assertion-from-request-which-will-be-present-in-response

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!