Skip to main content

Timeouts

Taqwright has two timeouts you will actually set: the test timeout (how long a whole test may run) and the expect timeout (how long an assertion or a single device action keeps retrying). Both have taqwright defaults that differ from Playwright's web defaults.

TimeoutDefaultHow to set
Test timeout60_000 mstimeout in config, --timeout on the CLI, test.setTimeout(), test.slow()
Expect / action timeout30_000 msexpectTimeout in config, or { timeout } on a single action or assertion

Test timeout

The test timeout is the budget for the entire test, including the test body, its beforeEach hooks, and fixture setup. If it elapses, the test fails as timed out. The default is 60 seconds.

Set it in taqwright.config.ts, at the top level or per project (see Configuration and Projects):

taqwright.config.ts
import { defineConfig, Platform } from '@taqwright/taqwright';

export default defineConfig({
timeout: 60_000,
projects: [
{
name: 'android',
timeout: 90_000, // per-project override
use: {/* ... */},
},
],
});

Override it for a single run on the command line (see Command line):

npx taqwright test --timeout 120000

Or adjust it at runtime:

tests/slow.spec.ts
import { test } from '@taqwright/taqwright';

test('long checkout flow', async ({ mobile }) => {
test.setTimeout(120_000); // absolute, for this test
// ...
});

test('slow on cold emulators', async ({ mobile }) => {
test.slow(); // triples the test timeout
// ...
});

test.beforeEach(async ({ mobile }, testInfo) => {
testInfo.setTimeout(testInfo.timeout + 30_000); // extend from a hook
});

test.slow() (including the conditional test.slow(condition, reason) form) is covered in Annotations. For a whole group, use test.describe.configure({ timeout: 90_000 }).

Assertion and action timeout

A single knob, expectTimeout, bounds both the auto-retrying assertions (assertVisible, toBeVisible, toHaveText, …) and the locator actions (click, fill, tap, …). Taqwright polls every 200 ms until the element is actionable or the condition holds, or this timeout elapses. The default is 30 seconds. This is unlike Playwright on the web, which has separate actionTimeout and expect.timeout values; on a device they are one.

Set the default in config, at the top level or per project:

taqwright.config.ts
export default defineConfig({
expectTimeout: 30_000,
projects: [
{
name: 'android',
use: {
platform: Platform.ANDROID,
device: { provider: 'emulator', name: 'taqwright_api34' },
expectTimeout: 15_000, // per-project override
},
},
],
});

Override it for one action or assertion with a { timeout } option:

tests/checkout.spec.ts
import { test, expect } from '@taqwright/taqwright';

test('place order', async ({ mobile }) => {
// Wait up to 10s for this tap to become actionable.
await mobile.getByLabel('Place order').click({ timeout: 10_000 });

// Give a slow confirmation screen its own budget.
await expect(mobile.getByText('Order confirmed')).toBeVisible({ timeout: 20_000 });

// Assertions take { timeout } too.
await mobile.getByLabel('Status').assertText('Paid', { timeout: 5_000 });
});

See Writing tests for the auto-wait and auto-retrying assertion model these timeouts apply to.

What taqwright does not have

There is no separate actionTimeout or navigationTimeout: the single expectTimeout covers device actions, and there is no page navigation to time on mobile. There is also no globalTimeout (a whole-run cap); bound total runtime with your CI job's own time limit instead.