|
|
|
@ -20,6 +20,7 @@ import androidx.benchmark.macro.MacrobenchmarkScope
|
|
|
|
|
import androidx.test.uiautomator.By
|
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
|
import androidx.test.uiautomator.untilHasChildren
|
|
|
|
|
import androidx.test.uiautomator.waitAndFindObject
|
|
|
|
|
import com.google.samples.apps.nowinandroid.flingElementDownUp
|
|
|
|
|
|
|
|
|
|
fun MacrobenchmarkScope.forYouWaitForContent() {
|
|
|
|
@ -27,7 +28,7 @@ fun MacrobenchmarkScope.forYouWaitForContent() {
|
|
|
|
|
device.wait(Until.gone(By.res("loadingWheel")), 5_000)
|
|
|
|
|
// Sometimes, the loading wheel is gone, but the content is not loaded yet
|
|
|
|
|
// So we'll wait here for topics to be sure
|
|
|
|
|
val obj = device.findObject(By.res("forYou:topicSelection"))
|
|
|
|
|
val obj = device.waitAndFindObject(By.res("forYou:topicSelection"), 10_000)
|
|
|
|
|
// Timeout here is quite big, because sometimes data loading takes a long time!
|
|
|
|
|
obj.wait(untilHasChildren(), 60_000)
|
|
|
|
|
}
|
|
|
|
|