benchmark: add comments page to test purview

This commit is contained in:
Harsh Shandilya 2022-08-03 00:53:00 +05:30
parent 492219e3a8
commit 175782a2c1
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
3 changed files with 7 additions and 6 deletions

View file

@ -45,6 +45,6 @@ class BaselineProfileBenchmark {
iterations = 10,
startupMode = StartupMode.COLD,
compilationMode = compilationMode
) { tapNavigationDestinations(device) }
) { exploreUI(device) }
}
}

View file

@ -23,7 +23,5 @@ class BaselineProfileGenerator {
@Test
fun startup() =
baselineProfileRule.collectBaselineProfile(packageName = PACKAGE_NAME) {
tapNavigationDestinations(device)
}
baselineProfileRule.collectBaselineProfile(packageName = PACKAGE_NAME) { exploreUI(device) }
}

View file

@ -6,13 +6,16 @@ import androidx.test.uiautomator.UiDevice
const val PACKAGE_NAME = "dev.msfjarvis.claw.android"
fun MacrobenchmarkScope.tapNavigationDestinations(device: UiDevice) {
fun MacrobenchmarkScope.exploreUI(device: UiDevice) {
startActivityAndWait()
device.run {
listOf("HOTTEST", "NEWEST", "SAVED").forEach { desc ->
findObject(By.desc(desc)).click()
waitForIdle()
}
findObject(By.desc("HOTTEST")).click()
waitForIdle()
findObjects(By.desc("Open comments")).first().click()
waitForIdle()
}
device.waitForIdle()
}