propagate addCommand to children for multiremote#13904
propagate addCommand to children for multiremote#13904christian-bromann merged 1 commit intowebdriverio:mainfrom
Conversation
eslint-plugin-wdio
@wdio/appium-service
@wdio/browser-runner
@wdio/browserstack-service
@wdio/allure-reporter
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
|
@ccharnkij thanks for contributing to the project. Something I would like to understand better is how attaching the custom command to every instance works exactly. Note that when you register a custom command to a multiremote browser, the instance you operate within the custom command will act as a multiremote browser, e.g.: import { multiremotebrowser } from '@wdio/globals'
multiremotebrowser.addCustomCommand('concatePageTitles', async function (this: WebdriverIO.MultiremoteBrowser) {
const titles = await this.getTitle() // returns string[]
return titles.join(' - ')
})
console.log(await multiremotebrowser.concatePageTitles()) // prints "Page A - Page B - Page CAttaching this custom command to an instance wouldn't make sense because I haven't really explored this use case thoroughly but this is what I expected it to work. Mind providing more context? |
|
Yes, you are correct on that. The |
|
@ccharnkij thanks for clarifying, mind pushing a change to the |
|
better? |
|
Looks like this here is the issue from the latest commits to main in the element.test.ts. const combinedPrototype = [
...new Set([...elementPrototype, ...files])
] |
4b2cb7d to
3a35702
Compare
|
Hey ccharnkij 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
|
@christian-bromann Btw, I saw another issue on implementing the UI. Not sure how helpful I can be, but I'd love to join. |
|
@ccharnkij awesome, please reach out in the contributor channel on Discord. Thanks! |
Proposed changes
For #13836, pass the new command down to the children instances of multiremote browser.
Types of changes
Checklist
Reviewers: @webdriverio/project-committers