You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you get any error due to "Activity not found" in your application module, add the following to your `debug/manifest`
@@ -190,7 +190,7 @@ You can also add support for your own solution / another library by implementing
190
190
191
191
#### Basic configuration
192
192
This section covers the basics: how to configure cross-library screenshot test that will run with the library of your choice. The main benefit is, that to switch to another library you won't need to rewrite all your tests!</br>
193
-
It's possible to configure more though<sup>1</sup>. For shared screenshot tests (i.e. on-device + JVM), check [the next section](#shared-tests)</br></br>
193
+
It's possible to configure several libraries though<sup>1</sup>. For shared screenshot tests (i.e. on-device + JVM), check [the next section](#shared-tests)</br></br>
194
194
195
195
1. First of all, configure all the screenshot testing libraries you want your tests to support, as
196
196
if you'd write them with those specific libraries. Visit their respective Github pages for more info.
@@ -200,27 +200,27 @@ It's possible to configure more though<sup>1</sup>. For shared screenshot tests
If using Roborazzi, enable robolectric native graphics throug gradle as well
223
+
If using Roborazzi, enable robolectric native graphics through gradle as well
224
224
225
225
```groovy
226
226
android {
@@ -266,9 +266,8 @@ But if you wish to configure many on-device or many JVM libraries at the same ti
266
266
267
267
268
268
#### Shared tests
269
-
If instead of using just one library at once, you want to enable shared tests (i.e same test running either on the JVM or on a device/emulator),you have 2 options to share resources between unitTests and AndroidTests:
270
-
1. Create and write your tests in a [share test module as described here](https://blog.danlew.net/2022/08/16/sharing-code-between-test-modules/) or...
271
-
2. Add this in the `build.gradle` of the module where you'll write shared tests and then write your screenshot tests under `src/sharedTest`.
269
+
If instead of using just one screenshot testing library at once, you want to enable shared tests (i.e same test running either on the JVM or on a device/emulator),you have to share resources between unitTests and AndroidTests.</br>
270
+
The easiest way is to add this in the `build.gradle` of the module where you'll write shared tests and then write your screenshot tests under `src/sharedTest`,
272
271
273
272
```groovy
274
273
android {
@@ -283,6 +282,8 @@ android {
283
282
}
284
283
}
285
284
```
285
+
> **Warning**</br>
286
+
> Android Studio will show errors if sharedTests are defined in an application module. Consider creating an extra library module for testing the UI of your application module.
286
287
287
288
Now follow steps 1. & 2. as in the [Basic configuration](#basic-configuration) section. After that:
0 commit comments