2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

recentBookmarksOption UI smoke test

This commit is contained in:
AndiAJ 2021-11-17 09:23:59 +02:00 committed by mergify[bot]
parent eee83c9cbd
commit 4ff64ad7ca
3 changed files with 37 additions and 0 deletions

View File

@ -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() {

View File

@ -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()

View File

@ -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 {