Forum Discussion

mortelee's avatar
Occasional Contributor
4 years ago

Setting timeout does not work with cucumber-js v7



I'm busy migrating our tests from v6 to v7.

We set the timeout using the setDefaultTimeout function.

With v6 everything is working fine.

With v7 it seems that setDefaultTimeout is not working, I only get the timeouts to work in step methods when I add { timeout: 60000}.


Any ideas what can be different between v6 and v7?


Regards Marco

2 Replies

    • mortelee's avatar
      Occasional Contributor

      As of Cucumber v7 you can not place the setDefaultTimeout inside a hook or step. The first suggestion was to put it in the file where you also create a custom world object. This did not work for me, and I can imagine that not everyone creates custom world object.

      After some tries I found out that setDefaultTimeout works when you define the setDefaultTimeout in one of the step files as global function.