From 59408b17845109d6068e14ee13e09fc829b60e2e Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 07:40:49 -0700 Subject: [PATCH] test(toh-1): add e2e for Dart and TS closes 1620 Contributes to #1619. --- .../_examples/toh-1/dart/example-config.json | 0 public/docs/_examples/toh-1/e2e-spec.ts | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 public/docs/_examples/toh-1/dart/example-config.json create mode 100644 public/docs/_examples/toh-1/e2e-spec.ts diff --git a/public/docs/_examples/toh-1/dart/example-config.json b/public/docs/_examples/toh-1/dart/example-config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/toh-1/e2e-spec.ts b/public/docs/_examples/toh-1/e2e-spec.ts new file mode 100644 index 0000000000..eb28e941de --- /dev/null +++ b/public/docs/_examples/toh-1/e2e-spec.ts @@ -0,0 +1,26 @@ +/// +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); + }); +});