Created
November 24, 2015 14:08
-
-
Save willread/af5122e03f82cbf0e24d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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