Closed allenz8512 closed 8 years ago
Annotation doesn't go well with inheritance. The best option is to add a configuration file to your project.
Place it there:
src/test/resources/robolectric.properties
for example my properties file looks like this:
constants=com.applause.android.BuildConfig
sdk=21
When you extend from GradleRoboSpecification
you don't need to place sdk, manifest etc values. The BuildConfig (generated file) holds all necessary data to run tests
Thank you for advise.My problem is solved.
:)
Usually I would use a base test class to carry all setups and cleanups, like:
But it throws "No 'constants' field in @Config annotation!" exception when I put @Config on the base test class insteads of specify specification, so I should copy the same @Config annotation everywhere.