Revert "test: disable failing ivy example e2e tests (#28402)" (#28438)

This reverts commit 351610ca8db31b22c89994de6aa31a015be95082.

PR Close #28438
This commit is contained in:
Jason Aden 2019-01-29 15:38:45 -08:00
parent 7c157780a9
commit cbed4851a3
5 changed files with 103 additions and 125 deletions

View File

@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy} from '@angular/private/testing';
import {$, ExpectedConditions, browser, by, element} from 'protractor'; import {$, ExpectedConditions, browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../test-utils'; import {verifyNoBrowserErrors} from '../../../../test-utils';
@ -17,34 +16,29 @@ function waitForElement(selector: string) {
browser.wait(EC.presenceOf($(selector)), 20000); browser.wait(EC.presenceOf($(selector)), 20000);
} }
fixmeIvy( describe('ngComponentOutlet', () => {
'unknown. Run "yarn bazel run packages/examples/common:devserver --define=compile=aot" ' + const URL = 'common/ngComponentOutlet/ts/';
'to debug') afterEach(verifyNoBrowserErrors);
.describe('ngComponentOutlet', () => {
const URL = '/ngComponentOutlet';
afterEach(verifyNoBrowserErrors);
describe('ng-component-outlet-example', () => { describe('ng-component-outlet-example', () => {
it('should render simple', () => { it('should render simple', () => {
browser.get(URL); browser.get(URL);
waitForElement('ng-component-outlet-simple-example'); waitForElement('ng-component-outlet-simple-example');
expect(element.all(by.css('hello-world')).getText()).toEqual(['Hello World!']); expect(element.all(by.css('hello-world')).getText()).toEqual(['Hello World!']);
});
it('should render complete', () => {
browser.get(URL);
waitForElement('ng-component-outlet-complete-example');
expect(element.all(by.css('complete-component')).getText()).toEqual([
'Complete: AhojSvet!'
]);
});
it('should render other module', () => {
browser.get(URL);
waitForElement('ng-component-outlet-other-module-example');
expect(element.all(by.css('other-module-component')).getText()).toEqual([
'Other Module Component!'
]);
});
});
}); });
it('should render complete', () => {
browser.get(URL);
waitForElement('ng-component-outlet-complete-example');
expect(element.all(by.css('complete-component')).getText()).toEqual(['Complete: AhojSvet!']);
});
it('should render other module', () => {
browser.get(URL);
waitForElement('ng-component-outlet-other-module-example');
expect(element.all(by.css('other-module-component')).getText()).toEqual([
'Other Module Component!'
]);
});
});
});

View File

@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy} from '@angular/private/testing';
import {$, ExpectedConditions, browser, by, element} from 'protractor'; import {$, ExpectedConditions, browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../test-utils'; import {verifyNoBrowserErrors} from '../../../../test-utils';
@ -45,21 +44,18 @@ describe('ngIf', () => {
describe('ng-if-then-else', () => { describe('ng-if-then-else', () => {
let comp = 'ng-if-then-else'; let comp = 'ng-if-then-else';
it('should hide/show content', () => {
fixmeIvy('unknown. Run "yarn bazel run packages/examples/common:devserver" to debug') browser.get(URL);
.it('should hide/show content', () => { waitForElement(comp);
browser.get(URL); expect(element.all(by.css(comp)).get(0).getText())
waitForElement(comp); .toEqual('hideSwitch Primary show = true\nPrimary text to show');
expect(element.all(by.css(comp)).get(0).getText()) element.all(by.css(comp + ' button')).get(1).click();
.toEqual('hideSwitch Primary show = true\nPrimary text to show'); expect(element.all(by.css(comp)).get(0).getText())
element.all(by.css(comp + ' button')).get(1).click(); .toEqual('hideSwitch Primary show = true\nSecondary text to show');
expect(element.all(by.css(comp)).get(0).getText()) element.all(by.css(comp + ' button')).get(0).click();
.toEqual('hideSwitch Primary show = true\nSecondary text to show'); expect(element.all(by.css(comp)).get(0).getText())
element.all(by.css(comp + ' button')).get(0).click(); .toEqual('showSwitch Primary show = false\nAlternate text while primary text is hidden');
expect(element.all(by.css(comp)).get(0).getText()) });
.toEqual(
'showSwitch Primary show = false\nAlternate text while primary text is hidden');
});
}); });
describe('ng-if-let', () => { describe('ng-if-let', () => {

View File

@ -6,45 +6,40 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy} from '@angular/private/testing';
import {ElementArrayFinder, ElementFinder, browser, by, element} from 'protractor'; import {ElementArrayFinder, ElementFinder, browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
import {verifyNoBrowserErrors} from '../../../../test-utils'; describe('simpleNgModel example', () => {
afterEach(verifyNoBrowserErrors);
let input: ElementFinder;
let paragraphs: ElementArrayFinder;
let button: ElementFinder;
fixmeIvy( beforeEach(() => {
'unkown; verifyNoBrowserErrors fails due to "ExpressionChangedAfterItHasBeenCheckedError"' + browser.get('/forms/ts/simpleNgModel/index.html');
'Debug by running "yarn bazel run //packages/examples/forms:devserver --define=compile=aot') input = element(by.css('input'));
.describe('simpleNgModel example', () => { paragraphs = element.all(by.css('p'));
afterEach(verifyNoBrowserErrors); button = element(by.css('button'));
let input: ElementFinder; });
let paragraphs: ElementArrayFinder;
let button: ElementFinder;
beforeEach(() => { it('should update the domain model as you type', () => {
browser.get('/simpleNgModel'); input.click();
input = element(by.css('input')); input.sendKeys('Carson');
paragraphs = element.all(by.css('p'));
button = element(by.css('button'));
});
it('should update the domain model as you type', () => { expect(paragraphs.get(0).getText()).toEqual('Value: Carson');
input.click(); });
input.sendKeys('Carson');
expect(paragraphs.get(0).getText()).toEqual('Value: Carson'); it('should report the validity correctly', () => {
}); expect(paragraphs.get(1).getText()).toEqual('Valid: false');
input.click();
input.sendKeys('a');
it('should report the validity correctly', () => { expect(paragraphs.get(1).getText()).toEqual('Valid: true');
expect(paragraphs.get(1).getText()).toEqual('Valid: false'); });
input.click();
input.sendKeys('a');
expect(paragraphs.get(1).getText()).toEqual('Valid: true'); it('should set the value by changing the domain model', () => {
}); button.click();
expect(input.getAttribute('value')).toEqual('Nancy');
});
it('should set the value by changing the domain model', () => { });
button.click();
expect(input.getAttribute('value')).toEqual('Nancy');
});
});

View File

@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy} from '@angular/private/testing';
import {browser, by, element} from 'protractor'; import {browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../../test-utils'; import {verifyNoBrowserErrors} from '../../../../../test-utils';
@ -29,28 +28,26 @@ describe('upgrade/static (full)', () => {
expect(heroComponents.count()).toEqual(3); expect(heroComponents.count()).toEqual(3);
}); });
fixmeIvy('unknown; <ng1Hero> component does not seem to render name & description') it('should add a new hero when the "Add Hero" button is pressed', () => {
.it('should add a new hero when the "Add Hero" button is pressed', () => { const addHeroButton = element.all(by.css('button')).last();
const addHeroButton = element.all(by.css('button')).last(); expect(addHeroButton.getText()).toEqual('Add Hero');
expect(addHeroButton.getText()).toEqual('Add Hero'); addHeroButton.click();
addHeroButton.click(); const heroComponents = element.all(by.css('ng1-hero'));
const heroComponents = element.all(by.css('ng1-hero')); expect(heroComponents.last().element(by.css('h2')).getText()).toEqual('Kamala Khan');
expect(heroComponents.last().element(by.css('h2')).getText()).toEqual('Kamala Khan'); });
});
fixmeIvy('unknown; <ng1Hero> component does not seem to render name & description') it('should remove a hero when the "Remove" button is pressed', () => {
.it('should remove a hero when the "Remove" button is pressed', () => { let firstHero = element.all(by.css('ng1-hero')).get(0);
let firstHero = element.all(by.css('ng1-hero')).get(0); expect(firstHero.element(by.css('h2')).getText()).toEqual('Superman');
expect(firstHero.element(by.css('h2')).getText()).toEqual('Superman');
const removeHeroButton = firstHero.element(by.css('button')); const removeHeroButton = firstHero.element(by.css('button'));
expect(removeHeroButton.getText()).toEqual('Remove'); expect(removeHeroButton.getText()).toEqual('Remove');
removeHeroButton.click(); removeHeroButton.click();
const heroComponents = element.all(by.css('ng1-hero')); const heroComponents = element.all(by.css('ng1-hero'));
expect(heroComponents.count()).toEqual(2); expect(heroComponents.count()).toEqual(2);
firstHero = element.all(by.css('ng1-hero')).get(0); firstHero = element.all(by.css('ng1-hero')).get(0);
expect(firstHero.element(by.css('h2')).getText()).toEqual('Wonder Woman'); expect(firstHero.element(by.css('h2')).getText()).toEqual('Wonder Woman');
}); });
}); });

View File

@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy} from '@angular/private/testing';
import {ElementArrayFinder, ElementFinder, browser, by, element} from 'protractor'; import {ElementArrayFinder, ElementFinder, browser, by, element} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../../test-utils'; import {verifyNoBrowserErrors} from '../../../../../test-utils';
@ -59,35 +58,32 @@ describe('upgrade/static (lite)', () => {
it('should initially not render the heroes', () => expectHeroes(false)); it('should initially not render the heroes', () => expectHeroes(false));
fixmeIvy('unknown; <ng1Hero> component does not seem to render name & description') it('should toggle the heroes when clicking the "show/hide" button', () => {
.it('should toggle the heroes when clicking the "show/hide" button', () => { showHideBtn.click();
showHideBtn.click(); expectHeroes(true);
expectHeroes(true);
showHideBtn.click(); showHideBtn.click();
expectHeroes(false); expectHeroes(false);
}); });
fixmeIvy('unknown; <ng1Hero> component does not seem to render name & description') it('should add a new hero when clicking the "add" button', () => {
.it('should add a new hero when clicking the "add" button', () => { showHideBtn.click();
showHideBtn.click(); ng2HeroesAddBtn.click();
ng2HeroesAddBtn.click();
expectHeroes(true, 4, 'Added hero Kamala Khan'); expectHeroes(true, 4, 'Added hero Kamala Khan');
expect(ng1Heroes.last()).toHaveName('Kamala Khan'); expect(ng1Heroes.last()).toHaveName('Kamala Khan');
}); });
fixmeIvy('unknown; <ng1Hero> component does not seem to render name & description') it('should remove a hero when clicking its "remove" button', () => {
.it('should remove a hero when clicking its "remove" button', () => { showHideBtn.click();
showHideBtn.click();
const firstHero = ng1Heroes.first(); const firstHero = ng1Heroes.first();
expect(firstHero).toHaveName('Superman'); expect(firstHero).toHaveName('Superman');
const removeBtn = firstHero.element(by.buttonText('Remove')); const removeBtn = firstHero.element(by.buttonText('Remove'));
removeBtn.click(); removeBtn.click();
expectHeroes(true, 2, 'Removed hero Superman'); expectHeroes(true, 2, 'Removed hero Superman');
expect(ng1Heroes.first()).not.toHaveName('Superman'); expect(ng1Heroes.first()).not.toHaveName('Superman');
}); });
}); });