From 7bc96eeafd77430203be9565170a72630d434e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Alc=C3=A9rreca?= Date: Tue, 4 Jun 2024 17:02:24 +0000 Subject: [PATCH] Disabling dropshots but taking a screenshot Change-Id: I9f6295aa93142db13f1c45cefbc2d8698570a058 --- .../apps/nowinandroid/ui/EdgeToEdgeTest.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt index 90ce8d376..0783542be 100644 --- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt +++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt @@ -80,8 +80,8 @@ class EdgeToEdgeTest { @get:Rule(order = 3) val activityScenarioRule = ActivityScenarioRule(MainActivity::class.java) - @get:Rule(order = 4) - val dropshots = Dropshots() +// @get:Rule(order = 4) +// val dropshots = Dropshots() @Before fun setup() = hiltRule.inject() @@ -179,14 +179,17 @@ class EdgeToEdgeTest { } private fun screenshotSystemBar(screenshotFileName: String) { - waitForWindowUpdate() + //waitForWindowUpdate() + activityScenarioRule.scenario.onActivity { - // Crop the top, adding extra pixels to check continuity + } val bitmap = takeScreenshot().let { val newHeight = 130 Bitmap.createBitmap(it, 0, 0, it.width, newHeight) } - assertSnapshot(bitmap, screenshotFileName) + // Crop the top, adding extra pixels to check continuity + + //assertSnapshot(bitmap, screenshotFileName) } private fun screenshotNavigationBar(screenshotFileName: String) { @@ -247,7 +250,7 @@ class EdgeToEdgeTest { var count = 2 while (true) { try { - dropshots.assertSnapshot(bitmap, name, filePath) + //dropshots.assertSnapshot(bitmap, name, filePath) } catch (e: AssertionError) { if (count == 0) throw e count -= 1