Skip to content

Commit 49afd64

Browse files
committed
Wait until Playwright stops scrolling until doing something
1 parent 8c0cd40 commit 49afd64

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/e2e/community-events.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ test("Zurich meetup link works", async ({ page }) => {
3737
test("map matches screenshot", async ({ page }) => {
3838
const mapContainer = page.locator("#meetups-map").first()
3939
await mapContainer.scrollIntoViewIfNeeded()
40+
await expect(mapContainer).toBeVisible({ timeout: 10000 })
41+
await page.waitForTimeout(1500) // we need to wait until Playwright finishes scrolling...
4042
await expect(mapContainer.locator("canvas").first()).toHaveScreenshot(
4143
"meetups-map.png",
4244
{ timeout: 15_000 },
@@ -57,6 +59,7 @@ test("map tooltip appears on marker hover", async ({ page }) => {
5759
await expect(tooltip).toHaveCount(0)
5860
const mapCanvas = mapContainer.locator("canvas").first()
5961
await mapCanvas.hover()
62+
await page.waitForTimeout(2000) // we need to wait until Playwright finishes scrolling...
6063
const { clientX, clientY } = await page.evaluate(() => {
6164
const canvas = document.querySelector(
6265
"#meetups-map canvas",

0 commit comments

Comments
 (0)