Skip to content

Instantly share code, notes, and snippets.

View excenter's full-sized avatar

Andrew Batz excenter

View GitHub Profile
@excenter
excenter / pageSpec.js
Created January 21, 2016 19:55
Convenience/helper function for taking screenshots using Protractor/WebDriver and NodeJS
// Example usage to check visibility (using Jasmine and Protractor)
describe('My page', function() {
it('displays "Hello World" after clicking something on the page', function() {
saveScreenshot('C:\\Users\\omouse\\Documents\\test-step-1.png');
clickSomethingOnPage();
saveScreenshot('C:\\Users\\omouse\\Documents\\test-step-2.png');
var helloWorld = element(by.css('.message'));
var helloWorldIsVisible = protractor.ExpectedConditions.visibilityOf(helloWorld);
expect(helloWorldIsVisible()).toBe(true);