Last active
August 29, 2015 14:00
-
-
Save rolaveric/11076098 to your computer and use it in GitHub Desktop.
Simple protractor test which find an element, clicks it, then checks it's text value.
This file contains 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
describe('click to reverse', function () { | |
var btn; | |
it('Reverses the button label on click', function () { | |
// load the page | |
browser.get('http://localhost:63342/protractorDemo/index.html'); | |
// Find the button | |
btn = element(by.binding('click.btnText')); | |
// Click it | |
btn.click(); | |
// Test the label | |
expect(btn.getText()).toEqual('esrever ot kcilC'); | |
}); | |
it('Changes the label back on the next click', function () { | |
// Clicks it again | |
btn.click(); | |
// Test the label | |
expect(btn.getText()).toEqual('Click to reverse'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment