From 9b8a3401c8777f8aed160420c78e527bb38aa04d Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Thu, 8 Oct 2020 11:46:35 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15115 - Part 9: Fix ui tests for the tabs settings --- .../org/mozilla/fenix/ui/SettingsBasicsTest.kt | 4 ++-- .../org/mozilla/fenix/ui/robots/SettingsRobot.kt | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt index 5e5c69a1fb..4a9daa0b2c 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt @@ -69,7 +69,7 @@ class SettingsBasicsTest { verifyBasicsHeading() verifySearchEngineButton() verifyDefaultBrowserItem() - verifyCloseTabsItem() + verifyTabsItem() // drill down to submenu }.openSearchSubMenu { verifyDefaultSearchEngineHeader() @@ -175,7 +175,7 @@ class SettingsBasicsTest { homeScreen { }.openThreeDotMenu { }.openSettings { - }.openCloseTabsSubMenu { + }.openTabsSubMenu { verifyOptions() } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt index 5ed56bb1ee..9e95e31e3a 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt @@ -51,7 +51,7 @@ class SettingsRobot { fun verifyAccessibilityButton() = assertAccessibilityButton() fun verifySetAsDefaultBrowserButton() = assertSetAsDefaultBrowserButton() fun verifyDefaultBrowserItem() = assertDefaultBrowserItem() - fun verifyCloseTabsItem() = assertCloseTabsItem() + fun verifyTabsItem() = assertTabsItem() fun verifyDefaultBrowserIsDisaled() = assertDefaultBrowserIsDisabled() fun clickDefaultBrowserSwitch() = toggleDefaultBrowserSwitch() fun verifyAndroidDefaultAppsMenuAppears() = assertAndroidDefaultAppsMenuAppears() @@ -135,10 +135,10 @@ class SettingsRobot { return SettingsSubMenuThemeRobot.Transition() } - fun openCloseTabsSubMenu(interact: SettingsSubMenuTabsRobot.() -> Unit): SettingsSubMenuTabsRobot.Transition { + fun openTabsSubMenu(interact: SettingsSubMenuTabsRobot.() -> Unit): SettingsSubMenuTabsRobot.Transition { - fun closeTabsButton() = onView(withText("Close tabs")) - closeTabsButton().click() + fun tabsButton() = onView(withText("Tabs")) + tabsButton().click() SettingsSubMenuTabsRobot().interact() return SettingsSubMenuTabsRobot.Transition() @@ -297,9 +297,9 @@ private fun assertDefaultBrowserItem() { .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) } -private fun assertCloseTabsItem() { - mDevice.wait(Until.findObject(By.text("Close tabs")), waitingTime) - onView(withText("Close tabs")) +private fun assertTabsItem() { + mDevice.wait(Until.findObject(By.text("Tabs")), waitingTime) + onView(withText("Tabs")) .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) }