Skip to content

How can we call multiple requests in one scenario while using cucumber with pactumjs? #172

Answered by ASaiAnudeep
ttran1410 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @ttran1410 ,

The easiest way to solve is by re-initiating the spec with a new instance inside the Given step definition.

Given(/^I make a (.*) request to (.*)$/, function (method, endpoint) {
  spec = pactum.spec();
  spec[method.toLowerCase()](endpoint);
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ttran1410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants