I try to run Kotlin instrumentation tests for android.
In my app/build.gradle:
android {
dataBinding {
enabled = true
I faced this problem in kotlin , used below code and it worked
@RunWith(AndroidJUnit4::class)
@LargeTest
class MainActivityTest {
private val TAG = "MainActivityTest"
@get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java)
}
follow the link below:- https://developer.android.com/training/testing/junit-rules
I got this error when I have some parameters in my test method. So, if you have it - delete it.
@Test
fun someTestMethod(someParams: Int) { // delete method params
assert(1==1)
}