Skip to content

Commit be4272c

Browse files
Issue 983 for main (#997)
* issue_983_pc * Update .changeset/upset-areas-wear.md --------- Co-authored-by: Wim Selles <wim@wswebcreation.nl>
1 parent 3dbfa0e commit be4272c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.changeset/upset-areas-wear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@wdio/visual-service": patch
3+
---
4+
5+
fix: [983](#983 ) in multiremote, commands are now executed on the requested instances

packages/visual-service/src/service.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ export default class WdioImageComparisonService extends BaseClass {
140140
const browser = this.#browser as WebdriverIO.MultiRemoteBrowser
141141
const browserNames = Object.keys(capabilities)
142142

143+
/**
144+
* Add all the commands to the global browser object that will execute
145+
* on each browser in the Multi Remote
146+
* Start with the page commands
147+
*/
148+
for (const [commandName, command] of Object.entries(pageCommands)) {
149+
this.#addMultiremoteCommand(browser, browserNames, commandName as keyof CommandMap, command)
150+
}
151+
143152
/**
144153
* Add all the commands to each browser in the Multi Remote
145154
*/
@@ -154,15 +163,6 @@ export default class WdioImageComparisonService extends BaseClass {
154163
await this.#addCommandsToBrowser(browserInstance)
155164
}
156165

157-
/**
158-
* Add all the commands to the global browser object that will execute
159-
* on each browser in the Multi Remote
160-
* Start with the page commands
161-
*/
162-
for (const [commandName, command] of Object.entries(pageCommands)) {
163-
this.#addMultiremoteCommand(browser, browserNames, commandName as keyof CommandMap, command)
164-
}
165-
166166
/**
167167
* Add all the element commands to the global browser object that will execute
168168
* on each browser in the Multi Remote

0 commit comments

Comments
 (0)