Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CucumberJS timeout error. Can I set "setDefaultTimeout" in my step?

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.

like image 858
Kapil Chokhawala Avatar asked Jul 01 '26 09:07

Kapil Chokhawala


1 Answers

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
});
like image 113
findlayc Avatar answered Jul 04 '26 09:07

findlayc