2016-10-06 18:25:52 -04:00
|
|
|
'use strict'; // necessary for es6 output in node
|
|
|
|
|
|
|
|
import { browser, element, by } from 'protractor';
|
|
|
|
|
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-06-01 12:11:58 -04:00
|
|
|
it(`should display the label: ${expectedLabel}`, function () {
|
2016-01-22 05:40:37 -05:00
|
|
|
expect(element(by.css('label')).getText()).toEqual(expectedLabel);
|
|
|
|
});
|
2016-06-07 19:06:25 -04:00
|
|
|
|
2016-01-22 05:40:37 -05:00
|
|
|
it('should display entered name', function () {
|
2016-05-30 14:05:09 -04:00
|
|
|
let testName = 'Bobby Joe';
|
|
|
|
let nameEle = element.all(by.css('input')).get(0);
|
2016-10-06 18:25:52 -04:00
|
|
|
nameEle.getAttribute('value').then(function(value: string) {
|
|
|
|
nameEle.sendKeys(testName);
|
2016-06-01 12:11:58 -04:00
|
|
|
let newValue = value + testName; // old input box value + new name
|
2016-01-22 05:40:37 -05:00
|
|
|
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 + '!');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|