2016-05-30 14:05:09 -04:00
|
|
|
/// <reference path="../_protractor/e2e.d.ts" />
|
2016-01-22 05:40:37 -05:00
|
|
|
describe('Homepage Hello World', function () {
|
|
|
|
|
|
|
|
beforeAll(function () {
|
|
|
|
browser.get('');
|
|
|
|
});
|
|
|
|
|
|
|
|
// Does it even launch?
|
2016-05-30 14:05:09 -04:00
|
|
|
let expectedLabel = 'Name:';
|
2016-01-22 05:40:37 -05:00
|
|
|
it('should display the label: ' + expectedLabel, function () {
|
|
|
|
expect(element(by.css('label')).getText()).toEqual(expectedLabel);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display entered name', function () {
|
2016-05-30 14:05:09 -04:00
|
|
|
let testName = 'Bobby Joe';
|
|
|
|
let newValue;
|
|
|
|
let nameEle = element.all(by.css('input')).get(0);
|
2016-01-22 05:40:37 -05:00
|
|
|
nameEle.getAttribute('value').then(function(value) {
|
|
|
|
// nameEle.sendKeys(testName); // should work but doesn't
|
|
|
|
sendKeys(nameEle, testName); // utility that does work
|
|
|
|
newValue = value + testName; // old input box value + new name
|
|
|
|
expect(nameEle.getAttribute('value')).toEqual(newValue);
|
|
|
|
}).then(function() {
|
|
|
|
// Check the interpolated message built from name
|
2016-05-30 14:05:09 -04:00
|
|
|
let helloEle = element.all(by.css('h1')).get(0);
|
2016-01-22 05:40:37 -05:00
|
|
|
expect(helloEle.getText()).toEqual('Hello ' + testName + '!');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|