cucumber/cucumber-js — pull request #192 by akania (2014-06-01 09:59:23+00:00)
Title: Configurable step timeout

Based on the discussion in https://github.com/cucumber/cucumber-js/issues/27 i would like to propose this solution :
1) every time step is called ( invoked ) set a timeout with predefined value ( 30s ) , if callback in this step is not called ( success,fail or pending ) call callback.fail() with "Timeout" message - so it is invoked in the scope of the test - this way it has access to all details

2) Regarding configuration - there are two ways :
a) using CLI - add -t ( --timeout ) option with value in ms
b) when constructing new runner ( var runner = Cucumber(featureSource, supportCodeInitializer, options) ) - pass additional 'timeout' option with value in ms
Default value set to 30s is a save bet - in most cases nothing should take more then 30s - but since it is configurable it can be adjusted to the environment

I believe that the same solution may be applied for hooks.
I'm not particularly happy with configuration - please review it, i think that there may be better way to access Cucumber.Runtime.stepTimeoutValue...

Being able to define a timeout and get a feedback from the runner that some step has never finished is critical in my opinion - right now i developer may get false-positive results from the tests and it is harder to debug the tests and application code.

Please let me know if is valid solution in your opinion