igniteram / protractor-cucumber-typescript

e2e kickstarter test framework which consists of protractor, cucumber frameworks using typescript lang!
MIT License
196 stars 170 forks source link

After # support\hooks.ts:10 Error: function timed out after 5000 milliseconds #35

Closed rohitnirantar closed 7 years ago

rohitnirantar commented 7 years ago

Because of slow application loading my scripts are failing after 5000ms. Can you please help me to increase timeout to 20secounds for cucumber. I tried to use this: https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/hooks.md

but not sure how to implement this.

igniteram commented 7 years ago

you can either use timeout for individual steps or setDefaultTimeout for global timeout. Please refer this link - https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/timeouts.md

rohitnirantar commented 7 years ago

Timeout issue resolved after adding below code to hooks.ts

var {defineSupportCode} = require('cucumber');

defineSupportCode(function({setDefaultTimeout}) { setDefaultTimeout(60 * 1000); });