空手道 api 测试断言在使用版本 1.1.0 和 1.2.0.RC1 时失败。当使用 1.0.1 和 1.0.0 版本时,相同的断言正在通过
Karate api testing- assertion getting failed when version 1.1.0 and 1.2.0.RC1 is used . Same assertion is passing when 1.0.1 and 1.0.0 version is uesd
带有场景的功能文件
Feature: reqres api test cases
Scenario: list all users get request
Given url "https://reqres.in/api"
And path "/users?page=2"
When method get
Then print response
And match response.data[0] == {"last_name": "Lawson","id": "#ignore","avatar": "#ignore","first_name": "Michael","email": "michael.lawson@reqres.in"}
ide
中的错误消息
match failed: EQUALS
$ | not equal | actual does not contain key - 'last_name' (MAP:MAP)
{"id":1,"name":"cerulean","year":2000,"color":"#98B2D1","pantone_value":"15-4020"}
{"id":"#ignore","last_name":"Lawson","avatar":"#ignore","first_name":"Michael","email":"michael.lawson@reqres.in"}
您没有正确使用空手道。注意下面param
的用法:
Given url "https://reqres.in/api"
And path "/users"
And param page = 2
When method get
带有场景的功能文件
Feature: reqres api test cases
Scenario: list all users get request
Given url "https://reqres.in/api"
And path "/users?page=2"
When method get
Then print response
And match response.data[0] == {"last_name": "Lawson","id": "#ignore","avatar": "#ignore","first_name": "Michael","email": "michael.lawson@reqres.in"}
ide
中的错误消息match failed: EQUALS
$ | not equal | actual does not contain key - 'last_name' (MAP:MAP)
{"id":1,"name":"cerulean","year":2000,"color":"#98B2D1","pantone_value":"15-4020"}
{"id":"#ignore","last_name":"Lawson","avatar":"#ignore","first_name":"Michael","email":"michael.lawson@reqres.in"}
您没有正确使用空手道。注意下面param
的用法:
Given url "https://reqres.in/api"
And path "/users"
And param page = 2
When method get