INNER CODE UNIT · Kotlin
avoidOpeningChromeCustomTab
owncloud/android · owncloudApp/src/androidTest/java/com/owncloud/android/authentication/LoginActivityTest.kt:725
private fun avoidOpeningChromeCustomTab() {
Intents.intending(allOf(IntentMatchers.hasAction(Intent.ACTION_VIEW)))
.respondWith(Instrumentation.ActivityResult(RESULT_OK, null))
}
private fun checkBasicFieldsVisibility(
fieldsShouldBeVisible: Boolean = true,
loginButtonShouldBeVisible: Boolean = false
) {
val visibilityMatcherFields = if (fieldsShouldBeVisible) Visibility.VISIBLE else Visibility.GONE
val visibilityMatcherLoginButton = if (loginButtonShouldBeVisible) Visibility.VISIBLE else Visibility.GONE
with(R.id.account_username) {
isDisplayed(fieldsShouldBeVisible)
assertVisibility(visibilityMatcherFields)
withText("")
}