Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion umd-federation/app1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"module-federation-runtime": "1.2.4"
},
"devDependencies": {
"@babel/core": "7.24.7",
Expand Down
35 changes: 14 additions & 21 deletions umd-federation/e2e/checkUmdFederationApps.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';

import { BaseMethods } from '../../playwright-e2e/common/base';
import { baseSelectors } from '../../cypress-e2e/common/selectors';
import { Constants } from '../../cypress-e2e/fixtures/constants';

Expand All @@ -19,32 +18,26 @@ const appsData = [
test.describe('UMD Federation', () => {
appsData.forEach(({ header1, header2, header3, host }) => {
test.describe(`Check application on localhost:${host}`, () => {
let basePage: BaseMethods;
const baseUrl = `http://localhost:${host}/`;

test.beforeEach(async ({ page }) => {
basePage = new BaseMethods(page);
await basePage.openLocalhost({ number: host });
await page.goto(baseUrl, { waitUntil: 'networkidle' });
});

test('Check App elements', async () => {
test.skip(!header1, 'App 2 renders external remote content without headers.');
test('Check App elements', async ({ page }) => {
if (!header1 || !header2 || !header3) {
test.skip('App 2 renders external remote content without headers.');
} else {
const headerLocator = page.locator(baseSelectors.tags.headers.h1);

await basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h1,
text: header1!,
});
await basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h1,
text: header2!,
});
await basePage.checkElementWithTextPresence({
selector: baseSelectors.tags.headers.h1,
text: header3!,
});
for (const text of [header1, header2, header3]) {
await expect(headerLocator.filter({ hasText: text })).toBeVisible();
}
}
});

test('Check App URL', async () => {
await basePage.checkUrlText(`http://localhost:${host}/`, true);
test('Check App URL', async ({ page }) => {
await expect.poll(() => page.url()).toContain(baseUrl);
});
});
});
Expand Down
1 change: 1 addition & 0 deletions umd-federation/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineConfig({
screenshot: 'only-on-failure',
video: 'retain-on-failure',
viewport: { width: 1920, height: 1080 },
ignoreHTTPSErrors: true,
},
projects: [
{
Expand Down
3 changes: 3 additions & 0 deletions umd-federation/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading