Last active
November 9, 2016 00:51
-
-
Save scheibinger/c79ab05fa70bb782b9a3498fa77733a7 to your computer and use it in GitHub Desktop.
protractor snippets
This file contains hidden or 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
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