Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Apply consistent use of waitAndFindObject extension

kimdowoo842df99e413a
diff --git a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt
index d9c563ebc..c359ae87e 100644
--- a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt
+++ b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt
@@ -20,6 +20,7 @@ import androidx.benchmark.macro.MacrobenchmarkScope
import androidx.test.uiautomator.By
import androidx.test.uiautomator.Until
import com.google.samples.apps.nowinandroid.flingElementDownUp
+import com.google.samples.apps.nowinandroid.waitAndFindObject
fun MacrobenchmarkScope.goToInterestsScreen() {
device.findObject(By.text("Interests")).click()
@@ -34,7 +35,7 @@ fun MacrobenchmarkScope.goToInterestsScreen() {
}
fun MacrobenchmarkScope.interestsScrollTopicsDownUp() {
- val topicsList = device.wait(Until.findObject(By.res("interests:topics")), 2_000)
+ val topicsList = device.waitAndFindObject(By.res("interests:topics"), 2_000)
device.flingElementDownUp(topicsList)
}