<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz" -->

---
title: Playwright page.goto Slow? Fix Navigation Time in CI
description: Playwright's page.goto() defaults to waiting for the load event, which only fires once stylesheets, scripts, iframes and images have all loaded. The fix is to...
canonical: https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Playwright page.goto Slow? Fix Navigation Time in CI | daily.dev
og:description: Playwright's page.goto() defaults to waiting for the load event, which only fires once stylesheets, scripts, iframes and images have all loaded. The fix is to...
og:url: https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz
og:image: https://api.daily.dev/og/posts/DT5u5eZLz.png
og:image:alt: Playwright page.goto Slow? Fix Navigation Time in CI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Playwright page.goto Slow? Fix Navigation Time in CI

**[Currents](https://daily.dev/sources/currents)** · 16 min read · 0 upvotes · 0 comments

## Summary

Playwright's page.goto() defaults to waiting for the load event, which only fires once stylesheets, scripts, iframes and images have all loaded. The fix is to time every goto with a custom fixture, fix the slowest pages first, and only keep changes that measurably help. Recommended steps: use domcontentloaded as the suite default, point webServer at a production build in CI instead of a dev server, save authenticated state instead of logging in per test, and route-block third-party hosts in a shared fixture. The test timeout, 30 seconds by default, is what a stuck navigation actually hits, since goto's own timeout defaults to 0 (no timeout).

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci>

## Questions this post answers

### Why is my Playwright page.goto() call slow only when running in CI?

It's often because CI starts a dev server that compiles each route the first time it's requested, so the first test visiting a route waits for that compile inside its own test timeout (30 seconds by default). Point the webServer option at a production build in CI instead, and keep the dev server for local runs.

_Chasing flaky CI timeouts in Playwright suites is easier with fixes like these surfaced on daily.dev._

### Which waitUntil option should I use for page.goto() in Playwright tests?

Use domcontentloaded as the suite default, since it fires once the HTML is parsed without waiting for images, subframes, or async scripts. Use commit only when a readiness check follows it, and reserve load for tests that specifically need to verify subresources like a third-party widget actually load. Avoid networkidle, which the Playwright docs mark as discouraged for testing.

_Developers tuning Playwright suite defaults can find practical comparisons like this on daily.dev._

### Does Playwright's page.goto() throw an error on a 404 or 500 response?

No, page.goto() does not throw when the server returns any valid HTTP status code, including 404 and 500. This means a test can proceed past a broken navigation and fail later at an unrelated locator, so it's important to assert on page content right after goto to catch server errors at the line that navigated.

_Debugging misleading Playwright test failures gets easier when gotchas like this surface on daily.dev._

## Similar posts on daily.dev

- [Playwright waitForResponse: Fix Network Race Flakes in CI](https://daily.dev/posts/playwright-waitforresponse-fix-network-race-flakes-in-ci-xazxikkf1) · Currents · 0 upvotes · 0 comments
- [Mastering waits and timeouts in Playwright](https://daily.dev/posts/mastering-waits-and-timeouts-in-playwright-a1pw100gb) · CircleCI · 0 upvotes · 0 comments
- [Better world by better software](https://daily.dev/posts/better-world-by-better-software-h1ajuzlat) · Gleb Bahmutov · 0 upvotes · 0 comments
- [Improving navigation experience in v0 with Next.js 16.4](https://daily.dev/posts/improving-navigation-experience-in-v0-with-next-js-16-4-xatsmhtug) · Next.js · 9 upvotes · 1 comments
- [Waiting for Complex Page With JavaScript to Load in Selenium WebDriver](https://daily.dev/posts/waiting-for-complex-page-with-javascript-to-load-in-selenium-webdriver-85ppkr89n) · Baeldung · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd)

[View this post on daily.dev](https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Playwright page.goto Slow? Fix Navigation Time in CI","url":"https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz"},"datePublished":"2026-10-30T16:05:52.805Z","dateModified":"2026-10-30T16:06:55.817Z","description":"Playwright's page.goto() defaults to waiting for the load event, which only fires once stylesheets, scripts, iframes and images have all loaded. The fix is to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab5dfe582793f2ff30b53a92e3cbf6f3?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ab5dfe582793f2ff30b53a92e3cbf6f3?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Currents","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Currents","logo":"https://media.daily.dev/image/upload/s--RxsiMZ1S--/f_auto,q_auto/v1788684994/logos/currents?_a=BAMAMicg0","url":"https://daily.dev/sources/currents"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,testing,cicd","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Currents","item":"https://daily.dev/sources/currents"},{"@type":"ListItem","position":3,"name":"Playwright page.goto Slow? Fix Navigation Time in CI"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/playwright-page-goto-slow-fix-navigation-time-in-ci-dt5u5ezlz#faq","mainEntity":[{"@type":"Question","name":"Why is my Playwright page.goto() call slow only when running in CI?","acceptedAnswer":{"@type":"Answer","text":"It's often because CI starts a dev server that compiles each route the first time it's requested, so the first test visiting a route waits for that compile inside its own test timeout (30 seconds by default). Point the webServer option at a production build in CI instead, and keep the dev server for local runs. Chasing flaky CI timeouts in Playwright suites is easier with fixes like these surfaced on daily.dev."}},{"@type":"Question","name":"Which waitUntil option should I use for page.goto() in Playwright tests?","acceptedAnswer":{"@type":"Answer","text":"Use domcontentloaded as the suite default, since it fires once the HTML is parsed without waiting for images, subframes, or async scripts. Use commit only when a readiness check follows it, and reserve load for tests that specifically need to verify subresources like a third-party widget actually load. Avoid networkidle, which the Playwright docs mark as discouraged for testing. Developers tuning Playwright suite defaults can find practical comparisons like this on daily.dev."}},{"@type":"Question","name":"Does Playwright's page.goto() throw an error on a 404 or 500 response?","acceptedAnswer":{"@type":"Answer","text":"No, page.goto() does not throw when the server returns any valid HTTP status code, including 404 and 500. This means a test can proceed past a broken navigation and fail later at an unrelated locator, so it's important to assert on page content right after goto to catch server errors at the line that navigated. Debugging misleading Playwright test failures gets easier when gotchas like this surface on daily.dev."}}]}
```

