angular/integration/platform-server-hydration/e2e/src/app.e2e-spec.ts
Alan Agius 8630dc8149 test: add Integration tests for hydration and event reply (#55708)
This commit introduces integration tests for hydration and event reply functionalities. Additionally, it implements a payload size check for the `event-dispatch-contract.min.js`.

PR Close #55708
2024-05-07 13:39:55 -07:00

30 lines
933 B
TypeScript

import {browser, by, element} from 'protractor';
import {bootstrapClientApp, navigateTo, verifyNoBrowserErrors} from './util';
describe('App 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('');
});
afterEach(async () => {
// Make sure there were no client side errors.
await verifyNoBrowserErrors();
});
it('should reply click event', async () => {
const divElement = element(by.css('#divElement'));
expect(await divElement.getText()).toContain('click not triggered');
// Trigger click
await divElement.click();
// Bootstrap client application
await bootstrapClientApp();
expect(await divElement.getText()).toContain('click triggered');
});
});