From 175782a2c15f41326e794bc5630de423a8eff91e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 3 Aug 2022 00:53:00 +0530 Subject: [PATCH] benchmark: add comments page to test purview --- .../msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt | 2 +- .../msfjarvis/claw/benchmark/BaselineProfileGenerator.kt | 4 +--- .../kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt | 7 +++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt index e5647665..0802e6d2 100644 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt +++ b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt @@ -45,6 +45,6 @@ class BaselineProfileBenchmark { iterations = 10, startupMode = StartupMode.COLD, compilationMode = compilationMode - ) { tapNavigationDestinations(device) } + ) { exploreUI(device) } } } diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt index 5b3fa08a..7d667404 100644 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt +++ b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt @@ -23,7 +23,5 @@ class BaselineProfileGenerator { @Test fun startup() = - baselineProfileRule.collectBaselineProfile(packageName = PACKAGE_NAME) { - tapNavigationDestinations(device) - } + baselineProfileRule.collectBaselineProfile(packageName = PACKAGE_NAME) { exploreUI(device) } } diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt index b474e70e..964aee42 100644 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt +++ b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt @@ -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() }