{"action":"created","issue":{"url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/18","repository_url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report","labels_url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/18/comments","events_url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/18/events","html_url":"https://github.com/mrooding/gulp-protractor-cucumber-html-report/issues/18","id":166606799,"number":18,"title":"Screenshots end up being base64 encoded twice","user":{"login":"tfnico","id":252063,"avatar_url":"https://avatars.githubusercontent.com/u/252063?v=3","gravatar_id":"","url":"https://api.github.com/users/tfnico","html_url":"https://github.com/tfnico","followers_url":"https://api.github.com/users/tfnico/followers","following_url":"https://api.github.com/users/tfnico/following{/other_user}","gists_url":"https://api.github.com/users/tfnico/gists{/gist_id}","starred_url":"https://api.github.com/users/tfnico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfnico/subscriptions","organizations_url":"https://api.github.com/users/tfnico/orgs","repos_url":"https://api.github.com/users/tfnico/repos","events_url":"https://api.github.com/users/tfnico/events{/privacy}","received_events_url":"https://api.github.com/users/tfnico/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-20T15:14:13Z","updated_at":"2016-07-25T10:46:18Z","closed_at":null,"body":"It seems cucumber.js is now doing the encoding themselves when attaching pngs. I therefore had to decode twice to get the screenshot ending up viewable in the report:\r\n\r\n```\r\nbrowser.takeScreenshot().then(function (stream) {\r\n        //double decode the image to workaround the double encoding that cucumber.js+report does\r\n        scenario.attach(new Buffer(new Buffer(stream, 'base64'), 'base64'), 'image/png', function (err) {\r\n          callback(err);\r\n        });\r\n      });\r\n```\r\n\r\nMore discussion on this here: https://github.com/cucumber/cucumber-js/issues/275\r\n\r\nHere are the relevant packages I'm using:\r\n\r\n```\r\n\"cucumber\": \"^1.2.1\",\r\n\"gulp-protractor\": \"^2.4.0\",\r\n\"gulp-protractor-cucumber-html-report\": \"^0.1.2\",\r\n\"protractor\": \"^4.0.0\",\r\n\"protractor-cucumber-framework\": \"^0.6.0\",\r\n```\r\n\r\nI'm not sure which tool is doing the wrong thing here, as I don't understand Cucumber's conventions on how to encode embeddings..."},"comment":{"url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/comments/234921124","html_url":"https://github.com/mrooding/gulp-protractor-cucumber-html-report/issues/18#issuecomment-234921124","issue_url":"https://api.github.com/repos/mrooding/gulp-protractor-cucumber-html-report/issues/18","id":234921124,"user":{"login":"danyc","id":3902324,"avatar_url":"https://avatars.githubusercontent.com/u/3902324?v=3","gravatar_id":"","url":"https://api.github.com/users/danyc","html_url":"https://github.com/danyc","followers_url":"https://api.github.com/users/danyc/followers","following_url":"https://api.github.com/users/danyc/following{/other_user}","gists_url":"https://api.github.com/users/danyc/gists{/gist_id}","starred_url":"https://api.github.com/users/danyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyc/subscriptions","organizations_url":"https://api.github.com/users/danyc/orgs","repos_url":"https://api.github.com/users/danyc/repos","events_url":"https://api.github.com/users/danyc/events{/privacy}","received_events_url":"https://api.github.com/users/danyc/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T10:46:18Z","updated_at":"2016-07-25T10:46:18Z","body":"This works for me:\r\n```\r\n      browser.takeScreenshot().then(function (png) {\r\n        var decodedImage = new Buffer(png, 'base64').toString('binary');\r\n        scenario.attach(decodedImage, 'image/png');\r\n      });\r\n```\r\nThe packages are set like this:\r\n```\r\n\"cucumber\": \"^0.10.2\",\r\n\"gulp-protractor\": \"^2.1.0\",\r\n\"gulp-protractor-cucumber-html-report\": \"^0.1.2\",\r\n\"protractor-cucumber-framework\": \"^0.5.0\",\r\n```"}}
{"actor":{"display_login":"danyc"}}