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/21002 update and add missing tabs setting validations

This commit is contained in:
AndiAJ 2021-08-27 14:12:50 +03:00 committed by mergify[bot]
parent 8681ba904d
commit 3af7f3dfd4
3 changed files with 29 additions and 17 deletions

View File

@ -150,17 +150,6 @@ class SettingsBasicsTest {
}
}
@Test
fun changeCloseTabsSetting() {
// Goes through the settings and verified the close tabs setting options.
homeScreen {
}.openThreeDotMenu {
}.openSettings {
}.openTabsSubMenu {
verifyOptions()
}
}
@Test
fun changeAccessibiltySettings() {
// Goes through the settings and changes the default text on a webpage, then verifies if the text has changed.

View File

@ -1499,11 +1499,13 @@ class SmokeTest {
}
@Test
fun startOnHomeSettingsMenuItemsTest() {
fun tabsSettingsMenuItemsTest() {
homeScreen {
}.openThreeDotMenu {
}.openSettings {
}.openTabsSubMenu {
verifyTabViewOptions()
verifyCloseTabsOptions()
verifyStartOnHomeOptions()
}
}

View File

@ -23,7 +23,9 @@ import org.mozilla.fenix.helpers.click
*/
class SettingsSubMenuTabsRobot {
fun verifyOptions() = assertOptions()
fun verifyTabViewOptions() = assertTabViewOptions()
fun verifyCloseTabsOptions() = assertCloseTabsOptions()
fun verifyStartOnHomeOptions() = assertStartOnHomeOptions()
@ -42,10 +44,21 @@ class SettingsSubMenuTabsRobot {
}
}
private fun assertOptions() {
afterOneDayToggle()
private fun assertTabViewOptions() {
tabViewHeading()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
listToggle()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
gridToggle()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
private fun assertCloseTabsOptions() {
closeTabsHeading()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
manuallyToggle()
.check(ViewAssertions.matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
manualToggle()
afterOneDayToggle()
.check(ViewAssertions.matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
afterOneWeekToggle()
.check(ViewAssertions.matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
@ -64,7 +77,15 @@ private fun assertStartOnHomeOptions() {
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
private fun manualToggle() = onView(withText("Manually"))
private fun tabViewHeading() = onView(withText("Tab view"))
private fun listToggle() = onView(withText("List"))
private fun gridToggle() = onView(withText("Grid"))
private fun closeTabsHeading() = onView(withText("Close tabs"))
private fun manuallyToggle() = onView(withText("Manually"))
private fun afterOneDayToggle() = onView(withText("After one day"))