sergio-sastre/Android-screenshot-testing-playground

`shot` Screenshot not generated even tho androidTest is passed.

Closed this issue · 5 comments

I tried to run the shot test for both lazycolumn and recyclerview screen but there is no generated screenshot for both the record and the verification.
image
I checked the screenshot folder and it is empty too.
image

The report also shows 0 tests executed.
image
image

The test shows up and report from androidTest directory confirm that.
image

How to solve this or did i miss something?

@wiryadev
I think that is coz I did not configured the sharedId as stated in Shot documentation.

It seems to be needed for some APIs.
Could you tell me the API of the emulator on which you are running the screenshot tests?

I’ll definitely update it if that is the case.
Also please try with another API.

Moreover, what OS is your machine running? MacOs, Windows or Linux?

I was trying with Pixel 4 XL API 31 using Windows. I havent tested it against another API yet.

I was trying with Pixel 4 XL API 31 using Windows. I havent tested it against another API yet.

I've checked it on my Mac and it works.
I'm afraid it has to do with Shot & Windows playing together on emulators running last APIs.

Theoretically, it should not happen on emulators running API 27 or lower.
Could you please confirm that it works on API <28?

@wiryadev
I have one more idea why they might not show up.
could you try running this before the screenshots?

adb shell settings put global hidden_api_policy 1

If that works, there is a way I could fix it without requiring you to run that on emulators before running screenshots with shot

Close due to inactivity
@wiryadev feel free to reopen it if still happening with the newest examples