|
|
@ -21,16 +21,21 @@ import androidx.test.uiautomator.By
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import androidx.test.uiautomator.Until
|
|
|
|
import com.google.samples.apps.nowinandroid.flingElementDownUp
|
|
|
|
import com.google.samples.apps.nowinandroid.flingElementDownUp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun MacrobenchmarkScope.goToInterestsScreen() {
|
|
|
|
|
|
|
|
device.findObject(By.text("Interests")).click()
|
|
|
|
|
|
|
|
device.waitForIdle()
|
|
|
|
|
|
|
|
// Wait until interests are shown on screen
|
|
|
|
|
|
|
|
val topAppBar = device.findObject(By.res("niaTopAppBar"))
|
|
|
|
|
|
|
|
topAppBar.wait(Until.hasObject(By.text("Interests")), 2_000)
|
|
|
|
|
|
|
|
// Wait until content is loaded by checking if interests are loaded
|
|
|
|
|
|
|
|
device.wait(Until.gone(By.res("loadingWheel")), 5_000)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun MacrobenchmarkScope.interestsScrollTopicsDownUp() {
|
|
|
|
fun MacrobenchmarkScope.interestsScrollTopicsDownUp() {
|
|
|
|
val topicsList = device.findObject(By.res("interests:topics"))
|
|
|
|
val topicsList = device.findObject(By.res("interests:topics"))
|
|
|
|
device.flingElementDownUp(topicsList)
|
|
|
|
device.flingElementDownUp(topicsList)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun MacrobenchmarkScope.interestsScrollPeopleDownUp() {
|
|
|
|
|
|
|
|
val peopleList = device.findObject(By.res("interests:people"))
|
|
|
|
|
|
|
|
device.flingElementDownUp(peopleList)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun MacrobenchmarkScope.interestsWaitForTopics() {
|
|
|
|
fun MacrobenchmarkScope.interestsWaitForTopics() {
|
|
|
|
device.wait(Until.hasObject(By.text("Accessibility")), 30_000)
|
|
|
|
device.wait(Until.hasObject(By.text("Accessibility")), 30_000)
|
|
|
|
}
|
|
|
|
}
|
|
|
|