Skip to content

Instantly share code, notes, and snippets.

@scheibinger
Last active November 9, 2016 00:51
Show Gist options
  • Save scheibinger/c79ab05fa70bb782b9a3498fa77733a7 to your computer and use it in GitHub Desktop.
Save scheibinger/c79ab05fa70bb782b9a3498fa77733a7 to your computer and use it in GitHub Desktop.
protractor snippets
browser.waitForAngular();
browser.sleep(500);
// within a test:
browser.takeScreenshot().then(function (png) {
writeScreenShot(png, 'main.png');
});
browser.manage().logs()
.get('browser').then(function(browserLog) {
console.log('log: ' +
require('util').inspect(browserLog));
});
function writeScreenShot(data, filename) {
var stream = fs.createWriteStream(filename);
stream.write(new Buffer(data, 'base64'));
stream.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment