Skip to content

Instantly share code, notes, and snippets.

@brennon
Created November 20, 2014 04:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brennon/12b449bc6a5c223ef230 to your computer and use it in GitHub Desktop.
Save brennon/12b449bc6a5c223ef230 to your computer and use it in GitHub Desktop.
Protractor conditional testing
describe('conditional testing', function() {
it('should be able to test conditionally', function() {
browser.get('http://www.angularjs.org');
element(by.css('.theresnowaythisclassexists')).then(
function elementExists() {
expect(false).toBe(true);
},
function elementDoesNotExist() {
expect(true).toBe(true);
}
);
element(by.css('html')).then(
function elementExists() {
expect(true).toBe(true);
},
function elementDoesNotExist() {
expect(false).toBe(true);
}
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment