George Kalpakas 23c36a24ed test(docs-infra): disable the Selenium Promise Manager in docs examples e2e tests (#39818)
This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).

PR Close #39818
2020-11-24 14:56:14 -08:00

136 lines
3.4 KiB
TypeScript

import { browser, element, by } from 'protractor';
describe('Upgrade Tests', () => {
describe('AngularJS Auto-bootstrap', () => {
beforeAll(() => browser.get('/index-ng-app.html'));
it('bootstraps as expected', async () => {
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('AngularJS JavaScript Bootstrap', () => {
beforeAll(() => browser.get('/index-bootstrap.html'));
it('bootstraps as expected', async () => {
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('AngularJS-Angular Hybrid Bootstrap', () => {
beforeAll(() => browser.get('/index-ajs-a-hybrid-bootstrap.html'));
it('bootstraps as expected', async () => {
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('Upgraded static component', async () => {
beforeAll(() => browser.get('/index-upgrade-static.html'));
it('renders', async () => {
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
});
describe('Upgraded component with IO', () => {
beforeAll(() => browser.get('/index-upgrade-io.html'));
it('has inputs', async () => {
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
it('has outputs', async () => {
await element(by.buttonText('Delete')).click();
expect(await element(by.css('h2')).getText()).toEqual('Ex-Windstorm details!');
});
});
describe('Downgraded static component', () => {
beforeAll(() => browser.get('/index-downgrade-static.html'));
it('renders', async () => {
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
});
describe('Downgraded component with IO', () => {
beforeAll(() => browser.get('/index-downgrade-io.html'));
it('has inputs', async () => {
expect(await element.all(by.css('h2')).first().getText()).toEqual('Windstorm details!');
});
it('has outputs', async () => {
await element.all(by.buttonText('Delete')).first().click();
expect(await element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!');
});
it('supports ng-repeat', async () => {
expect(await element.all(by.css('hero-detail')).count()).toBe(3);
});
});
describe('Downgraded component with content projection', () => {
beforeAll(() => browser.get('/index-ajs-to-a-projection.html'));
it('can be transcluded into', async () => {
expect(await element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
});
});
describe('Upgraded component with transclusion', () => {
beforeAll(() => browser.get('/index-a-to-ajs-transclusion.html'));
it('can be projected into', async () => {
expect(await element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
});
});
describe('Upgrading AngularJS Providers', () => {
beforeAll(() => browser.get('/index-ajs-to-a-providers.html'));
it('works', async () => {
expect(await element(by.css('h2')).getText()).toBe('1: Windstorm');
});
});
describe('Downgrading Angular Providers', () => {
beforeAll(() => browser.get('/index-a-to-ajs-providers.html'));
it('works', async () => {
expect(await element(by.css('h2')).getText()).toBe('1: Windstorm');
});
});
});