pedrovgs / Shot

Screenshot testing library for Android
Apache License 2.0
1.18k stars 115 forks source link

Snapshot on multipe devices only saving last screenshot #321

Open Mittchel opened 1 year ago

Mittchel commented 1 year ago

Expected behaviour

I am trying to run a tablet emulator and phone emulator. I expect two screenshots in my /app/screenshots/debug folder (1 for tablet and 1 for phone)

Actual behaviour

Only getting one screenshot, but the test is executing on both simulators. Seems like the last finishing emulator is the only screenshot thats saved.

Steps to reproduce

./emulator -avd Pixel_C_API_30 ./emulator -avd PixelXL_Emulator

./gradlew executeScreenshotTests -Precord

Version of the library

com.karumi:shot:5.14.1 Java 11

sergio-sastre commented 1 year ago

Shot runs the screenshot tests on all the devices adb finds.

However, Shot also supports to specify the folder where the screenshots are saved.

Moreover, using Android Serial we can decide on which emulators/devices the commands will be executed.

If we put all together, you can get it working as expected on a Mac as described in this tweet.

https://twitter.com/gio_sastre/status/1484201050450055169?s=46&t=0OpCcA9bfgI0DJA__8tsUQ

@pedrovgs Maybe makes sense to add to the README how to get Shot working on multiple devices? I can gladly add a PR for that