Skip to content

[🐛 Bug]: Tauri service clobbers user's command overrides for click etc #422

@gpaciga

Description

@gpaciga

Have you read the Contributing Guidelines?

Which service/package is affected?

Tauri Service (@wdio/tauri-service)

Package Version

v1.1.0

Node.js Version

v24.12.0

Operating System

macOS

What happened?

With CrabNebula driver, I was able to define an override for the click command to enforce a wait:

  before: () => {
    browser.overwriteCommand(
      "click",
      async function (
        this: WebdriverIO.Element,
        origClick: (options?: Partial<ClickOptions> | undefined) => Promise<void>,
        options?: Partial<ClickOptions> & { timeout?: number },
      ) {
        const { timeout, ...clickOpts } = options ?? {};
        await this.waitForClickable({ timeout });
        await origClick(clickOpts);
      },
      true, // element-scoped override
    );
  },

However, with tauri-service, it seems like this override doesn't take effect. It looks like tauri-service calls installCommandOverrides in its before(), but this runs after the user's before hook and undoes any customization.

Expected Behavior

I should be able to add customizations to these commands, so in my override,

        await this.waitForClickable({ timeout });
        await origClick(clickOpts); // this should call the tauri-service version of click

Minimal Reproducible Example

in wdio.conf.js:

  before: () => {
    browser.overwriteCommand(
      "click",
      async function (
        this: WebdriverIO.Element,
        origClick: (options?: Partial<ClickOptions> | undefined) => Promise<void>,
        options?: Partial<ClickOptions> & { timeout?: number },
      ) {
        console.log("User's click override used");
        await origClick(clickOpts);
      },
      true, // element-scoped override
    );
  },

Relevant Log Output

Additional Context

No response

Code of Conduct

Is there an existing issue for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumMedium priority issue or PRscope:tauriTauri service and pluginstype:bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions