For #26286 new verifyUndoRemoveTopSite UI test
This commit is contained in:
parent
a24e874c65
commit
679cd403e6
|
@ -493,7 +493,7 @@ class CollectionTest {
|
|||
|
||||
homeScreen {
|
||||
verifySnackBarText("Collection deleted")
|
||||
clickUndoCollectionDeletion("UNDO")
|
||||
clickUndoSnackBarButton()
|
||||
verifyCollectionIsDisplayed(collectionName, true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,6 +169,28 @@ class TopSitesTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun verifyUndoRemoveTopSite() {
|
||||
val defaultWebPage = getGenericAsset(mockWebServer, 1)
|
||||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
}.openThreeDotMenu {
|
||||
expandMenu()
|
||||
verifyAddToShortcutsButton()
|
||||
}.addToFirefoxHome {
|
||||
verifySnackBarText(getStringResource(R.string.snackbar_added_to_shortcuts))
|
||||
}.goToHomescreen {
|
||||
verifyExistingTopSitesList()
|
||||
verifyExistingTopSitesTabs(defaultWebPage.title)
|
||||
}.openContextMenuOnTopSitesWithTitle(defaultWebPage.title) {
|
||||
verifyTopSiteContextMenuItems()
|
||||
}.removeTopSite {
|
||||
clickUndoSnackBarButton()
|
||||
verifyExistingTopSitesTabs(defaultWebPage.title)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun verifyRemoveTopSiteFromMainMenu() {
|
||||
val defaultWebPage = getGenericAsset(mockWebServer, 1)
|
||||
|
|
|
@ -305,14 +305,7 @@ class HomeScreenRobot {
|
|||
mDevice.waitNotNull(findObject(By.text(expectedText)), waitingTime)
|
||||
}
|
||||
|
||||
fun clickUndoCollectionDeletion(expectedText: String) {
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.snackbar_btn),
|
||||
withText(expectedText),
|
||||
),
|
||||
).click()
|
||||
}
|
||||
fun clickUndoSnackBarButton() = undoSnackBarButton.click()
|
||||
|
||||
fun clickFirefoxLogo() = homepageWordmark.click()
|
||||
|
||||
|
@ -1096,6 +1089,8 @@ private val menuButton =
|
|||
itemWithResId("$packageName:id/menuButton")
|
||||
private fun tabCounter(numberOfOpenTabs: String) =
|
||||
itemWithResIdAndText("$packageName:id/counter_text", numberOfOpenTabs)
|
||||
private val undoSnackBarButton =
|
||||
itemWithResId("$packageName:id/snackbar_btn")
|
||||
|
||||
val deleteFromHistory =
|
||||
onView(
|
||||
|
|
Loading…
Reference in New Issue