Closed stephen1706 closed 3 years ago
Hi @stephen1706 I'm afraid this issue seems not to be related to Shot at all. We are not using UI automation API so there is nothing we can do to fix it. I'm afraid I'm closing this issue.
Looks like, unfortunately, indirectly (through Facebook testing library) we do. Here's a full stacktrace for this issue. SDK version on emulator: 26, emulator version: 34.1.1
20:57:42.913 E Exception captured while taking screenshot for snapshot with name
java.lang.RuntimeException: Error while connecting UiAutomation
at android.app.UiAutomation.connect(UiAutomation.java:239)
at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2045)
at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2002)
at com.facebook.testing.screenshot.internal.ScreenshotDirectories.grantPermission(ScreenshotDirectories.java:77)
at com.facebook.testing.screenshot.internal.ScreenshotDirectories.checkPermissions(ScreenshotDirectories.java:68)
at com.facebook.testing.screenshot.internal.ScreenshotDirectories.get(ScreenshotDirectories.java:53)
at com.facebook.testing.screenshot.internal.AlbumImpl.<init>(AlbumImpl.java:52)
at com.facebook.testing.screenshot.internal.AlbumImpl.create(AlbumImpl.java:61)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.create(ScreenshotImpl.java:76)
at com.facebook.testing.screenshot.internal.ScreenshotImpl.getInstance(ScreenshotImpl.java:94)
at com.facebook.testing.screenshot.Screenshot.snap(Screenshot.java:39)
at com.karumi.shot.ScreenshotTest$DefaultImpls.takeViewSnapshot(ScreenshotTest.kt:187)
at com.karumi.shot.ScreenshotTest$DefaultImpls.compareScreenshot(ScreenshotTest.kt:110)
at my.project.BaseViewTest.compareScreenshot(BaseViewTest.kt:27)
Expected behaviour
Running test will run smoothly
Actual behaviour
The first test case will always fail because of Error while connecting UiAutomation. Other test will run fine, but since the first test will always error, no report will be generated. Error log:
Steps to reproduce
Run
./gradlew executeScreenshotTests -d
at emulator API 27 at bitrise. The issue is not reproducible at my local mac machine. The stack of my bitrise machine is using linux.Version of the library
4.4.0