Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shot not recording snapshot images on Android R #262

Closed
raafaelima opened this issue Oct 26, 2021 · 8 comments
Closed

Shot not recording snapshot images on Android R #262

raafaelima opened this issue Oct 26, 2021 · 8 comments

Comments

@raafaelima
Copy link

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

Screenshot 2021-10-22 at 12 58 26

@RaggedyCoder
Copy link

Well, I am having the same issue even with API 27 on my project.

@Alton09
Copy link

Alton09 commented Nov 11, 2021

I've seen this issue when running on an emulator and on a SM-G975U running Android 10. I got the tests to work though on a Pixel 3 running Android 12. Seems to be an issue for specific devices/OS versions. I ran the tests from this sample project.

@pedrovgs
Copy link
Owner

Guys, could you please test the new release 5.12.2?

@kmikeevfelyx
Copy link

I have it on 5.12.2, M1 Macbook, Emulator API 32, targetSdk 32. It just does not record and there are no clues in the log.

@kmikeevfelyx
Copy link

Oh. my problem was that I didn't use com.karumi.shot.ShotTestRunner, solved!

@raafaelima
Copy link
Author

Oh Hi, even with the update to version 5.12.2, I'm having the same results here.
I'm using this project ShotSnapshotSample to test it, if you wanna see anything.

image

@mariuszmarzec
Copy link
Contributor

@raafaelima In my newest PR introducting support for orchestrator i bumped version of facebook screenshot library used under the hood: #273
I made a test in my project and looks like it work on mentioned emulator. Below i copied best configuration for espresso to made shot working:

 val runner_version = "1.3.0"
    val orchestrator_version = "1.4.1"
    val android_test_services_version = "1.4.1"
    val espresso_core = "3.3.0"

    androidTestImplementation("androidx.test:core:${Dependency.runner_version}")
    androidTestImplementation("androidx.test:runner:${Dependency.runner_version}")
    androidTestImplementation("androidx.test:rules:${Dependency.runner_version}")
    androidTestUtil("androidx.test:orchestrator:${Dependency.orchestrator_version}")
    androidTestUtil("androidx.test.services:test-services:${Dependency.android_test_services_version}")
    androidTestImplementation("androidx.test.espresso:espresso-core:${Dependency.espresso_core}")
    androidTestImplementation("androidx.test.espresso:espresso-contrib:${Dependency.espresso_core}")

You can push version of shot library to local maven repository and used it till PR will be merged.

@pedrovgs
Copy link
Owner

Releasing a new version today. Feel free to reopen this issue if the new version doesn't fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants