test(toh-1): add e2e for Dart and TS

closes 1620
Contributes to #1619.
This commit is contained in:
Patrice Chalin 2016-06-08 07:40:49 -07:00 committed by Ward Bell
parent 2fc7e5ab50
commit 59408b1784
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
/// <reference path="../_protractor/e2e.d.ts" />
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}'`, () => {
var text = element(by.css('h2')).getText()
expect(text).toEqual(expectedH2);
});
it(`should have input name '${hero.name}'`, () => {
var name = element(by.css('input')).getAttribute('value');
expect(name).toEqual(hero.name);
});
});