2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/15115 - Part 9: Fix ui tests for the tabs settings

This commit is contained in:
Gabriel Luong 2020-10-08 11:46:35 -04:00
parent d7a4925a5a
commit 9b8a3401c8
2 changed files with 9 additions and 9 deletions

View File

@ -69,7 +69,7 @@ class SettingsBasicsTest {
verifyBasicsHeading() verifyBasicsHeading()
verifySearchEngineButton() verifySearchEngineButton()
verifyDefaultBrowserItem() verifyDefaultBrowserItem()
verifyCloseTabsItem() verifyTabsItem()
// drill down to submenu // drill down to submenu
}.openSearchSubMenu { }.openSearchSubMenu {
verifyDefaultSearchEngineHeader() verifyDefaultSearchEngineHeader()
@ -175,7 +175,7 @@ class SettingsBasicsTest {
homeScreen { homeScreen {
}.openThreeDotMenu { }.openThreeDotMenu {
}.openSettings { }.openSettings {
}.openCloseTabsSubMenu { }.openTabsSubMenu {
verifyOptions() verifyOptions()
} }
} }

View File

@ -51,7 +51,7 @@ class SettingsRobot {
fun verifyAccessibilityButton() = assertAccessibilityButton() fun verifyAccessibilityButton() = assertAccessibilityButton()
fun verifySetAsDefaultBrowserButton() = assertSetAsDefaultBrowserButton() fun verifySetAsDefaultBrowserButton() = assertSetAsDefaultBrowserButton()
fun verifyDefaultBrowserItem() = assertDefaultBrowserItem() fun verifyDefaultBrowserItem() = assertDefaultBrowserItem()
fun verifyCloseTabsItem() = assertCloseTabsItem() fun verifyTabsItem() = assertTabsItem()
fun verifyDefaultBrowserIsDisaled() = assertDefaultBrowserIsDisabled() fun verifyDefaultBrowserIsDisaled() = assertDefaultBrowserIsDisabled()
fun clickDefaultBrowserSwitch() = toggleDefaultBrowserSwitch() fun clickDefaultBrowserSwitch() = toggleDefaultBrowserSwitch()
fun verifyAndroidDefaultAppsMenuAppears() = assertAndroidDefaultAppsMenuAppears() fun verifyAndroidDefaultAppsMenuAppears() = assertAndroidDefaultAppsMenuAppears()
@ -135,10 +135,10 @@ class SettingsRobot {
return SettingsSubMenuThemeRobot.Transition() return SettingsSubMenuThemeRobot.Transition()
} }
fun openCloseTabsSubMenu(interact: SettingsSubMenuTabsRobot.() -> Unit): SettingsSubMenuTabsRobot.Transition { fun openTabsSubMenu(interact: SettingsSubMenuTabsRobot.() -> Unit): SettingsSubMenuTabsRobot.Transition {
fun closeTabsButton() = onView(withText("Close tabs")) fun tabsButton() = onView(withText("Tabs"))
closeTabsButton().click() tabsButton().click()
SettingsSubMenuTabsRobot().interact() SettingsSubMenuTabsRobot().interact()
return SettingsSubMenuTabsRobot.Transition() return SettingsSubMenuTabsRobot.Transition()
@ -297,9 +297,9 @@ private fun assertDefaultBrowserItem() {
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertCloseTabsItem() { private fun assertTabsItem() {
mDevice.wait(Until.findObject(By.text("Close tabs")), waitingTime) mDevice.wait(Until.findObject(By.text("Tabs")), waitingTime)
onView(withText("Close tabs")) onView(withText("Tabs"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }