test: add integration test for lazy chunks and ngDevMode in cli apps (#32957)
PR Close #32957
This commit is contained in:

committed by
Matias Niemelä

parent
abd2a58c67
commit
609d2557bc
28
integration/cli-hello-world-lazy/e2e/src/app.e2e-spec.ts
Normal file
28
integration/cli-hello-world-lazy/e2e/src/app.e2e-spec.ts
Normal 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));
|
||||
});
|
||||
});
|
11
integration/cli-hello-world-lazy/e2e/src/app.po.ts
Normal file
11
integration/cli-hello-world-lazy/e2e/src/app.po.ts
Normal 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>;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user