I’m testing an endpoint which returns an integer in plaintext format. I’d like to check that the response value is greater than 1. Printing the response tells me that it is indeed. However, when I try to automate this check, I keep getting the following error:
...
When method POST
Then status 200
* print response #returns 643
And response > 1
Error: no step-definition method match found for: response > 1
How can I accomplish this?
>Solution :
I think you are looking for this:
And assert (response * 1) > 1
Refer docs: https://github.com/karatelabs/karate#assert
Note that the response will be plain-text by default.