Skip to content

Commit 743f858

Browse files
test: fix comprehensive demo tests
1 parent 07c2d86 commit 743f858

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

comprehensive-demo-react16/e2e/checkApp1.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test.describe('Comprehensive Demo App1', () => {
99

1010
const demoLinks = ['Main', 'UI Library', 'Dialog', 'Svelte Page', 'Routing'];
1111
for (const name of demoLinks) {
12-
await expect(page.getByRole('link', { name })).toBeVisible();
12+
await expect(page.getByRole('button', { name })).toBeVisible();
1313
}
1414

1515
const appLinks = [
@@ -20,7 +20,7 @@ test.describe('Comprehensive Demo App1', () => {
2020
{ name: 'App #5', href: 'http://localhost:3005' },
2121
];
2222
for (const { name, href } of appLinks) {
23-
await expect(page.getByRole('link', { name })).toHaveAttribute('href', href);
23+
await expect(page.locator('a', { hasText: name })).toHaveAttribute('href', href);
2424
}
2525

2626
await expect(page.getByRole('heading', { name: 'Module Federation Demo' })).toBeVisible();

comprehensive-demo-react16/e2e/checkApp2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const base = 'http://localhost:3002';
55
test.describe('Comprehensive Demo App2', () => {
66
test('renders blocks, dialog and tabs', async ({ page }) => {
77
await page.goto(base);
8-
await expect(page.locator('header')).toHaveCSS('background-color', 'rgb(63, 81, 181)');
8+
await expect(page.locator('header').first()).toHaveCSS('background-color', 'rgb(63, 81, 181)');
99
await expect(page.locator('.jss2')).toHaveCSS('background-color', 'rgb(250, 250, 250)');
1010
await expect(page.locator('.jss3')).toHaveCSS('background-color', 'rgb(255, 255, 255)');
1111

comprehensive-demo-react16/e2e/checkApplications.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apps.forEach(({ port, name, selector, text }) => {
1212
test.describe(name, () => {
1313
test(`build and run ${name}`, async ({ page }) => {
1414
await page.goto(`http://localhost:${port}`);
15-
await expect(page.locator(selector)).toContainText(text);
15+
await expect(page.locator(selector, { hasText: text })).toBeVisible();
1616
});
1717
});
1818
});

0 commit comments

Comments
 (0)