# Playwright Test Timeout: Defaults and Config

> Playwright test timeout explained: the 30 s test and 5 s expect defaults, the "Test timeout of 30000ms exceeded" error reproduced, and the setting for each.

[Home](https://quanticdata.io/) / [Blog](https://quanticdata.io/blog/) / Playwright Test Timeout: Defaults and Config

# Playwright test timeout: every default, each error reproduced and fixed

Guides · Nov 20, 2026 · 9 min read · By [Aldo Morese](https://quanticdata.io/about/), founder of QuanticData

![The timeouts of Playwright Test as measured on 20 November 2026: 30 s by default for a test, 60 s after test.setTimeout, 90 s after test.slow and 5 s for an expect assertion; the code window shows the config file that sets them, and the card lists which setting controls which limit.](https://quanticdata.io/blog/playwright-test-timeout/hero.webp?v=20261120h)

On this page

- [The four Playwright timeouts](https://quanticdata.io/blog/playwright-test-timeout/#the-four-playwright-timeouts)
- [The test setup](https://quanticdata.io/blog/playwright-test-timeout/#the-test-setup)
- [Each timeout error, reproduced](https://quanticdata.io/blog/playwright-test-timeout/#each-timeout-error-reproduced)
- [Each one fixed](https://quanticdata.io/blog/playwright-test-timeout/#each-one-fixed)
- [Set the timeouts in playwright.config](https://quanticdata.io/blog/playwright-test-timeout/#set-the-timeouts-in-playwright-config)
- [A real site through a proxy, with every timeout set](https://quanticdata.io/blog/playwright-test-timeout/#a-real-site-through-a-proxy-with-every-timeout-set)
- [Increase the timeout, or fix the wait?](https://quanticdata.io/blog/playwright-test-timeout/#increase-the-timeout-or-fix-the-wait)
- [Timeouts and the network you test from](https://quanticdata.io/blog/playwright-test-timeout/#timeouts-and-the-network-you-test-from)

Playwright Test gives every test 30 seconds and every `expect` assertion 5 seconds by default. Change the first with `timeout` in `playwright.config` or `test.setTimeout()` in a test, and the second with `expect: { timeout }`. Actions and navigations have separate, optional limits: `actionTimeout` and `navigationTimeout`.

**Run it on the free credit.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-lead&utm_content=playwright-test-timeout) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

The error message tells you which of the four fired, and the fix is different for each. We reproduced all four on 20 November 2026 with @playwright/test 1.61.1 against a small local server that answers late on purpose, then fixed each one. The specs and the runner's output are below.

## The four Playwright timeouts

| Timeout | Default | Set for all tests | Set in one place | Error text |
| --- | --- | --- | --- | --- |
| Test | 30 s | `timeout: 60_000` | `test.setTimeout(60_000)`, `test.slow()` | Test timeout of 30000ms exceeded. |
| Expect | 5 s | `expect: { timeout: 10_000 }` | `expect(x).toHaveText(t, { timeout: 10_000 })` | expect(locator).toHaveText(expected) failed ... Timeout: 5000ms |
| Action | None of its own | `use: { actionTimeout: 10_000 }` | `locator.click({ timeout: 2000 })` | TimeoutError: locator.click: Timeout 2000ms exceeded. |
| Navigation | None of its own | `use: { navigationTimeout: 45_000 }` | `page.goto(url, { timeout: 3000 })` | TimeoutError: page.goto: Timeout 3000ms exceeded. |

"None of its own" follows the Playwright documentation: an action or a navigation without a limit simply runs until the test timeout stops the whole test, which is the first error in the table.

## The test setup

A server that can be slow in three ways: a page that answers after a chosen delay, a page that adds its content late with JavaScript, and a button that stays disabled.

```javascript
// server.js
const http = require('node:http');
http.createServer((req, res) => {
  const u = new URL(req.url, 'http://localhost');
  const ms = Number(u.searchParams.get('ms') || 0);
  const html = (body) => { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end('<!doctype html><title>t</title>' + body); };
  if (u.pathname === '/slow') return setTimeout(() => html('<h1>Slow page</h1>'), ms);
  if (u.pathname === '/late') return html('<h1>Report</h1><script>setTimeout(() => { document.body.insertAdjacentHTML("beforeend", "<p id=total>Total: 42</p>"); }, ' + ms + ')</script>');
  if (u.pathname === '/disabled') return html('<button id=buy disabled>Buy</button>');
  html('<h1>ok</h1>');
}).listen(4173);
```

```javascript
// playwright.config.js
const { defineConfig } = require('@playwright/test');
module.exports = defineConfig({
  testDir: './tests',
  workers: 1,
  reporter: 'list',
  webServer: { command: 'node server.js', port: 4173, reuseExistingServer: true },
  use: { baseURL: 'http://localhost:4173' },
});
```

## Each timeout error, reproduced

```javascript
const { test, expect } = require('@playwright/test');

test('1 default test timeout: page answers after 40 s', async ({ page }, testInfo) => {
  console.log('testInfo.timeout =', testInfo.timeout);
  await page.goto('/slow?ms=40000');
});

test('2 default expect timeout: text appears after 7 s', async ({ page }) => {
  await page.goto('/late?ms=7000');
  await expect(page.locator('#total')).toHaveText('Total: 42');
});

test('3 action with its own timeout: button stays disabled', async ({ page }) => {
  await page.goto('/disabled');
  await page.locator('#buy').click({ timeout: 2000 });
});

test('4 navigation with its own timeout: page answers after 10 s', async ({ page }) => {
  await page.goto('/slow?ms=10000', { timeout: 3000 });
});
```

The runner's output for each, shortened to the lines that matter (in the listings on this page the runner's tick marks are written as "ok"):

```
testInfo.timeout = 30000

1) 1 default test timeout: page answers after 40 s
    Test timeout of 30000ms exceeded.
    Error: page.goto: net::ERR_ABORTED; maybe frame was detached?
      - navigating to "http://localhost:4173/slow?ms=40000", waiting until "load"

2) 2 default expect timeout: text appears after 7 s
    Error: expect(locator).toHaveText(expected) failed
    Locator: locator('#total')
    Expected: "Total: 42"
    Timeout: 5000ms
    Error: element(s) not found

3) 3 action with its own timeout: button stays disabled
    TimeoutError: locator.click: Timeout 2000ms exceeded.
      - locator resolved to <button id="buy" disabled>Buy</button>
      - attempting click action
        2 x waiting for element to be visible, enabled and stable
          - element is not enabled

4) 4 navigation with its own timeout: page answers after 10 s
    TimeoutError: page.goto: Timeout 3000ms exceeded.
      - navigating to "http://localhost:4173/slow?ms=10000", waiting until "load"
```

How to read them:

- **"Test timeout of 30000ms exceeded."** is the test limit. Whatever line was running when the 30 seconds ended is reported under it, here the `goto`, with the confusing extra "net::ERR_ABORTED": that is Playwright closing the page, not a network fault.
- **"Timeout: 5000ms"** inside an `expect` block is the assertion limit. The test had 25 seconds left; the assertion had used its own 5.
- **"TimeoutError: locator.click: Timeout 2000ms exceeded."** names the action and the limit we gave it. The call log underneath is the useful part: the button was found and was "not enabled". The element exists; it was never clickable.
- **"TimeoutError: page.goto: Timeout 3000ms exceeded."** names the navigation and says what it was waiting for: the "load" event.

## Each one fixed

```
test('1 test.setTimeout(60_000): page answers after 40 s', async ({ page }, testInfo) => {
  test.setTimeout(60_000);
  console.log('testInfo.timeout =', testInfo.timeout);
  await page.goto('/slow?ms=40000');
  await expect(page.locator('h1')).toHaveText('Slow page');
});

test('2 test.slow(): three times the timeout', async ({ page }, testInfo) => {
  test.slow();
  console.log('testInfo.timeout =', testInfo.timeout);
  await page.goto('/slow?ms=40000');
});

test('3 expect with timeout 10 s: text appears after 7 s', async ({ page }) => {
  await page.goto('/late?ms=7000');
  await expect(page.locator('#total')).toHaveText('Total: 42', { timeout: 10_000 });
});

test.describe('group with its own timeout', () => {
  test.describe.configure({ timeout: 45_000 });
  test('4 describe.configure({ timeout: 45_000 })', async ({ page }, testInfo) => {
    console.log('testInfo.timeout =', testInfo.timeout);
    await page.goto('/slow?ms=1000');
  });
});

test('5 test.setTimeout(0): no limit', async ({ page }, testInfo) => {
  test.setTimeout(0);
  console.log('testInfo.timeout =', testInfo.timeout);
  await page.goto('/slow?ms=1000');
});
```

```
Running 5 tests using 1 worker

testInfo.timeout = 60000
  ok  1 test.setTimeout(60_000): page answers after 40 s (40.1s)
testInfo.timeout = 90000
  ok  2 test.slow(): three times the timeout (40.1s)
  ok  3 expect with timeout 10 s: text appears after 7 s (7.5s)
testInfo.timeout = 45000
  ok  4 group with its own timeout, describe.configure({ timeout: 45_000 }) (1.3s)
testInfo.timeout = 0
  ok  5 test.setTimeout(0): no limit (1.1s)

  5 passed (1.5m)
```

| Setting | testInfo.timeout it produced | Use it when |
| --- | --- | --- |
| Nothing | 30000 | Most tests |
| `test.setTimeout(60_000)` | 60000 | One test is known to need longer |
| `test.slow()` | 90000, that is 90 s, three times the default | The same, without choosing a number |
| `test.describe.configure({ timeout: 45_000 })` | 45000 | A group of tests shares a slow dependency |
| `test.setTimeout(0)` | 0, meaning no limit | Debugging by hand; not in CI, where a stuck test would hang the job |

The 40-second page passed with a 60-second limit and with `test.slow()`; the text that appears after 7 seconds passed once its assertion was allowed 10. The failing button from the first run has no timeout fix: the button is disabled, and the right change is in the test (enable it first) or in the application.

**Try it on your own targets.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-inline&utm_content=playwright-test-timeout) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## Set the timeouts in playwright.config

Defaults for the whole project go in the config file. This is the one we used for the proxy run in the next section:

```javascript
const { defineConfig } = require('@playwright/test');
const u = new URL(process.env.PROXY_URL);    // http://USER:PASS@HOST:PORT of your proxy line
module.exports = defineConfig({
  testDir: './proxy-tests',
  workers: 1,
  reporter: 'list',
  timeout: 60_000,                 // each test
  expect: { timeout: 10_000 },     // each assertion
  use: {
    proxy: { server: u.protocol + '//' + u.host,
             username: decodeURIComponent(u.username), password: decodeURIComponent(u.password) },
    navigationTimeout: 45_000,     // goto, reload, waitForURL
    actionTimeout: 10_000,         // click, fill, check ...
  },
});
```

Keep the order sensible: an action or navigation limit longer than the test limit can never fire, because the test ends first. A useful shape is assertion and action limits of a few seconds, a navigation limit below the test limit, and a test limit that covers the whole flow. There is also `globalTimeout` for the entire run, which is worth setting in CI so that a broken environment ends the job instead of occupying a runner.

## A real site through a proxy, with every timeout set

With that config, a test that opens a public practice shop through one residential proxy line in the United States, checks the 20 products of page one, clicks "next" and checks page two:

```javascript
const { test, expect } = require('@playwright/test');

test('books.toscrape.com through the proxy, with every timeout set', async ({ page }, testInfo) => {
  console.log('test timeout =', testInfo.timeout);
  await page.goto('https://books.toscrape.com/', { waitUntil: 'domcontentloaded' });
  await expect(page.locator('article.product_pod')).toHaveCount(20);
  await page.getByRole('link', { name: 'next' }).click();
  await expect(page).toHaveURL(/page-2/);
  await expect(page.locator('article.product_pod')).toHaveCount(20);
  console.log('title =', await page.title());
});
```

```
Running 2 tests using 1 worker

test timeout = 60000
title = All products | Books to Scrape - Sandbox
  ok  1 books.toscrape.com through the proxy, with every timeout set
exit = x.x.x.x
  ok  2 exit IP check

  2 passed
```

Both tests passed, well inside the limits of 45 and 60 seconds. The second test printed the exit address (masked here) to confirm the browser was going out through the proxy. The `proxy` block of the config is explained in [Playwright proxy setup](https://quanticdata.io/blog/playwright-proxy/).

Two choices in that test do more for reliability than any number. `waitUntil: 'domcontentloaded'` stops `goto` from waiting for every image and tracker; the options are compared in [waiting for a page to load in Playwright](https://quanticdata.io/blog/playwright-wait-for-page-load/). And the checks are web-first assertions (`toHaveCount`, `toHaveURL`), which retry until they pass or their timeout ends, so there is no fixed `waitForTimeout` sleep anywhere.

## Increase the timeout, or fix the wait?

- **Raise the limit** when the work is legitimately long: a report that takes 40 seconds to build, a multi-page flow, a first load in a cold environment.
- **Fix the wait** when the limit fired on something that would never happen: a selector that matches nothing, a button that stays disabled, a "load" event held back by a third-party script. The call log under the error says which.
- **Do not paper over it** with `setTimeout(0)` or a long sleep. A test that can wait forever hides the failure you wrote it to catch.

The same reasoning applies to plain HTTP clients, where the limits are connect and total time: see [curl timeouts](https://quanticdata.io/blog/curl-timeout/) and [retries and timeouts in Python Requests](https://quanticdata.io/blog/python-requests-retry/). When Playwright is used to collect pages instead of testing them, the timeouts are the same options on the same calls, as in [scraping dynamic pages](https://quanticdata.io/blog/dynamic-web-scraping-python/) and [Playwright screenshots](https://quanticdata.io/blog/playwright-screenshot/).

## Timeouts and the network you test from

A test against a real site in another country depends on that site's response time, so give navigation its own explicit limit instead of leaning on the test timeout, as the config above does. Our [residential proxies](https://quanticdata.io/residential-proxies/) place the browser on home connections in the country you choose and our [mobile proxies](https://quanticdata.io/mobile-proxies/) on carrier connections; both plug into the `proxy` option shown above.

### Sources & further reading

- [Playwright docs: Timeouts](https://playwright.dev/docs/test-timeouts)
- [Playwright docs: TestConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout)
- [Playwright docs: test.setTimeout()](https://playwright.dev/docs/api/class-test#test-set-timeout)
- [Playwright docs: Auto-waiting and actionability](https://playwright.dev/docs/actionability)
- [Playwright docs: TestOptions (actionTimeout, navigationTimeout, proxy)](https://playwright.dev/docs/api/class-testoptions)

## FAQ

Quick answers on playwright test timeout.

[Something else? Ask us](mailto:hello@quanticdata.io)

### What is the default test timeout in Playwright?

30 seconds per test and 5 seconds per `expect` assertion. In our run `testInfo.timeout` printed 30000, and a page that answered after 40 seconds failed with "Test timeout of 30000ms exceeded."

### How do I increase the test timeout in Playwright?

For all tests, set `timeout: 60_000` in `playwright.config`. For one test, call `test.setTimeout(60_000)` or `test.slow()`, which triples it: our run printed 60000 and 90000, and the 40-second page passed both ways.

### What does "Test timeout of 30000ms exceeded" mean?

The whole test, including its hooks and fixtures, ran longer than the test timeout. The line reported under it is only the step that was running when time ran out. Either that step waits for something that never comes, or the test needs a longer limit.

### How do I set the expect timeout in Playwright?

Globally with `expect: { timeout: 10_000 }` in the config, or per assertion with `expect(locator).toHaveText(text, { timeout: 10_000 })`. With 10 seconds, our assertion on text that appears after 7 seconds passed.

### How do I disable the timeout in Playwright?

`test.setTimeout(0)` removes the limit for a test; `testInfo.timeout` printed 0 in our run. Keep it for debugging: in CI a test without a limit can hang the job.

### What is the difference between actionTimeout and navigationTimeout?

`actionTimeout` limits each action such as `click` or `fill`; `navigationTimeout` limits `goto` and other navigations. Neither has a limit of its own by default, so without them a stuck step ends with the test timeout.

### Which timeout should I set when testing through a proxy?

Set an explicit `navigationTimeout` below the test timeout, as in the config above.

## Run your browser tests from the country you need

Residential and mobile proxies that plug into the proxy option of your Playwright config.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-end&utm_content=playwright-test-timeout) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## Related reading

- [Playwright Screenshot: Full Page, Element](https://quanticdata.io/blog/playwright-screenshot/): Guides · page.screenshot({ path }) captures the viewport, fullPage: true the whole page, and locator.screenshot() one element. Below: every option run with Playwright 1.61.1, with the real file sizes (a full page dropped from 625254 bytes as PNG to 170638 as JPEG at quality 50), masking, hiding elements with style, retina and phone captures, and screenshots through residential and mobile proxies.
- [Scraping Dynamic Web Pages in Python](https://quanticdata.io/blog/dynamic-web-scraping-python/): Guides · A dynamic page sends an almost empty HTML shell and fills it with JavaScript, so requests and Beautiful Soup see nothing. Look for the data first (a JSON block in a script tag or an API call), and render with Playwright or Selenium only when there is none. We ran all three on one page.
- [Playwright: Wait for Page to Load in Python](https://quanticdata.io/blog/playwright-wait-for-page-load/): Guides · goto() waits for the load event by default, but the data you want often arrives later. On a page that adds its content after a delay, every wait_until option returned with 0 items; waiting for the element itself returned all 10. The timings, the code and when to use each wait.

---

Source: https://quanticdata.io/blog/playwright-test-timeout/ · Site index for AI: https://quanticdata.io/llms.txt
