Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/upset-areas-wear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wdio/visual-service": patch
---

fix: in multiremote, commands are now executed on the requested instances
18 changes: 9 additions & 9 deletions packages/visual-service/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ export default class WdioImageComparisonService extends BaseClass {
const browser = this.#browser as WebdriverIO.MultiRemoteBrowser
const browserNames = Object.keys(capabilities)

/**
* Add all the commands to the global browser object that will execute
* on each browser in the Multi Remote
* Start with the page commands
*/
for (const [commandName, command] of Object.entries(pageCommands)) {
this.#addMultiremoteCommand(browser, browserNames, commandName as keyof CommandMap, command)
}

/**
* Add all the commands to each browser in the Multi Remote
*/
Expand All @@ -154,15 +163,6 @@ export default class WdioImageComparisonService extends BaseClass {
await this.#addCommandsToBrowser(browserInstance)
}

/**
* Add all the commands to the global browser object that will execute
* on each browser in the Multi Remote
* Start with the page commands
*/
for (const [commandName, command] of Object.entries(pageCommands)) {
this.#addMultiremoteCommand(browser, browserNames, commandName as keyof CommandMap, command)
}

/**
* Add all the element commands to the global browser object that will execute
* on each browser in the Multi Remote
Expand Down