Skip to content

Commit 1543fba

Browse files
committed
Merge branch 'release/2.2.1' of https://github.com/sergio-sastre/AndroidUiTestingUtils into release/2.2.1
2 parents 9189def + f1c75c9 commit 1543fba

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

android-testify/src/main/java/sergio/sastre/uitesting/android_testify/AndroidTestifyScreenshotTestRuleForView.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class AndroidTestifyScreenshotTestRuleForView(
9797
.setViewUnderTest(viewToScreenshot!!)
9898
.setBitmapCaptureMethod(androidTestifyConfig.bitmapCaptureMethod)
9999
.generateDiffs(androidTestifyConfig.generateDiffs)
100+
.waitForIdleSync()
100101
.assertSame(name = name)
101102
}
102103

android-testify/src/main/java/sergio/sastre/uitesting/android_testify/ScreenshotRuleExt.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ fun <T : Activity> ScreenshotRule<T>.assertSame(name: String?) {
4545
assertSame()
4646
}
4747

48+
fun <T : Activity> ScreenshotRule<T>.waitForIdleSync(): ScreenshotRule<T> = apply {
49+
getInstrumentation().waitForIdleSync()
50+
}
51+
4852
// We need to ensure the view is attached to the screenshotRule activity window for testify to
4953
// take the screenshot. This is especially important for dialogs
5054
internal fun <T : Activity> ScreenshotRule<T>.setViewUnderTest(

0 commit comments

Comments
 (0)