{"action":"created","issue":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/3264","repository_url":"https://api.github.com/repos/Codeception/Codeception","labels_url":"https://api.github.com/repos/Codeception/Codeception/issues/3264/labels{/name}","comments_url":"https://api.github.com/repos/Codeception/Codeception/issues/3264/comments","events_url":"https://api.github.com/repos/Codeception/Codeception/issues/3264/events","html_url":"https://github.com/Codeception/Codeception/issues/3264","id":161746002,"number":3264,"title":"Failure screenshot invalid when _after or _failed do some operations","user":{"login":"LeRondPoint","id":15251145,"avatar_url":"https://avatars.githubusercontent.com/u/15251145?v=3","gravatar_id":"","url":"https://api.github.com/users/LeRondPoint","html_url":"https://github.com/LeRondPoint","followers_url":"https://api.github.com/users/LeRondPoint/followers","following_url":"https://api.github.com/users/LeRondPoint/following{/other_user}","gists_url":"https://api.github.com/users/LeRondPoint/gists{/gist_id}","starred_url":"https://api.github.com/users/LeRondPoint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeRondPoint/subscriptions","organizations_url":"https://api.github.com/users/LeRondPoint/orgs","repos_url":"https://api.github.com/users/LeRondPoint/repos","events_url":"https://api.github.com/users/LeRondPoint/events{/privacy}","received_events_url":"https://api.github.com/users/LeRondPoint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-22T17:54:14Z","updated_at":"2016-06-23T05:51:49Z","closed_at":null,"body":"Many of my tests need to do some cleanup on Google Analytics to prevent hitting their services limits.  I do this in _after & _failed methods and the process involves browsing away from the current page.  Therefore, the \"Failed test\" screenshot is not representative of the actual failure since it is taken after the cleanup, making it useless.\r\n\r\nI know my cleanup process is far from ideal but it remains the best way to do it at the moment and I believe it is still a valid use-case."},"comment":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/comments/227956419","html_url":"https://github.com/Codeception/Codeception/issues/3264#issuecomment-227956419","issue_url":"https://api.github.com/repos/Codeception/Codeception/issues/3264","id":227956419,"user":{"login":"raistlin","id":76889,"avatar_url":"https://avatars.githubusercontent.com/u/76889?v=3","gravatar_id":"","url":"https://api.github.com/users/raistlin","html_url":"https://github.com/raistlin","followers_url":"https://api.github.com/users/raistlin/followers","following_url":"https://api.github.com/users/raistlin/following{/other_user}","gists_url":"https://api.github.com/users/raistlin/gists{/gist_id}","starred_url":"https://api.github.com/users/raistlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raistlin/subscriptions","organizations_url":"https://api.github.com/users/raistlin/orgs","repos_url":"https://api.github.com/users/raistlin/repos","events_url":"https://api.github.com/users/raistlin/events{/privacy}","received_events_url":"https://api.github.com/users/raistlin/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T05:51:49Z","updated_at":"2016-06-23T05:51:49Z","body":"I suggest you to disable Google Analytics API calls on testing environments, and replace them by a fake service or nothing at all. That way you don't need a cleanup process.\r\n\r\nIf you *must* maintain that API calls for some good reason, I will try to perform the cleaup on _before method: on _after & _failed you can save required data somewhere and afterwards check in _before if that data exists, perform the cleanup, and erase the data to prevent double cleaning."}}
{"actor":{"display_login":"raistlin"}}