Skip to content

Commit e0025d0

Browse files
committed
Actually visit the page before test
1 parent 5e1ba8c commit e0025d0

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default defineConfig({
1717
screenshot: "only-on-failure",
1818
},
1919

20-
timeout: 60 * 1000,
20+
timeout: 35 * 1000,
2121

2222
projects: [
2323
{

test/e2e/community-events.spec.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { test, expect } from "@playwright/test"
22

3-
test("map loads and Zurich meetup link works", async ({ page }) => {
3+
test.beforeEach(async ({ page }) => {
44
await page.goto("/community/events")
5+
})
56

7+
test("Zurich meetup link works", async ({ page }) => {
68
const mapCanvas = page.locator("canvas").first()
79
await expect(mapCanvas).toBeVisible({ timeout: 10000 })
810

@@ -15,16 +17,13 @@ test("map loads and Zurich meetup link works", async ({ page }) => {
1517

1618
const mapContainer = page.locator("#meetups-map")
1719
await mapContainer.focus()
18-
await expect(mapContainer.locator("canvas").first()).toHaveScreenshot(
19-
"meetups-map.png",
20-
{ timeout: 10_000 },
21-
)
2220

2321
const pastEventsSection = page.locator("text=Past events & meetups")
2422
await pastEventsSection.scrollIntoViewIfNeeded()
2523

2624
const link = page.getByRole("link", { name: /Zurich/i }).first()
2725
await link.scrollIntoViewIfNeeded()
26+
2827
await link.click()
2928

3029
const pagePromise = page.context().waitForEvent("page")
@@ -35,8 +34,16 @@ test("map loads and Zurich meetup link works", async ({ page }) => {
3534
expect(newPage.url()).toContain("meetup.com/graphql-zurich")
3635
})
3736

37+
test("map matches screenshot", async ({ page }) => {
38+
const mapContainer = page.locator("#meetups-map").first()
39+
await mapContainer.scrollIntoViewIfNeeded()
40+
await expect(mapContainer.locator("canvas").first()).toHaveScreenshot(
41+
"meetups-map.png",
42+
{ timeout: 15_000 },
43+
)
44+
})
45+
3846
test("map tooltip appears on marker hover", async ({ page }) => {
39-
await page.goto("/community/events")
4047
const mapContainer = page.locator("#meetups-map").first()
4148
await mapContainer.scrollIntoViewIfNeeded()
4249
await expect(mapContainer).toBeVisible({ timeout: 10000 })

0 commit comments

Comments
 (0)