Skip to content

Instantly share code, notes, and snippets.

@willread
Created November 24, 2015 14:08
Show Gist options
  • Save willread/af5122e03f82cbf0e24d to your computer and use it in GitHub Desktop.
Save willread/af5122e03f82cbf0e24d to your computer and use it in GitHub Desktop.
var fs = require('fs');
var screenshot = function(path) {
browser.takeScreenshot().then(function (png){
png = new Buffer(png, 'base64');
fs.writeFile(path, png, 'binary', function (err) {
if(err){
throw err
}
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment