Skip to content

Commit 134a1cd

Browse files
authored
Fix iOS url arguments (#1159)
1 parent 1c5601e commit 134a1cd

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

maestro-ios-driver/src/main/kotlin/util/IOSLaunchArguments.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ object IOSLaunchArguments {
1717
}
1818
}
1919
}
20-
val iOSLaunchArguments = mutableListOf<String>()
21-
iOSLaunchArgumentsMap.toList().map { "${it.first}:${it.second}" }
22-
.forEach {
23-
iOSLaunchArguments += it.split(":")
24-
}
25-
26-
return iOSLaunchArguments
20+
return iOSLaunchArgumentsMap.toList().flatMap { listOf(it.first, it.second.toString()) }
2721
}
2822
}

maestro-ios-driver/src/test/kotlin/IOSLaunchArgumentsTest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,20 @@ class IOSLaunchArgumentsTest {
4848
listOf("isCartScreen", "false", "-cartValue", "3", "-cartColor", "Orange")
4949
)
5050
}
51+
52+
@Test
53+
fun `url arguments are passed correctly`() {
54+
// given
55+
val launchArguments = mapOf<String, Any>(
56+
"-url" to "http://example.com"
57+
)
58+
59+
// when
60+
val iOSLaunchArguments = launchArguments.toIOSLaunchArguments()
61+
62+
// then
63+
assertThat(iOSLaunchArguments).isEqualTo(
64+
listOf("-url", "http://example.com")
65+
)
66+
}
5167
}

0 commit comments

Comments
 (0)