pedrovgs / Shot

Screenshot testing library for Android
Apache License 2.0
1.19k stars 116 forks source link

Report gets overridden when testing with multiple flavors #258

Closed BsBrabi closed 2 years ago

BsBrabi commented 3 years ago

Expected behaviour

Reports are genereted in a flavor-specific directory, for example app/build/reports/shot/verification/{flavor}/index.html

Actual behaviour

When executing screenshot tests with multiple flavors, the first report gets overridden by the last, because they are saved in the same directory.

> Task :app:devDebugExecuteScreenshotTests
?  Comparing screenshots with previous ones.
?  Yeah!!! Your tests are passing.
?  You can review the execution report here: {projectDir}/app/build/reports/shot/verification/index.html

...

> Task :app:productionDebugExecuteScreenshotTests
?  Comparing screenshots with previous ones.
?  Yeah!!! Your tests are passing.
?  You can review the execution report here: {projectDir}/app/build/reports/shot/verification/index.html

Steps to reproduce

./gradlew executeScreenshotTests with a multiple flavors project.

Version of the library

5.11.2

pedrovgs commented 2 years ago

@BsBrabi we've just merged the ability to configure from the command line a prefix for the folder. I'm not sure if this is the change you were expecting but looks like it can be one solution for you. I'll publish a new release soon, please let me know if this helps.

CedrickFlocon commented 2 years ago

The previous implementation had an error reportFolder didn't use flavor & buildType : def reportFolder(flavor: String, buildType: String): String = "/reports/shot" c.f https://github.com/pedrovgs/Shot/pull/259/files#diff-f0b38fa66cdaf6a6b0c3c9ad5c2f24f16719f4865922674005effddf371695e1L53 https://github.com/pedrovgs/Shot/pull/259/files#diff-1fafe31a98d58f57f06edaa70a49887277aa3920f755a67ec28e045d0f9ebb01R25

pedrovgs commented 2 years ago

Can we close this issue already?

BsBrabi commented 2 years ago

Unfortunately we could not test it yet, but I think we can close the issue already.