Skip to content

[Feature]: support signal in waitFor* APIs #40578

Description

@tmkx

🚀 Feature Request

Many Playwright ⁠waitFor* APIs support a ⁠timeout option, which works well for fixed upper bounds. A complementary capability would be support for ⁠AbortSignal, so callers can cancel an in-flight wait based on external application state.

Example

A consistent API shape could look like this wherever ⁠timeout is already supported:

await locator.waitFor({
  state: 'visible',
  timeout: 30_000,
  signal,
});

await page.waitForURL('**/dashboard', {

Motivation

This would make Playwright waiting APIs easier to compose with:

  • shared cancellation across multiple concurrent operations
  • higher-level test orchestration
  • user-defined deadlines and cascading cancellation
  • integration with standard Web Platform and Node.js cancellation patterns

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions