Skip to content

[Feature] waitFor() with string for selectorOrFunctionOrTimeout - return of JSHandle or ElementHandle #1993

Closed
@thernstig

Description

@thernstig

https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforselectororfunctionortimeout-options-arg says it returns a JSHandle, but in case of the argument selectorOrFunctionOrTimeout being a string, the function is a shortcut for waitForSelector, which returns an ElementHandle.

Is there any way to improve in this area in regards to docs/code completion (such as VS Code IntelliSense)? Or is waitFor actually always returning a JSHandle even though selectorOrFunctionOrTimeout is a string?

If it always returns a JSHandle, is it recommended to actually use waitForSelector instead?

(Maybe the function should be removed completely and a new waitForTimeout would be better?)

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