Updated About Settings Tests to check if a view is completely displayed
parent
60a97e6618
commit
fe17e2acbd
|
@ -17,6 +17,7 @@ import androidx.test.espresso.intent.Intents.intended
|
||||||
import androidx.test.espresso.intent.matcher.IntentMatchers.toPackage
|
import androidx.test.espresso.intent.matcher.IntentMatchers.toPackage
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
import androidx.test.espresso.matcher.ViewMatchers
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import androidx.test.uiautomator.By
|
import androidx.test.uiautomator.By
|
||||||
|
@ -250,19 +251,19 @@ private fun assertRemoteDebug() {
|
||||||
private fun assertAboutHeading(): ViewInteraction {
|
private fun assertAboutHeading(): ViewInteraction {
|
||||||
TestHelper.scrollToElementByText("About")
|
TestHelper.scrollToElementByText("About")
|
||||||
return onView(ViewMatchers.withText("About"))
|
return onView(ViewMatchers.withText("About"))
|
||||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
.check(matches(isCompletelyDisplayed()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun assertRateOnGooglePlay(): ViewInteraction {
|
private fun assertRateOnGooglePlay(): ViewInteraction {
|
||||||
TestHelper.scrollToElementByText("About Firefox Preview")
|
TestHelper.scrollToElementByText("About Firefox Preview")
|
||||||
return onView(ViewMatchers.withText("Rate on Google Play"))
|
return onView(ViewMatchers.withText("Rate on Google Play"))
|
||||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
.check(matches(isCompletelyDisplayed()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun assertAboutFirefoxPreview(): ViewInteraction {
|
private fun assertAboutFirefoxPreview(): ViewInteraction {
|
||||||
TestHelper.scrollToElementByText("About Firefox Preview")
|
TestHelper.scrollToElementByText("About Firefox Preview")
|
||||||
return onView(ViewMatchers.withText("About Firefox Preview"))
|
return onView(ViewMatchers.withText("About Firefox Preview"))
|
||||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
.check(matches(isCompletelyDisplayed()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun swipeToBottom() = onView(ViewMatchers.withId(R.id.recycler_view)).perform(ViewActions.swipeUp())
|
fun swipeToBottom() = onView(ViewMatchers.withId(R.id.recycler_view)).perform(ViewActions.swipeUp())
|
||||||
|
|
Loading…
Reference in New Issue