|
|
|
@ -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
|
|
|
|
|