From d37337e1fe95f2614763548b170a57faa2c258d5 Mon Sep 17 00:00:00 2001
From: P-Courteille
Date: Tue, 22 Jul 2025 18:41:28 +0200
Subject: [PATCH 1/2] issue_983_pc
---
.changeset/upset-areas-wear.md | 5 +++++
packages/visual-service/src/service.ts | 18 +++++++++---------
2 files changed, 14 insertions(+), 9 deletions(-)
create mode 100644 .changeset/upset-areas-wear.md
diff --git a/.changeset/upset-areas-wear.md b/.changeset/upset-areas-wear.md
new file mode 100644
index 00000000..a5bd7bb7
--- /dev/null
+++ b/.changeset/upset-areas-wear.md
@@ -0,0 +1,5 @@
+---
+"@wdio/visual-service": patch
+---
+
+fix: in multiremote, commands are now executed on the requested instances
diff --git a/packages/visual-service/src/service.ts b/packages/visual-service/src/service.ts
index 77a75c7a..2759794e 100644
--- a/packages/visual-service/src/service.ts
+++ b/packages/visual-service/src/service.ts
@@ -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
*/
@@ -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
From 837604aef06de097069d4d7723b75733288b9964 Mon Sep 17 00:00:00 2001
From: Wim Selles
Date: Wed, 23 Jul 2025 06:06:22 +0200
Subject: [PATCH 2/2] Update .changeset/upset-areas-wear.md
---
.changeset/upset-areas-wear.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.changeset/upset-areas-wear.md b/.changeset/upset-areas-wear.md
index a5bd7bb7..40f6e8c8 100644
--- a/.changeset/upset-areas-wear.md
+++ b/.changeset/upset-areas-wear.md
@@ -2,4 +2,4 @@
"@wdio/visual-service": patch
---
-fix: in multiremote, commands are now executed on the requested instances
+fix: [983](#983 ) in multiremote, commands are now executed on the requested instances