Skip to content

Commit

Permalink
android waitToSettleTimeoutMs not wait for settle for faster commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rasyid7 committed Oct 18, 2024
1 parent 69c8c76 commit 4623c99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion maestro-client/src/main/java/maestro/Maestro.kt
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class Maestro(
) {
LOGGER.info("Tapping on element: ${tapRepeat ?: ""} $element")

val hierarchyBeforeTap = waitForAppToSettle(initialHierarchy, appId, waitToSettleTimeoutMs) ?: initialHierarchy
val hierarchyBeforeTap = initialHierarchy

val center = (
hierarchyBeforeTap
Expand Down Expand Up @@ -353,6 +353,12 @@ class Maestro(
} else {
driver.tap(Point(x, y))
}

if (waitToSettleTimeoutMs != null && waitToSettleTimeoutMs < 150) {
LOGGER.info("waitToSettleTimeoutMs is less than 150, skip get hierarchy")
return
}

val hierarchyAfterTap = waitForAppToSettle(waitToSettleTimeoutMs = waitToSettleTimeoutMs)

if (hierarchyBeforeTap != hierarchyAfterTap) {
Expand Down

0 comments on commit 4623c99

Please sign in to comment.