mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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
30 lines
806 B
TypeScript
30 lines
806 B
TypeScript
import { browser, element, by } from 'protractor';
|
|
|
|
describe('Testing Example', () => {
|
|
const expectedViewNames = ['Dashboard', 'Heroes', 'About'];
|
|
|
|
beforeAll(() => browser.get(''));
|
|
|
|
function getPageElts() {
|
|
return {
|
|
navElts: element.all(by.css('app-root nav a')),
|
|
appDashboard: element(by.css('app-root app-dashboard')),
|
|
};
|
|
}
|
|
|
|
it('has title', async () => {
|
|
expect(await browser.getTitle()).toEqual('App Under Test');
|
|
});
|
|
|
|
it(`has views ${expectedViewNames}`, async () => {
|
|
const viewNames = await getPageElts().navElts.map(el => el.getText());
|
|
|
|
expect(viewNames).toEqual(expectedViewNames);
|
|
});
|
|
|
|
it('has dashboard as the active view', async () => {
|
|
const page = getPageElts();
|
|
|
|
expect(await page.appDashboard.isPresent()).toBeTruthy();
|
|
});
|
|
});
|