Here is the problem when I run my UI test.
But the ExampleInstrumentedTest is working.
This is my test file, I already comment out everything, leaving an empty function
@RunWith(AndroidJUnit4ClassRunner::class)
class ExploreFragmentTest {
@get: Rule
val activityRule = ActivityScenarioRule(MainActivity::class.java)
@Test
fun test_isSearchButtonDisplayed() {
//onView(withId(R.id.btn_search)).check(matches(isDisplayed()))
}
}
Here is my dependency in app/gradle
// AndroidX Test - Instrumented testing
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'