| 1 | import { AppPage } from './app.po'; | = | 1 | import { AppPage } from './app.po'; |
| -+ | 2 | import { browser, logging } from 'protractor'; | ||
| 2 | = | 3 | ||
| 3 | describe('App home', () => { | 4 | describe('App home', () => { | |
| 4 | let page: AppPage; | 5 | let page: AppPage; | |
| 5 | 6 | |||
| 6 | beforeEach(() => { | 7 | beforeEach(() => { | |
| 7 | page = new AppPage(); | 8 | page = new AppPage(); | |
| 8 | }); | 9 | }); | |
| 9 | 10 | |||
| 10 | it('should display page title', () => { | <> | 11 | it('should display page title', async () => { |
| 11 | page.navigateTo(); | 12 | await page.navigateTo(); | |
| 12 | expect(page.getParagraphText()).toEqual('Home'); | 13 | expect(await page.getParagraphText()).toEqual('Home'); | |
| 13 | }); | = | 14 | }); |
| -+ | 15 | |||
| 16 | afterEach(async () => { | |||
| 17 | // Assert that there are no errors emitted from the browser | |||
| 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); | |||
| 19 | expect(logs).not.toContain(jasmine.objectContaining({ | |||
| 20 | level: logging.Level.SEVERE, | |||
| 21 | } as logging.Entry)); | |||
| 22 | }); | |||
| 14 | }); | = | 23 | }); |