{"action":"closed","issue":{"url":"https://api.github.com/repos/brunoscopelliti/marvin/issues/2","labels_url":"https://api.github.com/repos/brunoscopelliti/marvin/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/brunoscopelliti/marvin/issues/2/comments","events_url":"https://api.github.com/repos/brunoscopelliti/marvin/issues/2/events","html_url":"https://github.com/brunoscopelliti/marvin/issues/2","id":103065163,"number":2,"title":"overwritten screenshot","user":{"login":"brunoscopelliti","id":3489757,"avatar_url":"https://avatars.githubusercontent.com/u/3489757?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoscopelliti","html_url":"https://github.com/brunoscopelliti","followers_url":"https://api.github.com/users/brunoscopelliti/followers","following_url":"https://api.github.com/users/brunoscopelliti/following{/other_user}","gists_url":"https://api.github.com/users/brunoscopelliti/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoscopelliti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoscopelliti/subscriptions","organizations_url":"https://api.github.com/users/brunoscopelliti/orgs","repos_url":"https://api.github.com/users/brunoscopelliti/repos","events_url":"https://api.github.com/users/brunoscopelliti/events{/privacy}","received_events_url":"https://api.github.com/users/brunoscopelliti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brunoscopelliti/marvin/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-25T16:27:08Z","updated_at":"2015-09-01T14:34:52Z","closed_at":"2015-09-01T14:34:52Z","body":"currently when a test fail automatically a screenshot is generated:\r\n\r\n```\r\n// lib/test-runner/yadda.js\r\nafterEach(function () {\r\n  logger._reset();\r\n  if (this.currentTest.state !== 'passed') {\r\n    session.saveScreenshot(this.currentTest.title);\r\n  }\r\n});\r\n```\r\n\r\nsince only the title of the test is used to create the file name, it is possible (when the same test fails more times in different scenario) that all the screenshot, but the last, are overwritten.\r\n\r\nthe screenshot filename is also important for the report:\r\n\r\n```\r\n// lib/reporter/index.js\r\nfunction getScrenshotPath(testName) {\r\n  return session.launchDate + '/screenshots/' + testName.replace(/\\W+/g, '-').toLowerCase() + '.png';\r\n}\r\n```"}}