Checking number length in json response body #114
-
Hello guys, I am using cucumber boilerplate project with pactumjs. I have response body like Any help will be much appreciated. Here are all steps and I cannot find something similar: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To compare dynamic values in JSON response, we can use Then(/^I expect response should have a json like$/, function (json) {
spec.response().should.have.jsonLike(JSON.parse(json));
}); Use Assert Expressions to easily solve the problem. Then I expect response should have a json like
"""
{
"page": {
"totalItems": "$V > 41739"
}
}
""" |
Beta Was this translation helpful? Give feedback.
To compare dynamic values in JSON response, we can use
expectJsonLike
method which is mapped to the following step definitionUse Assert Expressions to easily solve the problem.