build: disable failing ivy playground example e2e tests (#28490)

With ed1ba88ffd9d0fc266808413fa517e7a31943bc8 we switched the
examples to run with Bazel. This means that we can now also run the
e2e tests for these examples against Ivy. All playground e2e tests,
**except** the `web_worker` examples, successfully run with Ivy.

The failing webworker e2e tests have been temporarily disabled with
`fixmeIvy` and need to be investigated in a follow-up.

PR Close #28490
This commit is contained in:
Paul Gschwendtner
2019-02-01 14:55:11 +01:00
committed by Matias Niemelä
parent 16a78f97f5
commit 5cdbdc9ee0
6 changed files with 222 additions and 205 deletions

View File

@ -6,70 +6,73 @@
* found in the LICENSE file at https://angular.io/license
*/
import {verifyNoBrowserErrors} from 'e2e_util/e2e_util';
import {fixmeIvy} from '@angular/private/testing';
import {ExpectedConditions, browser, by, element, protractor} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../e2e_util/e2e_util';
describe('WebWorkers Input', function() {
afterEach(() => {
verifyNoBrowserErrors();
browser.ignoreSynchronization = false;
});
const selector = 'input-app';
const URL = 'all/playground/src/web_workers/input/index.html';
const VALUE = 'test val';
fixmeIvy('NullInjectorError: No provider for InjectionToken ROOT_CONTEXT_TOKEN!')
.describe('WebWorkers Input', function() {
afterEach(() => {
verifyNoBrowserErrors();
browser.ignoreSynchronization = false;
});
const selector = 'input-app';
const URL = '/';
const VALUE = 'test val';
it('should bootstrap', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
it('should bootstrap', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
waitForBootstrap();
const elem = element(by.css(selector + ' h2'));
expect(elem.getText()).toEqual('Input App');
});
waitForBootstrap();
const elem = element(by.css(selector + ' h2'));
expect(elem.getText()).toEqual('Input App');
});
it('should bind to input value', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
it('should bind to input value', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
waitForBootstrap();
const input = element(by.css(selector + ' input'));
input.sendKeys(VALUE);
const displayElem = element(by.css(selector + ' .input-val'));
const expectedVal = `Input val is ${VALUE}.`;
browser.wait(ExpectedConditions.textToBePresentInElement(displayElem, expectedVal), 5000);
expect(displayElem.getText()).toEqual(expectedVal);
});
waitForBootstrap();
const input = element(by.css(selector + ' input'));
input.sendKeys(VALUE);
const displayElem = element(by.css(selector + ' .input-val'));
const expectedVal = `Input val is ${VALUE}.`;
browser.wait(ExpectedConditions.textToBePresentInElement(displayElem, expectedVal), 5000);
expect(displayElem.getText()).toEqual(expectedVal);
});
it('should bind to textarea value', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
it('should bind to textarea value', () => {
// This test can't wait for Angular as Testability is not available when using WebWorker
browser.ignoreSynchronization = true;
browser.get(URL);
waitForBootstrap();
const input = element(by.css(selector + ' textarea'));
input.sendKeys(VALUE);
const displayElem = element(by.css(selector + ' .textarea-val'));
const expectedVal = `Textarea val is ${VALUE}.`;
browser.wait(ExpectedConditions.textToBePresentInElement(displayElem, expectedVal), 5000);
expect(displayElem.getText()).toEqual(expectedVal);
});
waitForBootstrap();
const input = element(by.css(selector + ' textarea'));
input.sendKeys(VALUE);
const displayElem = element(by.css(selector + ' .textarea-val'));
const expectedVal = `Textarea val is ${VALUE}.`;
browser.wait(ExpectedConditions.textToBePresentInElement(displayElem, expectedVal), 5000);
expect(displayElem.getText()).toEqual(expectedVal);
});
function waitForBootstrap() {
browser.wait(protractor.until.elementLocated(by.css(selector + ' h2')), 5000)
.then(
() => {
const elem = element(by.css(selector + ' h2'));
browser.wait(
protractor.ExpectedConditions.textToBePresentInElement(elem, 'Input App'), 5000);
},
() => {
// jasmine will timeout if this gets called too many times
console.error('>> unexpected timeout -> browser.refresh()');
browser.refresh();
waitForBootstrap();
});
}
});
function waitForBootstrap() {
browser.wait(protractor.until.elementLocated(by.css(selector + ' h2')), 5000)
.then(
() => {
const elem = element(by.css(selector + ' h2'));
browser.wait(
protractor.ExpectedConditions.textToBePresentInElement(elem, 'Input App'),
5000);
},
() => {
// jasmine will timeout if this gets called too many times
console.error('>> unexpected timeout -> browser.refresh()');
browser.refresh();
waitForBootstrap();
});
}
});