karate

Assertion Issue of jsonpath response

不羁岁月 提交于 2021-02-10 06:45:27
问题 I'm writing api test automated codes with bdd method by Karate. Assertion part pushes me hard. My response is like below, and when I called that path $.data.subscribers[0].products this gives me empty-null array as I checked by http://jsonpath.herokuapp.com/ website. However, when I run my gherkin Karate feature then It gave me the response as null, It still gives me error assertion. It says actual: null, expected: null... I couldn't see any error, how can I fix this? Is it a bug or Is there

Karate Extent Report integrtion

时光毁灭记忆、已成空白 提交于 2021-02-10 03:23:32
问题 Karate -junit will provide Reports as BDD. We have new requirement to push this report to Report server KLOV(Extent Reports). Is this possible to with listener's? please let know the documentation. Integration Extent Report with Karate frame work. 回答1: Refer to the documentation here: https://github.com/intuit/karate#karate-info within a test (or within the afterScenario function if configured) you can access metadata such as the Scenario name You can add an afterScenario "listener" like this

Karate Extent Report integrtion

随声附和 提交于 2021-02-10 03:22:50
问题 Karate -junit will provide Reports as BDD. We have new requirement to push this report to Report server KLOV(Extent Reports). Is this possible to with listener's? please let know the documentation. Integration Extent Report with Karate frame work. 回答1: Refer to the documentation here: https://github.com/intuit/karate#karate-info within a test (or within the afterScenario function if configured) you can access metadata such as the Scenario name You can add an afterScenario "listener" like this

Can I use the status shortcut in Karate to check a response class instead of just one code

帅比萌擦擦* 提交于 2021-02-08 07:41:05
问题 I am using Karate to test other people's implementations of an API. When checking response status codes I often need to accept more than one response. For example in response to a PUT I may see 200, 201, 205 - they are equally valid. I know I can use Then assert responseStatus >= 200 && responseStatus < 300 to check for success but the shortcut really helps readability of the tests. Would you consider an enhancement to the language to support response classes such as: success (meaning 200-299

Karate - Conditional logic with string and array

这一生的挚爱 提交于 2021-02-08 07:25:21
问题 This question derives from this question asked earlier. I am making a Soap request, and I am receiving the response as either an Array, or String. [print] [ "M4205N", "M4206U" ] [print] M5967H When I get the response as an array, I figured out how to loop through it, and pass the values to another request. However, sometimes the response will come back as a single Code, and it will be returned as a String. In that case, I cannot perform the same logic as I did with the array. I've read about

Karate API framework how to match the response values with the table columns?

五迷三道 提交于 2021-02-08 07:21:44
问题 I have below API response sample { "items": [ { "id":11, "name": "SMITH", "prefix": "SAM", "code": "SSO" }, { "id":10, "name": "James", "prefix": "JAM", "code": "BBC" } ] } As per above response, my tests says that whenever I hit the API request the 11th ID would be of SMITH and 10th id would be JAMES So what I thought to store this in a table and assert against the actual response * table person | id | name | | 11 | SMITH | | 10 | James | | 9 | RIO | Now how would I match one by one ? like

Karate - Conditional logic with string and array

醉酒当歌 提交于 2021-02-08 07:21:21
问题 This question derives from this question asked earlier. I am making a Soap request, and I am receiving the response as either an Array, or String. [print] [ "M4205N", "M4206U" ] [print] M5967H When I get the response as an array, I figured out how to loop through it, and pass the values to another request. However, sometimes the response will come back as a single Code, and it will be returned as a String. In that case, I cannot perform the same logic as I did with the array. I've read about

Karate UI standalone - can there be screenshots attached to reports on failure?

走远了吗. 提交于 2021-02-08 07:19:53
问题 I am evaluating Karate UI and really like it. I use it as standalone jar (as the team do not want to support Java project but is fine with JS) and am wondering how can I attach screenshots of the web app generated right when a step fails? I have seen this question - Attaching screenshots to json report and hope it would be possible to doing something with the standalone version as well. 回答1: If you look at the section on "hooks": https://github.com/intuit/karate#hooks You should be able to

XML : trouble with fuzzy matching [duplicate]

可紊 提交于 2021-02-08 02:17:51
问题 This question already has an answer here : Asserting and using conditions for an array response in Karate (1 answer) Closed 7 days ago . I am having troubles with XML matching, which appears to be working a bit differently from JSON. I found this code snippet * def xml = <foo><bar>baz</bar></foo> * set xml/foo/bar = <hello>world</hello> * match xml == <foo><bar><hello>world</hello></bar></foo> But with this, I cannot specify that I'm using a template, and that <hello>world</hello> may be

XML : trouble with fuzzy matching [duplicate]

痴心易碎 提交于 2021-02-08 02:13:08
问题 This question already has an answer here : Asserting and using conditions for an array response in Karate (1 answer) Closed 7 days ago . I am having troubles with XML matching, which appears to be working a bit differently from JSON. I found this code snippet * def xml = <foo><bar>baz</bar></foo> * set xml/foo/bar = <hello>world</hello> * match xml == <foo><bar><hello>world</hello></bar></foo> But with this, I cannot specify that I'm using a template, and that <hello>world</hello> may be