Launch RoboElectric several times with a different version of sdk

I created a RoboElectric testing class that I would like to run several times,

every time you change the sdk @Config parameter (sdk = Build.VERSION_CODES. {code})

Any ideas on how to do this without creating new test classes?

+4
source share
1 answer

The solution, MultiApiRobolectricTestRunner will run the test class on several configurations of the API level,

The code should look like this:

@RunWith(MultiApiRobolectricTestRunner.class)
@Config(sdk = {20, 21, 22})
public class IntegrationTest {}
+3
source

Source: https://habr.com/ru/post/1648216/


All Articles