Skip to content

addCommand to element doesn't work in multiremote mode #3445

@mgrybyk

Description

@mgrybyk

Environment (please complete the following information):

  • WebdriverIO version: 5.4.7
  • Mode: multiremote

Config of WebdriverIO

  capabilities: {
    myChromeBrowser: {
      capabilities: {
        browserName: 'chrome'
      }
    }
  }

Describe the bug
wdio crashes on addCommand to element in multiremote mode

To Reproduce
Steps to reproduce the behavior:

browser.addCommand("optAttribute", function (attributeName: string) {
  console.log("optAttribute")
}, true)

Expected behavior
addCommand(cmd, function, attachToElement) should work in multiremote mode

Log

ERROR wdio-sync: TypeError: Cannot set property 'optAttribute' of undefined
    at MultiRemoteDriver.client.addCommand (e2e/node_modules/webdriver/build/monad.js:98:43)
    at MultiRemoteDriver.driver.addCommand (e2e/node_modules/webdriverio/build/index.js:102:5)
    at Object.<anonymous> (e2e/src/wdio/commands.ts:5:9)

Additional context
there is no propertiesObject in multibrowser.baseInstance in multiremote mode

this.__propertiesObject__[name] = {
  value: customCommand
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions