Skip to content

Commit 4acc27c

Browse files
authored
Add E2E test for homepage map rendering and markers (#43)
* Add E2E test for homepage map rendering and markers * Fix timing issue in homepage map E2E test by waiting for marker visibility
1 parent 9084049 commit 4acc27c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

e2e/homepage.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test.describe('Homepage Map', () => {
4+
test('should render the map and show location markers', async ({ page }) => {
5+
await page.goto('/');
6+
7+
// Wait for the map container
8+
const mapContainer = page.locator('div[role="region"] >> nth=0');
9+
await expect(mapContainer).toBeVisible();
10+
11+
// Wait for at least one marker icon to appear
12+
const markerIcons = page.locator('img[src$="map-pin.png"]');
13+
await expect(markerIcons.first()).toBeVisible({ timeout: 5000 });
14+
15+
const count = await markerIcons.count();
16+
expect(count).toBeGreaterThan(0);
17+
});
18+
});

0 commit comments

Comments
 (0)