Trying to execute an instrumented test class I have an error with the task compileDebugAndroidTestKotlin in this line
private lateinit var scenarioEmail: FragmentScenario
For that code:
@RunWith(AndroidJUnit4::class)
class LoginUiTest {
private lateinit var scenarioEmail: FragmentScenario<CheckEmailFragment>
private lateinit var scenarioSignup: FragmentScenario<SignupFragment>
@Before
fun setup() {
scenarioEmail = launchFragmentInContainer<CheckEmailFragment>()
scenarioSignup = launchFragmentInContainer<SignupFragment>()
}
@Test
fun whenEmailOkNavigationToPasswordDone() {
val email = "albert@b4workapp.com"
onView(withId(R.id.edt_email)).perform(typeText(email), closeSoftKeyboard())
onView(withId(R.id.btnNext)).perform(click())
IdlingPolicies.setMasterPolicyTimeout(1, TimeUnit.SECONDS)
IdlingPolicies.setIdlingResourceTimeout(1, TimeUnit.SECONDS)
onView(withId(R.id.btnAction)).check(matches(isDisplayed()))
}
}
The error says:
- Type argument is not within its bounds: should be subtype of ‘Fragment’
and * Cannot access class ‘androidx.fragment.app.FragmentFactory’. Check your module classpath for missing or conflicting dependencies
But my class inherits at some point of Fragment class. The inheritance is:
MyFragment > RBasePFragment > BaseFragment > androidx.app.Fragment()
about the dependencies i have two dependencies of the fragment library:
1.5.4 and 1.8.3 all of them have the FragmentFactory class