Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carlitoescobar/88103c3833065ced274a39f259ca522d to your computer and use it in GitHub Desktop.
Save carlitoescobar/88103c3833065ced274a39f259ca522d 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