{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/997","repository_url":"https://api.github.com/repos/cucumber/cucumber-js","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/997/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/997/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/997/events","html_url":"https://github.com/cucumber/cucumber-js/issues/997","id":285860924,"number":997,"title":"add BeforeStep / AfterStep hooks","user":{"login":"charlierudolph","id":1676758,"avatar_url":"https://avatars2.githubusercontent.com/u/1676758?v=4","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},"labels":[{"id":527724149,"url":"https://api.github.com/repos/cucumber/cucumber-js/labels/help%20wanted","name":"help wanted","color":"0e8a16","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-01-04T01:54:09Z","updated_at":"2018-03-14T10:48:28Z","closed_at":null,"author_association":"OWNER","body":"Useful for validations after every step ends. `this` should be the world instance"},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/comments/372979313","html_url":"https://github.com/cucumber/cucumber-js/issues/997#issuecomment-372979313","issue_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/997","id":372979313,"user":{"login":"mracz","id":16560584,"avatar_url":"https://avatars0.githubusercontent.com/u/16560584?v=4","gravatar_id":"","url":"https://api.github.com/users/mracz","html_url":"https://github.com/mracz","followers_url":"https://api.github.com/users/mracz/followers","following_url":"https://api.github.com/users/mracz/following{/other_user}","gists_url":"https://api.github.com/users/mracz/gists{/gist_id}","starred_url":"https://api.github.com/users/mracz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mracz/subscriptions","organizations_url":"https://api.github.com/users/mracz/orgs","repos_url":"https://api.github.com/users/mracz/repos","events_url":"https://api.github.com/users/mracz/events{/privacy}","received_events_url":"https://api.github.com/users/mracz/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T10:48:28Z","updated_at":"2018-03-14T10:48:28Z","author_association":"NONE","body":"Hi @gajo4256,\r\n\r\nI'm using cucumber 4.0.0 and this snippet:\r\n\r\n```\r\nAfter(function (scenario) {\r\n  if (scenario.result.status === Status.FAILED) {\r\n    const World = this;\r\n\r\n    return browser.takeScreenshot().then(function (buffer) {\r\n      return World.attach(buffer, 'image/png');\r\n    });\r\n  }});\r\n```\r\nThis will take a screenshot after every failed scenario. ( It works for me, because with cucumber, whenever a step fail, the whole scenario will fail, so it is almost identical with \"after step fail\".\r\n\r\nHope it helps."}}
{"actor":{"display_login":"mracz"}}