Skip to content

Commit

Permalink
Suppress expected depdeciation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tokou committed Aug 25, 2024
1 parent ad98834 commit ef2d854
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ data class TapOnPointCommand(
return label ?: "${tapOnDescription(longPress, repeat)} on point ($x, $y)"
}

@Suppress("DEPRECATION")
override fun evaluateScripts(jsEngine: JsEngine): TapOnPointCommand {
return this
}
Expand Down Expand Up @@ -337,6 +338,7 @@ data class AssertCommand(
return "No op"
}

@Suppress("DEPRECATION")
override fun evaluateScripts(jsEngine: JsEngine): AssertCommand {
return copy(
visible = visible?.evaluateScripts(jsEngine),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import maestro.js.JsEngine
*/
data class MaestroCommand(
val tapOnElement: TapOnElementCommand? = null,
@Deprecated("Use tapOnPointV2Command") val tapOnPoint: TapOnPointCommand? = null,
@Suppress("DEPRECATION") @Deprecated("Use tapOnPointV2Command") val tapOnPoint: TapOnPointCommand? = null,
val tapOnPointV2Command: TapOnPointV2Command? = null,
val scrollCommand: ScrollCommand? = null,
val swipeCommand: SwipeCommand? = null,
val backPressCommand: BackPressCommand? = null,
@Deprecated("Use assertConditionCommand") val assertCommand: AssertCommand? = null,
@Suppress("DEPRECATION") @Deprecated("Use assertConditionCommand") val assertCommand: AssertCommand? = null,
val assertConditionCommand: AssertConditionCommand? = null,
val inputTextCommand: InputTextCommand? = null,
val inputRandomTextCommand: InputRandomCommand? = null,
Expand Down Expand Up @@ -67,6 +67,7 @@ data class MaestroCommand(
val toggleAirplaneModeCommand: ToggleAirplaneModeCommand? = null,
) {

@Suppress("DEPRECATION")
constructor(command: Command) : this(
tapOnElement = command as? TapOnElementCommand,
tapOnPoint = command as? TapOnPointCommand,
Expand Down Expand Up @@ -107,6 +108,7 @@ data class MaestroCommand(
toggleAirplaneModeCommand = command as? ToggleAirplaneModeCommand,
)

@Suppress("DEPRECATION")
fun asCommand(): Command? = when {
tapOnElement != null -> tapOnElement
tapOnPoint != null -> tapOnPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data class WorkspaceConfig(
val flows: StringList? = null,
val includeTags: StringList? = null,
val excludeTags: StringList? = null,
val local: Local? = null,
@Suppress("DEPRECATION") val local: Local? = null,
val executionOrder: ExecutionOrder? = null
) {

Expand Down Expand Up @@ -43,4 +43,4 @@ data class WorkspaceConfig(

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class Orchestra(
private fun executeCommand(maestroCommand: MaestroCommand, config: MaestroConfig?): Boolean {
val command = maestroCommand.asCommand()

@Suppress("DEPRECATION")
return when (command) {
is TapOnElementCommand -> {
tapOnElement(
Expand Down Expand Up @@ -730,7 +731,7 @@ class Orchestra(
return true
}

private fun assertCommand(command: AssertCommand): Boolean {
private fun assertCommand(@Suppress("DEPRECATION") command: AssertCommand): Boolean {
return assertConditionCommand(
command.toAssertConditionCommand()
)
Expand Down Expand Up @@ -766,7 +767,7 @@ class Orchestra(
}

private fun tapOnPoint(
command: TapOnPointCommand,
@Suppress("DEPRECATION") command: TapOnPointCommand,
retryIfNoChange: Boolean
): Boolean {
maestro.tap(
Expand Down

0 comments on commit ef2d854

Please sign in to comment.