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
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { browser, element, by } from 'protractor';
|
|
|
|
describe('Router basic tutorial e2e tests', () => {
|
|
|
|
beforeEach(() => browser.get(''));
|
|
|
|
it('should display Angular Router Sample', async () => {
|
|
expect(await element(by.css('h1')).getText()).toBe('Angular Router Sample');
|
|
});
|
|
|
|
it('should display Crisis Center button', async () => {
|
|
expect(await element.all(by.css('a')).get(0).getText()).toBe('Crisis Center');
|
|
});
|
|
|
|
it('should display Heroes button', async () => {
|
|
expect(await element.all(by.css('a')).get(1).getText()).toBe('Heroes');
|
|
});
|
|
|
|
it('should display HEROES', async () => {
|
|
expect(await element(by.css('h3')).getText()).toBe('HEROES');
|
|
});
|
|
|
|
it('should change to display crisis list component', async () => {
|
|
const crisisButton = element.all(by.css('a')).get(0);
|
|
await crisisButton.click();
|
|
expect(await element(by.css('h3')).getText()).toBe('CRISIS CENTER');
|
|
});
|
|
|
|
it('should change to display heroes component', async () => {
|
|
const heroesButton = element.all(by.css('a')).get(1);
|
|
await heroesButton.click();
|
|
expect(await element(by.css('h3')).getText()).toBe('HEROES');
|
|
});
|
|
|
|
it('should use wildcard route', async () => {
|
|
await browser.get('/fake-page');
|
|
expect(await browser.getCurrentUrl()).toContain('fake-page');
|
|
expect(await element(by.css('h2')).getText()).toBe('Page Not Found');
|
|
});
|
|
});
|