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

Improve collection deletion UI coverage

This commit is contained in:
AndiAJ 2021-11-24 13:14:51 +02:00 committed by mergify[bot]
parent 413ff7cd85
commit 5934c7d6b2
2 changed files with 34 additions and 4 deletions

View File

@ -11,9 +11,11 @@ import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.mozilla.fenix.customannotations.SmokeTest
import org.mozilla.fenix.helpers.AndroidAssetDispatcher import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.FeatureSettingsHelper import org.mozilla.fenix.helpers.FeatureSettingsHelper
import org.mozilla.fenix.helpers.HomeActivityTestRule import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.TestAssetHelper
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
import org.mozilla.fenix.ui.robots.browserScreen import org.mozilla.fenix.ui.robots.browserScreen
import org.mozilla.fenix.ui.robots.homeScreen import org.mozilla.fenix.ui.robots.homeScreen
@ -273,4 +275,29 @@ class CollectionTest {
verifyMenuButton() verifyMenuButton()
} }
} }
@SmokeTest
@Test
fun undoDeleteCollectionTest() {
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, firstCollectionName)
snackBarButtonClick("VIEW")
}
homeScreen {
}.expandCollection(firstCollectionName) {
clickCollectionThreeDotButton()
selectDeleteCollection()
}
homeScreen {
verifySnackBarText("Collection deleted")
clickUndoCollectionDeletion("UNDO")
verifyCollectionIsDisplayed(firstCollectionName, true)
}
}
} }

View File

@ -151,10 +151,13 @@ class HomeScreenRobot {
mDevice.waitNotNull(findObject(By.text(expectedText)), waitingTime) mDevice.waitNotNull(findObject(By.text(expectedText)), waitingTime)
} }
fun snackBarButtonClick(expectedText: String) { fun clickUndoCollectionDeletion(expectedText: String) {
onView(allOf(withId(R.id.snackbar_btn), withText(expectedText))).check( onView(
matches(withEffectiveVisibility(Visibility.VISIBLE)) allOf(
).perform(click()) withId(R.id.snackbar_btn),
withText(expectedText)
)
).click()
} }
class Transition { class Transition {