Merge "Fixing RemoteAuth Tests breakage" into main

This commit is contained in:
Treehugger Robot
2023-08-16 19:43:10 +00:00
committed by Android (Google) Code Review
3 changed files with 20 additions and 15 deletions

View File

@@ -22,7 +22,6 @@ import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import com.android.settings.R
import org.hamcrest.core.IsNot.not
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -36,10 +35,10 @@ class RemoteAuthEnrollEnrollingTest {
}
@Test
fun testRemoteAuthenticatorEnrollEnrolling_hasHeader() {
fun testRemoteAuthenticatorEnrollEnrolling_headerVisible() {
onView(withText(R.string.security_settings_remoteauth_enroll_enrolling_title)).check(
matches(
isDisplayed()
withEffectiveVisibility(Visibility.VISIBLE)
)
)
}
@@ -54,12 +53,18 @@ class RemoteAuthEnrollEnrollingTest {
}
@Test
fun testRemoteAuthenticatorEnrollEnrolling_progressBarNotDisplayed() {
onView(withId(R.id.enrolling_list_progress_bar)).check(matches(not(isDisplayed())))
fun testRemoteAuthenticatorEnrollEnrolling_progressBarNotVisible() {
onView(withId(R.id.enrolling_list_progress_bar)).check(
matches(
withEffectiveVisibility(
Visibility.INVISIBLE
)
)
)
}
@Test
fun testRemoteAuthenticatorEnrollEnrolling_errorTextNotDisplayed() {
onView(withId(R.id.error_text)).check(matches(not(isDisplayed())))
fun testRemoteAuthenticatorEnrollEnrolling_errorTextNotVisible() {
onView(withId(R.id.error_text)).check(matches(withEffectiveVisibility(Visibility.INVISIBLE)))
}
}

View File

@@ -36,19 +36,19 @@ class RemoteAuthEnrollFinishTest {
}
@Test
fun testRemoteAuthenticatorEnrollFinish_hasHeader() {
fun testRemoteAuthenticatorEnrollFinish_headerVisible() {
onView(withText(R.string.security_settings_remoteauth_enroll_finish_title)).check(
matches(
isDisplayed()
withEffectiveVisibility(Visibility.VISIBLE)
)
)
}
@Test
fun testRemoteAuthenticatorEnrollFinish_hasDescription() {
fun testRemoteAuthenticatorEnrollFinish_descriptionVisible() {
onView(withText(R.string.security_settings_remoteauth_enroll_finish_description)).check(
matches(
isDisplayed()
withEffectiveVisibility(Visibility.VISIBLE)
)
)
}

View File

@@ -35,19 +35,19 @@ class RemoteAuthSettingsTest {
}
@Test
fun testRemoteAuthenticatorSettings_hasHeader() {
fun testRemoteAuthenticatorSettings_headerVisible() {
onView(withText(R.string.security_settings_remoteauth_settings_title)).check(
matches(
isDisplayed()
withEffectiveVisibility(Visibility.VISIBLE)
)
)
}
@Test
fun testRemoteAuthenticatorSettings_hasDescription() {
fun testRemoteAuthenticatorSettings_descriptionVisible() {
onView(withText(R.string.security_settings_remoteauth_settings_description)).check(
matches(
isDisplayed()
withEffectiveVisibility(Visibility.VISIBLE)
)
)
}