Skip to content

Commit

Permalink
Fix orchestra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tokou committed Aug 24, 2024
1 parent 335c39d commit 33d2a54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ data class YamlConfig(
val env: Map<String, String> = emptyMap(),
val onFlowStart: YamlOnFlowStart?,
val onFlowComplete: YamlOnFlowComplete?,
private val ext: MutableMap<String, Any?> = mutableMapOf<String, Any?>()
) {

private val ext = mutableMapOf<String, Any?>()

@JsonAnySetter
fun setOtherField(key: String, other: Any?) {
ext[key] = other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import maestro.orchestra.ClearStateCommand
import maestro.orchestra.Command
import maestro.orchestra.Condition
import maestro.orchestra.CopyTextFromCommand
import maestro.orchestra.DefineVariablesCommand
import maestro.orchestra.ElementSelector
import maestro.orchestra.EraseTextCommand
import maestro.orchestra.EvalScriptCommand
Expand Down Expand Up @@ -76,6 +77,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app"
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "002_launchApp")),
LaunchAppCommand(
appId = "com.example.app"
),
Expand All @@ -90,6 +92,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app",
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "003_launchApp_withClearState")),
LaunchAppCommand(
appId = "com.example.app",
clearState = true,
Expand Down Expand Up @@ -133,6 +136,7 @@ internal class YamlCommandReaderTest {
"extraArray" to listOf("itemA")
)
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "008_config_unknownKeys")),
LaunchAppCommand(
appId = "com.example.app",
),
Expand Down Expand Up @@ -175,6 +179,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app",
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "017_launchApp_otherPackage")),
LaunchAppCommand(
appId = "com.other.app"
),
Expand All @@ -189,6 +194,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app",
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "018_backPress_string")),
BackPressCommand(),
)
}
Expand All @@ -201,6 +207,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app",
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "019_scroll_string")),
ScrollCommand(),
)
}
Expand All @@ -214,6 +221,7 @@ internal class YamlCommandReaderTest {
appId = "com.example.app",
name = "Example Flow"
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "020_config_name")),
LaunchAppCommand(
appId = "com.example.app"
),
Expand All @@ -237,6 +245,7 @@ internal class YamlCommandReaderTest {
appId = "com.example.app"
)
),
DefineVariablesCommand(env = mapOf("FILENAME" to "flow")),
LaunchAppCommand(
appId = "com.example.app"
)
Expand Down Expand Up @@ -270,6 +279,7 @@ internal class YamlCommandReaderTest {
)
)
),
DefineVariablesCommand(env = mapOf("FILENAME" to "022_on_flow_start_complete")),
LaunchAppCommand(
appId = "com.example.app"
)
Expand All @@ -286,6 +296,7 @@ internal class YamlCommandReaderTest {
appId="com.example.app"
)
),
DefineVariablesCommand(env = mapOf("FILENAME" to "023_labels")),

// Taps
TapOnElementCommand(
Expand Down Expand Up @@ -520,6 +531,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(
config= MaestroConfig(appId= "com.example.app")
),
DefineVariablesCommand(env = mapOf("FILENAME" to "024_string_non_string_commands")),
InputTextCommand(text = "correct horse battery staple"),
InputTextCommand(text = "correct horse battery staple"),
InputTextCommand(text = "4"),
Expand Down Expand Up @@ -596,6 +608,7 @@ internal class YamlCommandReaderTest {
ApplyConfigurationCommand(MaestroConfig(
appId = "com.example.app"
)),
DefineVariablesCommand(env = mapOf("FILENAME" to "025_killApp")),
KillAppCommand(
appId = "com.example.app"
),
Expand Down

0 comments on commit 33d2a54

Please sign in to comment.