Skip to content

Commit

Permalink
Rename InstallAppCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed Furkan Boran authored and bartekpacia committed Aug 29, 2024
1 parent 396aafb commit f0965b2
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 @@ -951,7 +951,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 @@ -67,7 +67,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 @@ -110,7 +110,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 @@ -153,7 +153,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 @@ -286,7 +286,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 @@ -295,7 +295,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 @@ -246,7 +246,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 f0965b2

Please sign in to comment.