dropbox / dropshots

Easy on-device screenshot testing for Android.
Apache License 2.0
257 stars 17 forks source link

[Question] Any plans for snapshot diff? #50

Closed vojtech-cerveny closed 10 months ago

vojtech-cerveny commented 1 year ago

Hey, I want to ask, if you have any plans for showing diff of screenshots if diff is there. It would be nice to create for example new folder /diff and store diffs there.

I am not sure if this is possible by your approach.

JayShortway commented 1 year ago

Hi @vojtech-cerveny,

In case of a failing test, diff images are automatically created, pulled to the host machine and cleared from the test device. They are stored on the host machine in the configured resultsDir, which is <path_to_your_project>/<module_name>/build/outputs/test-results/ by default.

If you want to leave the diff images on your test device, you can exclude the ClearScreenshotsTask like so:

./gradlew :<module_name>:connectedDebugAndroidTest --exclude-task :<module_name>:clearDebugAndroidTestScreenshots

(or equivalent for your build variant.)

You'll be able to find the diff images on your test device in /sdcard/Download/screenshots/.

Let me know if this answers your question.