recentBookmarksOption UI smoke test

upstream-sync
AndiAJ 3 years ago committed by mergify[bot]
parent eee83c9cbd
commit 4ff64ad7ca

@ -205,6 +205,26 @@ class SettingsBasicsTest {
} }
} }
@SmokeTest
@Test
fun recentBookmarksOptionTest() {
val genericURL = getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(genericURL.url) {
mDevice.waitForIdle()
}.openThreeDotMenu {
}.bookmarkPage {
}.goToHomescreen {
verifyRecentBookmarksSectionIsDisplayed()
}.openThreeDotMenu {
}.openCustomizeHome {
clickRecentBookmarksButton()
}.goBack {
verifyRecentBookmarksSectionIsNotDisplayed()
}
}
@SmokeTest @SmokeTest
@Test @Test
fun startOnHomepageTest() { fun startOnHomepageTest() {

@ -120,6 +120,8 @@ class HomeScreenRobot {
fun verifyJumpBackInSectionIsDisplayed() = assertJumpBackInSectionIsDisplayed() fun verifyJumpBackInSectionIsDisplayed() = assertJumpBackInSectionIsDisplayed()
fun verifyJumpBackInSectionIsNotDisplayed() = assertJumpBackInSectionIsNotDisplayed() fun verifyJumpBackInSectionIsNotDisplayed() = assertJumpBackInSectionIsNotDisplayed()
fun verifyRecentBookmarksSectionIsDisplayed() = assertRecentBookmarksSectionIsDisplayed()
fun verifyRecentBookmarksSectionIsNotDisplayed() = assertRecentBookmarksSectionIsNotDisplayed()
// Collections elements // Collections elements
fun verifyCollectionIsDisplayed(title: String, collectionExists: Boolean = true) { fun verifyCollectionIsDisplayed(title: String, collectionExists: Boolean = true) {
@ -593,6 +595,12 @@ private fun assertJumpBackInSectionIsDisplayed() = jumpBackInSection().check(mat
private fun assertJumpBackInSectionIsNotDisplayed() = jumpBackInSection().check(doesNotExist()) private fun assertJumpBackInSectionIsNotDisplayed() = jumpBackInSection().check(doesNotExist())
private fun assertRecentBookmarksSectionIsDisplayed() =
recentBookmarksSection().check(matches(isDisplayed()))
private fun assertRecentBookmarksSectionIsNotDisplayed() =
recentBookmarksSection().check(doesNotExist())
private fun privateBrowsingButton() = onView(withId(R.id.privateBrowsingButton)) private fun privateBrowsingButton() = onView(withId(R.id.privateBrowsingButton))
private fun saveTabsToCollectionButton() = onView(withId(R.id.add_tabs_to_collections_button)) private fun saveTabsToCollectionButton() = onView(withId(R.id.add_tabs_to_collections_button))
@ -607,6 +615,14 @@ private fun jumpBackInSection() =
) )
) )
private fun recentBookmarksSection() =
onView(
allOf(
withText(R.string.recent_bookmarks_title),
hasSibling(withText(R.string.recently_saved_show_all))
)
)
private fun startBrowsingButton(): UiObject { private fun startBrowsingButton(): UiObject {
val startBrowsingButton = mDevice.findObject(UiSelector().resourceId("$packageName:id/finish_button")) val startBrowsingButton = mDevice.findObject(UiSelector().resourceId("$packageName:id/finish_button"))
homeScreenList() homeScreenList()

@ -30,6 +30,7 @@ class SettingsSubMenuHomepageRobot {
} }
fun clickJumpBackInButton() = jumpBackInButton().click() fun clickJumpBackInButton() = jumpBackInButton().click()
fun clickRecentBookmarksButton() = recentBookmarksButton().click()
fun clickStartOnHomepageButton() = homepageButton().click() fun clickStartOnHomepageButton() = homepageButton().click()
class Transition { class Transition {

Loading…
Cancel
Save