Open Stronger197 opened 3 years ago
oO first time I see this. Thanks for reporting @Stronger197. Could you please send a PR with a README.md update explaining this scenario?
Yep, sure!
I have more info. If you run compareScreenshot(view : View) without -Precord param, it also not working as expected, because /build/reports/shot/verification/images is empty
Are you sure this is a library issue and not something related to your project or your config? Could you try running shot-consumer or any other consumer example app inside this repository in your testing device to ensure we have a real bug?
Pls read "Steps to reproduce". I tested this case using shot-consumer-flavors. compareScreenshot(view : View) - not working compareScreenshot(activity : Activity) - ok
Hi. I reproduced this problem too on shot-consumer.
Hi all! I'm going to be out for holiday so if anybody knows how to fix this issue without dealing with the emulators, please let me know and contribute if possible. It could be great if we can find another alternative to -P param to be able to record our screenshots. This feature should work out of the box without any further configuration
Not sure whether this is related to this issue, but worth mentioning. I have seen similar issues happening on the KataScreenshotKotlin
It seems the problems start with Shot 5.8.0
I cloned the project locally. It has shot version 5.5.0 configured and that one works fine (Gradle 6.7.1, emulator: Marshmallow API 23, targetSdk 28)
But if we just change the shot version, we experience the following problems: Shot 5.7.0 (still fine)
Shot 5.8.0
Shot 5.11.2
Moreover, I tried with the aforementioned "workaround" on a device with API 30 and Shot 5.11.2 and it fails
I've checked the Readme and saw that the following was added in Shot 5.8.0:
"Since Shot 5.8.0 we provide support for devices running API >= 29. There is no need to configure android:requestLegacyExternalStorage="true" or provide any special storage permission in your test `AndroidManifest
."
That's my investigation so far
Not sure whether this is related to this issue, but worth mentioning. I have seen similar issues happening on the KataScreenshotKotlin
It seems the problems start with Shot 5.8.0
I cloned the project locally. It has shot version 5.5.0 configured and that one works fine (Gradle 6.7.1, emulator: Marshmallow API 23, targetSdk 28)
But if we just change the shot version, we experience the following problems: Shot 5.7.0 (still fine)
Shot 5.8.0
Shot 5.11.2
Moreover, I tried with the aforementioned "workaround" on a device with API 30 and Shot 5.11.2 and it fails
I've checked the Readme and saw that the following was added in Shot 5.8.0: "Since Shot 5.8.0 we provide support for devices running API >= 29. There is no need to configure android:requestLegacyExternalStorage="true" or provide any special storage permission in your test
`AndroidManifest
."That's my investigation so far
I found out that it was not working because that kata is using its own testRunner instead of com.karumi.shot.ShotTestRunner
, so it is not relevant to this bug.
I think it would be great to update the Kata to the latest shot version. It can serve as example to other people having issues to configure Shot.
Sorry for misleading :(
Hey Folks,
Since I update my project to use the API 31 (Android R), I'm having kinda the same issues. The test runs Ok, however, the snapshot folder can be found or created. I can't figure out what is wrong, to be honest. Could you guys help me to understand?
I'm using an AndroidAuto emulator to develop, however, the behavior is reproducible on my Pixel Emulator too.
I created a sample app with the same configuration that I have on my real project, you can find it here: https://github.com/raafaelima/ShotSnapshotSample
@raafaelima I'm having the same issue and it's blocking us to introduce Shot in our codebase. Have you found any solution so far?
Expected behaviour
Screenshots are successfully generated for cases declared in the sample app
Actual behaviour
Test completes successfully, but screenshots folder is empty and no errors are generated
Steps to reproduce
Open shot-consumer-flavors Create new avd 28+ Run executeScreenshotTests with following params
-Pandroid.testInstrumentationRunnerArguments.class=com.karumi.ui.view.SuperHeroViewHolderTest -Precord
Check the "screenshots" folder when execution is finished
Version of the library
5.11.0 but it also doesn't work in lower versions Tested on api 28+
Possible solution
I think this is happens because of restrictions on non-SDK interfaces (API 28+) So, when I executed the following command, everything works fine
@pedrovgs How about adding this info to the docs, because I spent a lot of time to launch this type of tests?