Fix Playwright test timeouts on CI by using deterministic load waits#59
Fix Playwright test timeouts on CI by using deterministic load waits#59Copilot wants to merge 5 commits intodeploy-twice-a-dayfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
|
well @copilot |
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
I've replaced
The issue was that |
It seems unlikely that this is the case @copilot. There seems to be something else wrong. |
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
You're absolutely right. I investigated further and found the real issue in commit f989e45: The problem was using I've replaced it with The tests now simply:
This should be much more reliable on CI. |
Description
Playwright tests were passing locally but failing on CI due to timeout issues when running against production builds (
pnpm startvspnpm dev).Root Cause
The tests were using
waitUntil: "networkidle"which waits for NO network activity for 500ms straight. If the page has continuous polling, analytics, third-party scripts, or any periodic network requests,networkidlemay never trigger or take extremely long, causing tests to timeout unpredictably on CI.Changes
test/e2e/community-events.spec.ts
networkidletoloadwaitUntil strategy for deterministic page load waitingscrollIntoViewIfNeeded()calls (not needed - sections are server-rendered)playwright.config.ts
Example
The
loadstrategy is more reliable because it waits for DOMContentLoaded and all resources to finish loading, which is a deterministic event that will always occur, unlikenetworkidlewhich requires complete network silence.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.