Open timrijckaert opened 1 year ago
Hi, looks like you didn't complete the setup. Please make sure that you have completed the android-junit5 setup: https://github.com/mannodermaus/android-junit5#setup Applying the plugin is not enough according to their docs.
Note that their setup guide says apply the plugin to the app module, Paparazzi doesn't work in app modules yet, and you're applying to a library.
Also as far as I know that plugin is for instrumentation tests, is it necessary for running Jupiter tests in testDebugUnitTest?
If none of these help, can you please provide a small repro project?
Paparazzi currently doesn't support Junit 5. We're working on potentially supporting that after https://github.com/cashapp/paparazzi/issues/282 lands, which is slated for the 1.4 release.
Thanks for now we have created a separate module to host our Paparazzi screenshot tests.
I was having the exact same issue when using this plugin, I managed to make it work without the need to have a different module by adding this 2 dependencies
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.3")
I was stuck on this for some days now. Switching to Junit 4 helped. Maybe a hint or compatibility information should go into the readme
Maybe a hint would be nice to link the issue to this plugin so the devs avoid some debugging time, but not sure it's Paparazzi's responsibility to provide this. In the plugin setup link as referred by @TWiStErRob there are some optional dependencies that should be added to also to run junit4 tests (the case of Paparazzi).
I agree with @Yiran001: the fact that Paparazzi only supports JUnit 4 is only very implicitly "documented" by the fact that there's a transitive dependency and the fact that it's only provided entry point is a class extending TestRule
. For a JVM testing library that only works with JUnit 4 (i.e. not TestNG, Jupiter, Spock, etc.), somehow this should be made clear in the README / website. On the other hand the whole world of Android is pretty much tightly coupled with JUnit 4 (AGP, Espresso, Robolectric to name a few), so this is sadly close to common sense. I'm glad to see some challengers of status quo though, Jupiter is awesome!
Description When applying the
de.mannodermaus.android-junit5
plugin the project breaks. Many Android project still rely on this plugin for other unit tests.The version of the de.mannodermaus.android-junit5 plugin tested is:
1.8.2.1
Steps to Reproduce
Apply following diff to the sample project.
Expected behavior The Paparazzi plug-in and the Junit5 plugin can live happily together.
Additional information:
Screenshots n/a
Thanks in advance