Skip to content

[🐛 Bug]: v9: getHTML not backward-compatible #13378

@danielhjacobs

Description

@danielhjacobs

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

v9

Node.js Version

22

Mode

Standalone Mode

Which capabilities are you using?

No response

What happened?

When using .getHTML(false), I got the error message error TS2559: Type 'false' has no properties in common with type 'GetHTMLOptions'.

What is your expected behavior?

According to https://github.com/webdriverio/webdriverio/blob/main/packages/webdriverio/src/commands/element/getHTML.ts#L79-L80, getHTML was meant to retain backwards-compatibility. However, the type definition options: GetHTMLOptions doesn't allow that. The definition should likely instead be options: GetHTMLOptions | boolean.

How to reproduce the bug.

await browser.$("#example").getHTML(false);

Relevant log output

error TS2559: Type 'false' has no properties in common with type 'GetHTMLOptions'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions