Skip to content

[Question] Documentation for page.waitForSelector() and visibility  #1981

@thernstig

Description

@thernstig

Hi!

Been using Playwright (and previously Puppeteer) for some time now, and wanted to ask a question that might turn out to be some documentation updates.

One of the concepts I've seen new users get stuck on is https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforselectorselector-options and the wording of the waitFor:

waitFor <"attached"|"detached"|"visible"|"hidden"> Wait for element to become visible (visible), hidden (hidden), present in dom (attached) or not present in dom (detached). Defaults to attached.

The term visible is what confuses people.

https://github.com/microsoft/playwright/blob/master/docs/core-concepts.md#auto-waiting now explains this pretty good, but also that text mentions nothing about the actual CSS property called visibility that has a value of visible (https://developer.mozilla.org/en-US/docs/Web/CSS/visibility).

Now, is there any way to make this less confusing for users? What they struggle on is to think that visible actual means the CSS property visibility: visible.

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