/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
integration/platform-server/e2e/src/helloworld-spec.ts
38 строк
1 KB
Alan Agius
test: update platform-server integration tests to use the Angular CLI (#49900)
18 апр 2023, 22:47
18 апр 2023, 22:47
03ae094
Код
Авторство
О чём код?
import {browser, by, element} from 'protractor'; import {bootstrapClientApp, navigateTo, verifyNoBrowserErrors} from './util'; describe('Hello world E2E Tests', () => { beforeEach(async () => { // Don't wait for Angular since it is not bootstrapped automatically. await browser.waitForAngularEnabled(false); // Load the page without waiting for Angular since it is not bootstrapped automatically. await navigateTo('helloworld'); }); afterEach(async () => { // Make sure there were no client side errors. await verifyNoBrowserErrors(); }); it('should display: Hello world!', async () => { // Test the contents from the server. expect(await element(by.css('div')).getText()).toEqual('Hello world!'); await bootstrapClientApp(); // Retest the contents after the client bootstraps. expect(await element(by.css('div')).getText()).toEqual('Hello world!'); }); it('should re-use component styles rendered on the server', async () => { expect(await element(by.css('style[ng-app-id="ng"]')).getText()).not.toBeNull(); await bootstrapClientApp(); // Make sure the server styles get reused by the client. expect(await element(by.css('style[ng-app-id="ng"]')).isPresent()).toBeFalsy(); expect(await element(by.css('style[ng-style-reused]')).isPresent()).toBeTruthy(); expect(await element(by.css('style')).getText()).toBe(''); }); });