Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit a803c53

Browse files
committed
incorporate cnishina's review
1 parent 546931a commit a803c53

File tree

11 files changed

+14
-33
lines changed

11 files changed

+14
-33
lines changed

public/docs/_examples/cb-dynamic-form-deprecated/e2e-spec.ts.disabled

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'; // necessary for es6 output in node
22

33
import { browser, element, by } from 'protractor/globals';
4-
import { sendKeys } from '../protractor-helpers';
54

65
/* tslint:disable:quotemark */
76
describe('Dynamic Form Deprecated', function () {

public/docs/_examples/debug.log

-12
This file was deleted.

public/docs/_examples/dependency-injection/e2e-spec.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,12 @@ describe('Dependency Injection Tests', function () {
149149
let heroes = element.all(by.css('#unauthorized hero-list div'));
150150
expect(heroes.count()).toBeGreaterThan(0);
151151

152-
let filteredHeroes = heroes.filter(function(elem: ElementFinder, index: number){
153-
return elem.getText().then(function(text: string) {
152+
let filteredHeroes = heroes.filter((elem: ElementFinder, index: number) => {
153+
return elem.getText().then((text: string) => {
154154
return /secret/.test(text);
155155
});
156156
});
157157

158-
// console.log("******Secret heroes count: "+filteredHeroes.length);
159158
expect(filteredHeroes.count()).toEqual(0);
160159
});
161160

@@ -190,7 +189,6 @@ describe('Dependency Injection Tests', function () {
190189
});
191190
});
192191

193-
// console.log("******Secret heroes count: "+filteredHeroes.length);
194192
expect(filteredHeroes.count()).toBeGreaterThan(0);
195193
});
196194

public/docs/_examples/forms-deprecated/e2e-spec.ts.disabled

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict'; // necessary for es6 output in node
22

33
import { browser, element, by } from 'protractor/globals';
4-
import { sendKeys } from '../protractor-helpers';
4+
import { appLang, describeIf } from '../protractor-helpers';
55

6-
describeIf(browser.appIsTs || browser.appIsJs, 'Forms (Deprecated) Tests', function () {
6+
describeIf(appLang.appIsTs || appLang.appIsJs, 'Forms (Deprecated) Tests', function () {
77

88
beforeEach(function () {
99
browser.get('');
@@ -49,8 +49,7 @@ describeIf(browser.appIsTs || browser.appIsJs, 'Forms (Deprecated) Tests', funct
4949
let newValue: string;
5050
let alterEgoEle = element.all(by.css('input[ngcontrol=alterEgo]')).get(0);
5151
alterEgoEle.getAttribute('value').then(function(value) {
52-
// alterEgoEle.sendKeys(test);
53-
sendKeys(alterEgoEle, test);
52+
alterEgoEle.sendKeys(test);
5453
newValue = value + test;
5554
expect(alterEgoEle.getAttribute('value')).toEqual(newValue);
5655
}).then(function() {

public/docs/_examples/forms/e2e-spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describeIf(appLang.appIsTs || appLang.appIsJs, 'Forms Tests', function () {
5050
alterEgoEle.sendKeys(test);
5151
newValue = value + test;
5252
expect(alterEgoEle.getAttribute('value')).toEqual(newValue);
53-
}).then(function() {
5453
let b = element.all(by.css('button[type=submit]')).get(0);
5554
return b.click();
5655
}).then(function() {

public/docs/_examples/router-deprecated/e2e-spec.ts.disabled

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'; // necessary for es6 output in node
22

33
import { browser, element, by } from 'protractor/globals';
4-
import { sendKeys } from '../protractor-helpers';
54

65
describe('Router', function () {
76

@@ -85,7 +84,7 @@ describe('Router', function () {
8584
expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail');
8685
expect(page.heroDetailTitle.getText()).toContain(heroText);
8786
let inputEle = page.heroDetail.element(by.css('input'));
88-
return sendKeys(inputEle, '-foo');
87+
inputEle.sendKeys('-foo');
8988
}).then(function() {
9089
expect(page.heroDetailTitle.getText()).toContain(heroText + '-foo');
9190
let buttonEle = page.heroDetail.element(by.css('button'));
@@ -113,7 +112,7 @@ describe('Router', function () {
113112
expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail');
114113
expect(page.crisisDetailTitle.getText()).toContain(crisisText);
115114
let inputEle = page.crisisDetail.element(by.css('input'));
116-
return sendKeys(inputEle, '-foo');
115+
inputEle.sendKeys('-foo');
117116
}).then(function () {
118117
expect(page.crisisDetailTitle.getText()).toContain(crisisText + '-foo');
119118
let buttonEle = page.crisisDetail.element(by.cssContainingText('button', shouldSave ? 'Save' : 'Cancel'));

public/docs/_examples/toh-3/e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function updateHeroTests() {
116116

117117
function addToHeroName(text: string): WPromise<void> {
118118
let input = element(by.css('input'));
119-
input.sendKeys(text);
119+
return input.sendKeys(text);
120120
}
121121

122122
function expectHeading(hLevel: number, expectedText: string): void {

public/docs/_examples/toh-4/e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function updateHeroTests() {
116116

117117
function addToHeroName(text: string): WPromise<void> {
118118
let input = element(by.css('input'));
119-
input.sendKeys(text);
119+
return input.sendKeys(text);
120120
}
121121

122122
function expectHeading(hLevel: number, expectedText: string): void {

public/docs/_examples/toh-5/e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ describe('Tutorial part 5', () => {
176176

177177
function addToHeroName(text: string): WPromise<void> {
178178
let input = element(by.css('input'));
179-
input.sendKeys(text);
179+
return input.sendKeys(text);
180180
}
181181

182182
function expectHeading(hLevel: number, expectedText: string): void {

public/docs/_examples/toh-6/e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ describe('Tutorial part 6', () => {
263263

264264
function addToHeroName(text: string): WPromise<void> {
265265
let input = element(by.css('input'));
266-
input.sendKeys(text);
266+
return input.sendKeys(text);
267267
}
268268

269269
function expectHeading(hLevel: number, expectedText: string): void {

public/docs/_examples/upgrade-phonecat-3-final/e2e-spec.ts.disabled

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'; // necessary for es6 output in node
22

33
import { browser, element, by } from 'protractor/globals';
4-
import { sendKeys } from '../protractor-helpers';
54

65
// Angular E2E Testing Guide:
76
// https://docs.angularjs.org/guide/e2e-testing
@@ -30,11 +29,11 @@ describe('PhoneCat Application', function() {
3029

3130
expect(phoneList.count()).toBe(20);
3231

33-
sendKeys(query, 'nexus');
32+
query.sendKeys('nexus');
3433
expect(phoneList.count()).toBe(1);
3534

3635
query.clear();
37-
sendKeys(query, 'motorola');
36+
query.sendKeys('motorola');
3837
expect(phoneList.count()).toBe(8);
3938
});
4039

@@ -50,7 +49,7 @@ describe('PhoneCat Application', function() {
5049
});
5150
}
5251

53-
sendKeys(queryField, 'tablet'); // Let's narrow the dataset to make the assertions shorter
52+
queryField.sendKeys('tablet'); // Let's narrow the dataset to make the assertions shorter
5453

5554
expect(getNames()).toEqual([
5655
'Motorola XOOM\u2122 with Wi-Fi',

0 commit comments

Comments
 (0)