Skip to content

[🐛 Bug]: Running wdio repl using named multiremote capabilities doesn't work #14845

@zhirzh

Description

@zhirzh

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.20.0

Node.js Version

24.11.0

Mode

Standalone Mode

Which capabilities are you using?

{
  browserName: "chrome"
}

What happened?

Running wdio repl with multiremote capability object (as shown in repl examples) doesn't work

// wdio.conf.ts
export const config: WebdriverIO.MultiremoteConfig = {
  ...
  capabilities: {
    foobar: {
      capabilities: {
        platformName: "Android",
        "appium:automationName": "UiAutomator2"
      }
    }
  }
};
$ yarn wdio repl wdio.conf.ts foobar

...
Error: No capability found in given config file with the provided capability indexed/named property: foobar. Please check the capability in your wdio config file.

One way to get it working is to flatten the nested capabilities object ...

 export const config: WebdriverIO.MultiremoteConfig = {
   ...
   capabilities: {
     foobar: {
-      capabilities: {
         platformName: "Android",
         "appium:automationName": "UiAutomator2"
-      }
     }
   }
 };

... but doing so breaks the config object for other wdio commands

$ yarn wdio repl wdio.conf.ts foobar

...
The execution has stopped!
You can now go into the browser or use the command line as REPL
(To exit, press ^C again or type .exit)
> 

What is your expected behavior?

No response

How to reproduce the bug.

https://github.com/zhirzh/demo-wdio-repl-bug

Relevant log output

$ yarn wdio repl wdio.conf.ts foobar
yarn run v1.22.22
warning package.json: No license field
$ /Users/demo/Desktop/demo-wdio-repl-bug/node_modules/.bin/wdio repl wdio.conf.ts foobar
wdio repl <option> [capabilities]

...

Error: No capability found in given config file with the provided capability indexed/named property: foobar. Please check the capability in your wdio config file.
    at getCapabilities (file:///Users/demo/Desktop/demo-wdio-repl-bug/node_modules/@wdio/cli/build/index.js:430:13)
    at async Object.handler2 [as handler] (file:///Users/demo/Desktop/demo-wdio-repl-bug/node_modules/@wdio/cli/build/index.js:1617:16)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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