Skip to content

[BUG] waitForSelector and 'waitFor' property incorrect typescript matching #2081

@thernstig

Description

@thernstig

Context:

  • Playwright Version: 0.16.0

Code Snippet

await page.waitForSelector('text="some text"', {
  waitFor: 'attached',
});

Describe the bug

The above only gives code completion for attached and visible (using VS Code). Going to the types.d.ts file it matches waitForSelector(selector: string, options?: WaitForSelectorOptionsNotHidden): Promise<HTMLOrSVGElementHandle>; where WaitForSelectorOptionsNotHidden looks like this:

type WaitForSelectorOptionsNotHidden = PageWaitForSelectorOptions & {
  waitFor: 'visible'|'attached';
}

It should have matched waitForSelector(selector: string, options: PageWaitForSelectorOptions): Promise<null|HTMLOrSVGElementHandle>; to get the proper options from PageWaitForSelectorOptions.

Metadata

Metadata

Assignees

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