Skip to content

Commit

Permalink
Rename InstallAppCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed Furkan Boran committed Aug 20, 2024
1 parent 3519519 commit 4d1155c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ data class ToggleAirplaneModeCommand(
}
}

data class InstallApplicationCommand(
data class InstallAppCommand(
val path: String? = null,
val label: String? = null,
): Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ data class MaestroCommand(
val addMediaCommand: AddMediaCommand? = null,
val setAirplaneModeCommand: SetAirplaneModeCommand? = null,
val toggleAirplaneModeCommand: ToggleAirplaneModeCommand? = null,
val installApplicationCommand: InstallApplicationCommand? = null,
val installAppCommand: InstallAppCommand? = null,
) {

constructor(command: Command) : this(
Expand Down Expand Up @@ -106,7 +106,7 @@ data class MaestroCommand(
addMediaCommand = command as? AddMediaCommand,
setAirplaneModeCommand = command as? SetAirplaneModeCommand,
toggleAirplaneModeCommand = command as? ToggleAirplaneModeCommand,
installApplicationCommand = command as? InstallApplicationCommand,
installAppCommand = command as? InstallAppCommand,
)

fun asCommand(): Command? = when {
Expand Down Expand Up @@ -147,7 +147,7 @@ data class MaestroCommand(
addMediaCommand != null -> addMediaCommand
setAirplaneModeCommand != null -> setAirplaneModeCommand
toggleAirplaneModeCommand != null -> toggleAirplaneModeCommand
installApplicationCommand != null -> installApplicationCommand
installAppCommand != null -> installAppCommand
else -> null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class Orchestra(
is AddMediaCommand -> addMediaCommand(command.mediaPaths)
is SetAirplaneModeCommand -> setAirplaneMode(command)
is ToggleAirplaneModeCommand -> toggleAirplaneMode()
is InstallApplicationCommand -> installApp(command)
is InstallAppCommand -> installApp(command)
else -> true
}.also { mutating ->
if (mutating) {
Expand All @@ -290,7 +290,7 @@ class Orchestra(
}
}

private fun installApp(command: InstallApplicationCommand): Boolean {
private fun installApp(command: InstallAppCommand): Boolean {
maestro.installApp(command.path)

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ data class YamlFluentCommand(
toggleAirplaneMode != null -> listOf(MaestroCommand(ToggleAirplaneModeCommand(toggleAirplaneMode.label)))
installApp != null -> listOf(
MaestroCommand(
InstallApplicationCommand(
InstallAppCommand(
path = installApp.path,
label = installApp.label
)
Expand Down
3 changes: 2 additions & 1 deletion maestro-test/src/test/resources/116_install_app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
appId: com.example.app
---
- installApp: "maestro-client/src/main/resources/maestro-app.apk"
- installApp:
"maestro-client/src/main/resources/maestro-app.apk"

0 comments on commit 4d1155c

Please sign in to comment.