2016-06-15 21:01:03 -04:00
|
|
|
/// <reference path='../_protractor/e2e.d.ts' />
|
|
|
|
'use strict';
|
2016-06-08 10:40:49 -04:00
|
|
|
describe('Tutorial part 1', () => {
|
|
|
|
|
|
|
|
let expectedH1 = 'Tour of Heroes';
|
|
|
|
let expectedTitle = `Angular 2 ${expectedH1}`;
|
|
|
|
let hero = { id: 1, name: 'Windstorm' };
|
|
|
|
let expectedH2 = `${hero.name} details!`;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
return browser.get('');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should have title '${expectedTitle}'`, () => {
|
|
|
|
expect(browser.getTitle()).toEqual(expectedTitle);
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should have '${expectedH2}'`, () => {
|
2016-06-13 20:01:34 -04:00
|
|
|
let text = element(by.css('h2')).getText();
|
2016-06-08 10:40:49 -04:00
|
|
|
expect(text).toEqual(expectedH2);
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should have input name '${hero.name}'`, () => {
|
2016-06-13 20:01:34 -04:00
|
|
|
let name = element(by.css('input')).getAttribute('value');
|
2016-06-08 10:40:49 -04:00
|
|
|
expect(name).toEqual(hero.name);
|
|
|
|
});
|
|
|
|
});
|