update e2e prose

This commit is contained in:
Filipe Silva 2016-11-12 22:21:35 +00:00
parent 0985055d2f
commit 59c9a6f3bc
2 changed files with 16 additions and 11 deletions

View File

@ -1,4 +1,4 @@
'use strict'; // necessary for es6 output in node 'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor'; import { browser, element, by } from 'protractor';
@ -67,11 +67,7 @@ describe('PhoneCat Application', function() {
// #docregion links // #docregion links
it('should render phone specific links', function() { it('should render phone specific links', function() {
let query = element(by.css('input')); let query = element(by.css('input'));
// https://github.com/angular/protractor/issues/2019 query.sendKeys('nexus');
let str = 'nexus';
for (let i = 0; i < str.length; i++) {
query.sendKeys(str.charAt(i));
}
element.all(by.css('.phones li a')).first().click(); element.all(by.css('.phones li a')).first().click();
browser.getCurrentUrl().then(function(url: string) { browser.getCurrentUrl().then(function(url: string) {
expect(url.endsWith('/phones/nexus-s')).toBe(true); expect(url.endsWith('/phones/nexus-s')).toBe(true);

View File

@ -1519,10 +1519,17 @@ code-example(format="").
we don't change how the application behaves from the user's point of view. we don't change how the application behaves from the user's point of view.
During TypeScript conversion, there is nothing we have to do to keep E2E tests During TypeScript conversion, there is nothing we have to do to keep E2E tests
working. It is only when we start to upgrade components and their template to Angular 2 working. It is only when we change our bootstrap to that of an Hybrid app that we need to
that we need to make some changes. This is because the E2E tests have matchers make some changes.
that are specific to Angular 1. For PhoneCat we need to make the following changes
in order to make things work with Angular 2: The following change is needed in `protractor-conf.js` to sync with hybrid apps:
code-example(format="").
ng12Hybrid: true
:marked
The next set of changes is when we start to upgrade components and their template to Angular 2.
This is because the E2E tests have matchers that are specific to Angular 1.
For PhoneCat we need to make the following changes in order to make things work with Angular 2:
table table
tr tr
@ -1586,7 +1593,9 @@ table
pure Angular 2, Angular 1 ceases to exist on the page completely. pure Angular 2, Angular 1 ceases to exist on the page completely.
At this point we need to tell Protractor that it should not be looking for At this point we need to tell Protractor that it should not be looking for
an Angular 1 app anymore, but instead it should find *Angular 2 apps* from an Angular 1 app anymore, but instead it should find *Angular 2 apps* from
the page. The following change is then needed in `protractor-conf.js`: the page.
Replace the `ng12Hybrid` previously added with the following in `protractor-conf.js`:
code-example(format=""). code-example(format="").
useAllAngular2AppRoots: true, useAllAngular2AppRoots: true,