Bug 1881733 - Remove redundant assertion functions from SettingsSubMenuLoginsAndPasswordsSavedLoginsRobot

fenix/125.0
AndiAJ 4 months ago committed by mergify[bot]
parent 382540a0f4
commit 352c9a64cd

@ -30,7 +30,6 @@ import org.mozilla.fenix.helpers.MatcherHelper.checkedItemWithResId
import org.mozilla.fenix.helpers.MatcherHelper.itemContainingText import org.mozilla.fenix.helpers.MatcherHelper.itemContainingText
import org.mozilla.fenix.helpers.MatcherHelper.itemWithClassNameAndIndex import org.mozilla.fenix.helpers.MatcherHelper.itemWithClassNameAndIndex
import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId
import org.mozilla.fenix.helpers.TestAssetHelper
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestHelper.mDevice import org.mozilla.fenix.helpers.TestHelper.mDevice
import org.mozilla.fenix.helpers.TestHelper.packageName import org.mozilla.fenix.helpers.TestHelper.packageName
@ -42,7 +41,8 @@ import org.mozilla.fenix.helpers.ext.waitNotNull
*/ */
class SettingsSubMenuLoginsAndPasswordsSavedLoginsRobot { class SettingsSubMenuLoginsAndPasswordsSavedLoginsRobot {
fun verifySecurityPromptForLogins() = assertSavedLoginsView() fun verifySecurityPromptForLogins() =
onView(withText("Secure your logins and passwords")).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
fun verifyEmptySavedLoginsListView() { fun verifyEmptySavedLoginsListView() {
onView(withText(getStringResource(R.string.preferences_passwords_saved_logins_description_empty_text))) onView(withText(getStringResource(R.string.preferences_passwords_saved_logins_description_empty_text)))
@ -58,9 +58,9 @@ class SettingsSubMenuLoginsAndPasswordsSavedLoginsRobot {
fun verifySavedLoginsAfterSync() { fun verifySavedLoginsAfterSync() {
mDevice.waitNotNull( mDevice.waitNotNull(
Until.findObjects(By.text("https://accounts.google.com")), Until.findObjects(By.text("https://accounts.google.com")),
TestAssetHelper.waitingTime, waitingTime,
) )
assertSavedLoginAppears() onView(withText("https://accounts.google.com")).check(matches(isDisplayed()))
} }
fun tapSetupLater() = onView(withText("Later")).perform(ViewActions.click()) fun tapSetupLater() = onView(withText("Later")).perform(ViewActions.click())
@ -217,14 +217,6 @@ class SettingsSubMenuLoginsAndPasswordsSavedLoginsRobot {
private fun goBackButton() = private fun goBackButton() =
onView(CoreMatchers.allOf(ViewMatchers.withContentDescription("Navigate up"))) onView(CoreMatchers.allOf(ViewMatchers.withContentDescription("Navigate up")))
private fun assertSavedLoginsView() =
onView(withText("Secure your logins and passwords"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertSavedLoginAppears() =
onView(withText("https://accounts.google.com"))
.check(matches(isDisplayed()))
private fun openWebsiteButton() = onView(withId(R.id.openWebAddress)) private fun openWebsiteButton() = onView(withId(R.id.openWebAddress))
private fun siteHeader() = itemWithResId("$packageName:id/hostnameHeaderText") private fun siteHeader() = itemWithResId("$packageName:id/hostnameHeaderText")

Loading…
Cancel
Save