From 2b872954305710ea4042144fc492af9e21813dfd Mon Sep 17 00:00:00 2001 From: Jonas Kronborg Date: Thu, 23 Jan 2025 17:08:40 +0100 Subject: [PATCH] Fix web support for workspaces --- .../src/main/java/maestro/cli/command/TestCommand.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/maestro-cli/src/main/java/maestro/cli/command/TestCommand.kt b/maestro-cli/src/main/java/maestro/cli/command/TestCommand.kt index 58dfcb23ea..91931941dd 100644 --- a/maestro-cli/src/main/java/maestro/cli/command/TestCommand.kt +++ b/maestro-cli/src/main/java/maestro/cli/command/TestCommand.kt @@ -164,12 +164,8 @@ class TestCommand : Callable { private val usedPorts = ConcurrentHashMap() private val logger = LoggerFactory.getLogger(TestCommand::class.java) - private fun isWebFlow(): Boolean { - if (flowFiles.isSingleFile) { - return flowFiles.first().isWebFlow() - } - - return false + private fun includesWebFlow(): Boolean { + return flowFiles.any { it.isWebFlow() } } override fun call(): Int { @@ -218,7 +214,7 @@ class TestCommand : Callable { val onlySequenceFlows = plan.sequence.flows.isNotEmpty() && plan.flowsToRun.isEmpty() // An edge case val availableDevices = DeviceService.listConnectedDevices( - includeWeb = isWebFlow(), + includeWeb = includesWebFlow(), host = parent?.host, port = parent?.port, ).map { it.instanceId }.toSet() @@ -427,7 +423,7 @@ class TestCommand : Callable { } private fun getPassedOptionsDeviceIds(): List { - val arguments = if (isWebFlow()) { + val arguments = if (includesWebFlow()) { PrintUtils.warn("Web support is in Beta. We would appreciate your feedback!\n") "chromium" } else parent?.deviceId