2

I am testing a set of rules defined in database using CucumberJS and Protrator. I am doing a database call to fetch the set of rules (~ 1000). When I run the scenario 1000 times, it takes whole lot of time and timesout almost after 2/3 loops.

Is there a way to set "setDefaultTimeout" in my code for every loop, so that timeout keeps increasing by that much time? Is there a better way to implement this? Using Examples in CucumberJS and feeding the Examples table or data table with sql queried data table?

Thanks for your help.

Kapil Chokhawala
  • 196
  • 2
  • 10

1 Answers1

6

You can set a step specific timeout in the steps implementation that will overwrite any default timeouts.

https://github.com/cucumber/cucumber-js#timeouts

this.When(/^I do something that takes ages$, {timeout : 30 * 1000}, function (url, next) {
  // Make db call and process results
});
findlayc
  • 136
  • 5
  • Updated link for timeouts section in the docs: https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/timeouts.md – E. Karim Oct 12 '21 at 13:07