test: add integration test for lazy chunks and ngDevMode in cli apps (#32957)

PR Close #32957
This commit is contained in:
Filipe Silva
2019-10-02 13:09:42 +01:00
committed by Matias Niemelä
parent abd2a58c67
commit 609d2557bc
40 changed files with 21689 additions and 0 deletions

View File

@ -0,0 +1,28 @@
import { AppPage } from './app.po';
import { browser, logging, element, by } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('cli-hello-world-lazy app is running!');
});
it('should display lazy route', () => {
browser.get('/lazy');
expect(element(by.css('app-lazy p')).getText()).toEqual('lazy works!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});

View File

@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get(browser.baseUrl) as Promise<any>;
}
getTitleText() {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}