Skip to content

Commit 0ccedc0

Browse files
fix: resolve Playwright test import conflicts
- Use standard @playwright/test imports instead of custom extended test - Export BasePage class and instantiate it in tests - This fixes "test.describe() called in unexpected place" errors in CI - Maintain the same test functionality while avoiding version conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6cd92bb commit 0ccedc0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

advanced-api/dynamic-remotes-runtime-environment-variables/e2e/checkDynamicRemotesRuntimesApps.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { test, expect } from './utils/base-test';
1+
import { test, expect } from '@playwright/test';
2+
import { BasePage } from './utils/base-test';
23
import { selectors } from './utils/selectors';
34
import { Constants } from './utils/constants';
45

@@ -32,7 +33,8 @@ test.describe('Dynamic Remotes Runtime Environment Variables E2E Tests', () => {
3233
const { host, subheader, header, hostH3, paragraph, button, loading, buttonHeader, buttonH2, buttonParagraph } = appData;
3334

3435
test.describe(`Check ${subheader} app`, () => {
35-
test(`should display ${subheader} app widget functionality and application elements`, async ({ basePage }) => {
36+
test(`should display ${subheader} app widget functionality and application elements`, async ({ page }) => {
37+
const basePage = new BasePage(page);
3638
await basePage.openLocalhost(host);
3739

3840
// Check main header
@@ -99,7 +101,8 @@ test.describe('Dynamic Remotes Runtime Environment Variables E2E Tests', () => {
99101
expect(envConfigRequests.length).toBeGreaterThan(0);
100102
});
101103

102-
test('should demonstrate dynamic remote loading with environment config', async ({ basePage }) => {
104+
test('should demonstrate dynamic remote loading with environment config', async ({ page }) => {
105+
const basePage = new BasePage(page);
103106
await basePage.openLocalhost(3000);
104107

105108
// Click to load remote component

advanced-api/dynamic-remotes-runtime-environment-variables/e2e/utils/base-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test as base, expect, Page } from '@playwright/test';
22

3-
class BasePage {
3+
export class BasePage {
44
constructor(public page: Page) {}
55

66
async openLocalhost(port: number) {

0 commit comments

Comments
 (0)