Disabling dropshots but taking a screenshot

Change-Id: I9f6295aa93142db13f1c45cefbc2d8698570a058
ben/dropshots
Jose Alcérreca 6 months ago
parent c2f13c5cd5
commit 7bc96eeafd

@ -80,8 +80,8 @@ class EdgeToEdgeTest {
@get:Rule(order = 3) @get:Rule(order = 3)
val activityScenarioRule = ActivityScenarioRule(MainActivity::class.java) val activityScenarioRule = ActivityScenarioRule(MainActivity::class.java)
@get:Rule(order = 4) // @get:Rule(order = 4)
val dropshots = Dropshots() // val dropshots = Dropshots()
@Before @Before
fun setup() = hiltRule.inject() fun setup() = hiltRule.inject()
@ -179,14 +179,17 @@ class EdgeToEdgeTest {
} }
private fun screenshotSystemBar(screenshotFileName: String) { private fun screenshotSystemBar(screenshotFileName: String) {
waitForWindowUpdate() //waitForWindowUpdate()
activityScenarioRule.scenario.onActivity {
// Crop the top, adding extra pixels to check continuity }
val bitmap = takeScreenshot().let { val bitmap = takeScreenshot().let {
val newHeight = 130 val newHeight = 130
Bitmap.createBitmap(it, 0, 0, it.width, newHeight) 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) { private fun screenshotNavigationBar(screenshotFileName: String) {
@ -247,7 +250,7 @@ class EdgeToEdgeTest {
var count = 2 var count = 2
while (true) { while (true) {
try { try {
dropshots.assertSnapshot(bitmap, name, filePath) //dropshots.assertSnapshot(bitmap, name, filePath)
} catch (e: AssertionError) { } catch (e: AssertionError) {
if (count == 0) throw e if (count == 0) throw e
count -= 1 count -= 1

Loading…
Cancel
Save