{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/528","repository_url":"https://api.github.com/repos/cucumber/cucumber-js","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/528/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/528/events","html_url":"https://github.com/cucumber/cucumber-js/issues/528","id":138366917,"number":528,"title":"Can step timeout be set inside the step itself?","user":{"login":"pke","id":164625,"avatar_url":"https://avatars.githubusercontent.com/u/164625?v=3","gravatar_id":"","url":"https://api.github.com/users/pke","html_url":"https://github.com/pke","followers_url":"https://api.github.com/users/pke/followers","following_url":"https://api.github.com/users/pke/following{/other_user}","gists_url":"https://api.github.com/users/pke/gists{/gist_id}","starred_url":"https://api.github.com/users/pke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pke/subscriptions","organizations_url":"https://api.github.com/users/pke/orgs","repos_url":"https://api.github.com/users/pke/repos","events_url":"https://api.github.com/users/pke/events{/privacy}","received_events_url":"https://api.github.com/users/pke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-04T03:38:55Z","updated_at":"2016-03-08T00:48:21Z","closed_at":null,"body":"I am embracing the original cucumber idea of \"outside-in\". For that the default timeouts of steps stay in the way. Cucumber is not a tool to quickly test my app but to run it in an automated fashion and test its behavior. \r\n\r\n```\r\nthis.When(/^I use the app for (\\d+|\\w+) seconds$/, function (seconds, callback) {\r\n  if (seconds == \"some\") {\r\n    seconds = 1\r\n  }\r\n  console.log(\"Waiting for \" + seconds + \" seconds\")\r\n  setTimeout(callback, seconds * 1000)\r\n})\r\n```\r\n\r\nThis step could be used to wait for a notification to pop up 30 seconds after app start.\r\n\r\nIs there a way to set the timeout of the step to `second*1000` from inside the step?"},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/comments/193530754","html_url":"https://github.com/cucumber/cucumber-js/issues/528#issuecomment-193530754","issue_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/528","id":193530754,"user":{"login":"charlierudolph","id":1676758,"avatar_url":"https://avatars.githubusercontent.com/u/1676758?v=3","gravatar_id":"","url":"https://api.github.com/users/charlierudolph","html_url":"https://github.com/charlierudolph","followers_url":"https://api.github.com/users/charlierudolph/followers","following_url":"https://api.github.com/users/charlierudolph/following{/other_user}","gists_url":"https://api.github.com/users/charlierudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/charlierudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlierudolph/subscriptions","organizations_url":"https://api.github.com/users/charlierudolph/orgs","repos_url":"https://api.github.com/users/charlierudolph/repos","events_url":"https://api.github.com/users/charlierudolph/events{/privacy}","received_events_url":"https://api.github.com/users/charlierudolph/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T00:48:21Z","updated_at":"2016-03-08T00:48:21Z","body":"Currently what you are asking for is not possible. setTimeout is called before the step definition is executed. In your example, maybe you could set the step timeout to the max seconds that step would be called with?"}}