Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created January 13, 2017 21:50
Show Gist options
  • Save javaeeeee/6f2f8d58a468fc77820c2b8f23537455 to your computer and use it in GitHub Desktop.
Save javaeeeee/6f2f8d58a468fc77820c2b8f23537455 to your computer and use it in GitHub Desktop.
AngularJS application end-to-end test
describe('Hello world', function () {
var message = 'AngularJS';
var input = element(by.model('myModel'));
beforeEach(function () {
browser.get('http://localhost:3000');
});
it('should have title', function () {
expect(browser.getTitle())
.toEqual('Hello World AngularJS application');
});
it('should be world', function () {
expect(input.getAttribute('value')).toEqual('World');
});
it('should update greeting when data is entered in the input field',
function () {
input.clear().then(function () {
input.sendKeys(message);
expect(element(by.binding('myModel')).getText())
.toEqual('Hello ' + message + '!');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment