Replies: 2 comments 1 reply
-
Hello @tkminh , We haven't investigated a way to use matchers inside a cucumber file. The only work around is to define custom steps where you can import the matchers and use them. const pactum = require('pactum');
const { like } = require('pactum-matchers');
// rest of the steps
Then(/^I expect response to match user snapshot$/, async function (snapshotName) {
await spec.name(snapshotName).expectJsonSnapshot({
id: like(1)
})
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @ASaiAnudeep , can we put the matcher inside the snapshot json file. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have cucumber like this:
And in my code:
The response return something like:
"data": {
"attributes": {
"reference": "1010655",
But when I run, it shows error like:
function has 0 arguments, should have 1 (if synchronous or returning a promise) or 2 (if accepting a callback)
Please support me with this issue.
Beta Was this translation helpful? Give feedback.
All reactions