mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
Bug 1821986 - New opening screen option summary updates UI smoke test
This commit is contained in:
parent
4a9b067034
commit
9311b828c3
@ -166,7 +166,7 @@ class HomeScreenTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickPocketButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyThoughtProvokingStories(false)
|
||||
verifyStoriesByTopic(false)
|
||||
}
|
||||
@ -257,12 +257,12 @@ class HomeScreenTest {
|
||||
clickRecentBookmarksButton()
|
||||
clickRecentSearchesButton()
|
||||
clickPocketButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyCustomizeHomepageButton(false)
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickJumpBackInButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyCustomizeHomepageButton(true)
|
||||
}
|
||||
}
|
||||
|
@ -168,6 +168,27 @@ class SettingsGeneralTest {
|
||||
}
|
||||
}
|
||||
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun verifyHomepageOptionSummaryUpdatesTest() {
|
||||
homeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
verifyHomepageButtonSummary("Open on homepage after four hours")
|
||||
}.openHomepageSubMenu {
|
||||
verifySelectedOpeningScreenOption("Homepage after four hours of inactivity")
|
||||
clickOpeningScreenOption("Homepage")
|
||||
verifySelectedOpeningScreenOption("Homepage")
|
||||
}.goBack {
|
||||
verifyHomepageButtonSummary("Open on homepage")
|
||||
}.openHomepageSubMenu {
|
||||
clickOpeningScreenOption("Last tab")
|
||||
verifySelectedOpeningScreenOption("Last tab")
|
||||
}.goBack {
|
||||
verifyHomepageButtonSummary("Open on last tab")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun verifyTabsOptionSummaryUpdatesTest() {
|
||||
homeScreen {
|
||||
|
@ -75,7 +75,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickShortcutsButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
defaultTopSites.forEach { item ->
|
||||
verifyNotExistingTopSitesList(item)
|
||||
}
|
||||
@ -96,7 +96,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickRecentlyVisited()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyRecentlyVisitedSectionIsNotDisplayed()
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickPocketButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyPocketSectionIsNotDisplayed()
|
||||
}
|
||||
}
|
||||
@ -133,7 +133,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickJumpBackInButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyJumpBackInSectionIsNotDisplayed()
|
||||
}
|
||||
}
|
||||
@ -152,7 +152,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickRecentBookmarksButton()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyRecentBookmarksSectionIsNotDisplayed()
|
||||
}
|
||||
}
|
||||
@ -167,7 +167,7 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
}.openHomepageSubMenu {
|
||||
clickStartOnHomepageButton()
|
||||
clickOpeningScreenOption("Homepage")
|
||||
}
|
||||
|
||||
restartApp(activityIntentTestRule)
|
||||
@ -187,7 +187,7 @@ class SettingsHomepageTest {
|
||||
}.goToHomescreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
clickStartOnLastTabButton()
|
||||
clickOpeningScreenOption("Last tab")
|
||||
}
|
||||
|
||||
restartApp(activityIntentTestRule)
|
||||
@ -205,8 +205,8 @@ class SettingsHomepageTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
}.openHomepageSubMenu {
|
||||
clickStartOnHomepageButton()
|
||||
}.goBack {}
|
||||
clickOpeningScreenOption("Homepage")
|
||||
}.goBackToHomeScreen {}
|
||||
|
||||
with(activityIntentTestRule) {
|
||||
finishActivity()
|
||||
|
@ -63,7 +63,7 @@ class SponsoredShortcutsTest {
|
||||
verifySponsoredShortcutsCheckBox(true)
|
||||
clickSponsoredShortcuts()
|
||||
verifySponsoredShortcutsCheckBox(false)
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
verifyNotExistingSponsoredTopSitesList()
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class ThreeDotMenuMainTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
verifyHomePageView()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
verifySettingsView()
|
||||
@ -133,7 +133,7 @@ class ThreeDotMenuMainTest {
|
||||
}.openThreeDotMenu {
|
||||
}.openCustomizeHome {
|
||||
verifyHomePageView()
|
||||
}.goBack {
|
||||
}.goBackToHomeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openSettings {
|
||||
verifySettingsView()
|
||||
|
@ -75,6 +75,8 @@ class SettingsRobot {
|
||||
fun verifyTabsButtonSummary(summary: String) =
|
||||
assertItemContainingTextExists(itemContainingText(summary))
|
||||
fun verifyHomepageButton() = assertHomepageButton()
|
||||
fun verifyHomepageButtonSummary(summary: String) =
|
||||
assertItemContainingTextExists(itemContainingText(summary))
|
||||
fun verifyAutofillButton() = assertAutofillButton()
|
||||
fun verifyLanguageButton() = assertLanguageButton()
|
||||
fun verifyDefaultBrowserIsDisabled() = assertDefaultBrowserIsDisabled()
|
||||
|
@ -26,6 +26,7 @@ import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeShort
|
||||
import org.mozilla.fenix.helpers.TestHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper.mDevice
|
||||
import org.mozilla.fenix.helpers.click
|
||||
import org.mozilla.fenix.helpers.isChecked
|
||||
|
||||
/**
|
||||
* Implementation of Robot Pattern for the settings Homepage sub menu.
|
||||
@ -61,6 +62,14 @@ class SettingsSubMenuHomepageRobot {
|
||||
assertHomepageAfterFourHoursButton()
|
||||
}
|
||||
|
||||
fun verifySelectedOpeningScreenOption(openingScreenOption: String) =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.radio_button),
|
||||
hasSibling(withText(openingScreenOption)),
|
||||
),
|
||||
).check(matches(isChecked(true)))
|
||||
|
||||
fun clickShortcutsButton() = shortcutsButton().click()
|
||||
|
||||
fun clickSponsoredShortcuts() = sponsoredShortcutsButton().click()
|
||||
@ -75,9 +84,13 @@ class SettingsSubMenuHomepageRobot {
|
||||
|
||||
fun clickPocketButton() = pocketButton().click()
|
||||
|
||||
fun clickStartOnHomepageButton() = homepageButton().click()
|
||||
|
||||
fun clickStartOnLastTabButton() = lastTabButton().click()
|
||||
fun clickOpeningScreenOption(openingScreenOption: String) {
|
||||
when (openingScreenOption) {
|
||||
"Homepage" -> homepageButton().click()
|
||||
"Last tab" -> lastTabButton().click()
|
||||
"Homepage after four hours of inactivity" -> homepageAfterFourHoursButton().click()
|
||||
}
|
||||
}
|
||||
|
||||
fun openWallpapersMenu() = wallpapersMenuButton.click()
|
||||
|
||||
@ -96,13 +109,20 @@ class SettingsSubMenuHomepageRobot {
|
||||
|
||||
class Transition {
|
||||
|
||||
fun goBack(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
||||
fun goBackToHomeScreen(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
||||
goBackButton().click()
|
||||
|
||||
HomeScreenRobot().interact()
|
||||
return HomeScreenRobot.Transition()
|
||||
}
|
||||
|
||||
fun goBack(interact: SettingsRobot.() -> Unit): SettingsRobot.Transition {
|
||||
goBackButton().click()
|
||||
|
||||
SettingsRobot().interact()
|
||||
return SettingsRobot.Transition()
|
||||
}
|
||||
|
||||
fun clickSnackBarViewButton(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
||||
val snackBarButton = mDevice.findObject(UiSelector().text("VIEW"))
|
||||
snackBarButton.waitForExists(waitingTimeShort)
|
||||
|
Loading…
Reference in New Issue
Block a user