chore: add async/await support to e2e tests

This commit is contained in:
Filipe Silva 2016-06-16 02:01:03 +01:00 committed by Naomi Black
parent 643c59a15e
commit 61c85a92a4
40 changed files with 70 additions and 34 deletions

View File

@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es6",
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"sourceMap": true, "sourceMap": true,

View File

@ -1,7 +1,6 @@
{ {
"globalDependencies": { "globalDependencies": {
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446", "jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#6.0.0+20160613154055", "node": "registry:dt/node#6.0.0+20160613154055",
"selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654"

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
/** /**
* The tests here basically just checking that the end styles * The tests here basically just checking that the end styles
* of each animation are in effect. * of each animation are in effect.
@ -307,7 +308,9 @@ describe('Animation Tests', () => {
return protractor.promise.all([ return protractor.promise.all([
getBoundingClientWidth(el), getBoundingClientWidth(el),
getOffsetWidth(el) getOffsetWidth(el)
]).then(function([clientWidth, offsetWidth]) { ]).then(function(promiseResolutions) {
let clientWidth = promiseResolutions[0];
let offsetWidth = promiseResolutions[1];
return clientWidth / offsetWidth; return clientWidth / offsetWidth;
}); });
} }

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Architecture', function () { describe('Architecture', function () {
let title = 'Hero List'; let title = 'Hero List';

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Attribute directives', function () { describe('Attribute directives', function () {
let _title = 'My First Attribute Directive'; let _title = 'My First Attribute Directive';

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Angular 1 to 2 Quick Reference Tests', function () { describe('Angular 1 to 2 Quick Reference Tests', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Component Communication Cookbook Tests', function () { describe('Component Communication Cookbook Tests', function () {
// Note: '?e2e' which app can read to know it is running in protractor // Note: '?e2e' which app can read to know it is running in protractor

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Cookbook: component-relative paths', function () { describe('Cookbook: component-relative paths', function () {
interface Page { interface Page {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Dependency Injection Cookbook', function () { describe('Dependency Injection Cookbook', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
/* tslint:disable:quotemark */ /* tslint:disable:quotemark */
describe('Dynamic Form', function () { describe('Dynamic Form', function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
// gulp run-e2e-tests --filter=cb-set-document-title // gulp run-e2e-tests --filter=cb-set-document-title
describe('Set Document Title', function () { describe('Set Document Title', function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('TypeScript to Javascript tests', function () { describe('TypeScript to Javascript tests', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('cli-quickstart App', () => { describe('cli-quickstart App', () => {
beforeEach(() => { beforeEach(() => {
return browser.get('/'); return browser.get('/');

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Component Style Tests', function () { describe('Component Style Tests', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Dependency Injection Tests', function () { describe('Dependency Injection Tests', function () {

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Displaying Data Tests', function () { describe('Displaying Data Tests', function () {
let _title = 'Tour of Heroes'; let _title = 'Tour of Heroes';
let _defaultHero = 'Windstorm'; let _defaultHero = 'Windstorm';

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describeIf(browser.appIsTs || browser.appIsJs, 'Forms Tests', function () { describeIf(browser.appIsTs || browser.appIsJs, 'Forms Tests', function () {
beforeEach(function () { beforeEach(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Hierarchical dependency injection', function () { describe('Hierarchical dependency injection', function () {
beforeEach(function () { beforeEach(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Homepage Hello World', function () { describe('Homepage Hello World', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Homepage Tabs', function () { describe('Homepage Tabs', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Homepage Todo', function () { describe('Homepage Todo', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Lifecycle hooks', function () { describe('Lifecycle hooks', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Pipes', function () { describe('Pipes', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('QuickStart E2E Tests', function () { describe('QuickStart E2E Tests', function () {
let expectedMsg = 'My First Angular 2 App'; let expectedMsg = 'My First Angular 2 App';

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Router', function () { describe('Router', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Router', function () { describe('Router', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Server Communication', function () { describe('Server Communication', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Structural Directives', function () { describe('Structural Directives', function () {
// tests interact - so we need beforeEach instead of beforeAll // tests interact - so we need beforeEach instead of beforeAll

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Style Guide', function () { describe('Style Guide', function () {
it('01-01', function () { it('01-01', function () {
browser.get('#/01-01'); browser.get('#/01-01');

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Documentation StyleGuide E2E Tests', function() { describe('Documentation StyleGuide E2E Tests', function() {
let expectedMsg = 'My First Angular 2 App'; let expectedMsg = 'My First Angular 2 App';

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
// Not yet complete // Not yet complete
describe('Template Syntax', function () { describe('Template Syntax', function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Tutorial part 1', () => { describe('Tutorial part 1', () => {
let expectedH1 = 'Tour of Heroes'; let expectedH1 = 'Tour of Heroes';

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Tutorial', function () { describe('Tutorial', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path='../_protractor/e2e.d.ts' /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('TOH Http Chapter', function () { describe('TOH Http Chapter', function () {
beforeEach(function () { beforeEach(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('Upgrade Tests', function () { describe('Upgrade Tests', function () {
// Protractor doesn't support the UpgradeAdapter's asynchronous // Protractor doesn't support the UpgradeAdapter's asynchronous

View File

@ -1,4 +1,4 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict'; 'use strict';
// Angular E2E Testing Guide: // Angular E2E Testing Guide:

View File

@ -1,4 +1,4 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict'; 'use strict';
// Angular E2E Testing Guide: // Angular E2E Testing Guide:

View File

@ -1,4 +1,4 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict'; 'use strict';
// Angular E2E Testing Guide: // Angular E2E Testing Guide:

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('User Input Tests', function () { describe('User Input Tests', function () {
beforeAll(function () { beforeAll(function () {

View File

@ -1,4 +1,5 @@
/// <reference path="../_protractor/e2e.d.ts" /> /// <reference path='../_protractor/e2e.d.ts' />
'use strict';
describe('QuickStart E2E Tests', function () { describe('QuickStart E2E Tests', function () {
let expectedMsg = 'Hello from Angular 2 App with Webpack'; let expectedMsg = 'Hello from Angular 2 App with Webpack';