Skip to content

[Feature]: locator.evaluateAll to have timeout option #35220

@v-mwalk

Description

@v-mwalk

🚀 Feature Request

Currently, locator.evaluateAll does not have a timeout feature. Other evaluate's (page/locator) have these options, but evaluateAll does not.

Issue #13253 discusses it but not really sure what this issue is requesting now as it is very old (> 3 years) and seems to have a number branches within.

I am using a workaround (wrapping in a promise evaluator with setTimeout), but - as #13253 (comment) points out - it makes the test code quite unreadable.

Example

const attributeValues = await locator.evaluateAll((elements, attribute) => {
return elements.map(el => el.getAttribute(attribute) || '');
}, attributeName, {timeout: 10000});

Motivation

Add consistency in Playwright, so all functions that interact with the browser have a local overriding timeout ability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions