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:
parent
413ff7cd85
commit
5934c7d6b2
@ -11,9 +11,11 @@ import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.customannotations.SmokeTest
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.FeatureSettingsHelper
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
|
||||
import org.mozilla.fenix.ui.robots.browserScreen
|
||||
import org.mozilla.fenix.ui.robots.homeScreen
|
||||
@ -273,4 +275,29 @@ class CollectionTest {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,10 +151,13 @@ class HomeScreenRobot {
|
||||
mDevice.waitNotNull(findObject(By.text(expectedText)), waitingTime)
|
||||
}
|
||||
|
||||
fun snackBarButtonClick(expectedText: String) {
|
||||
onView(allOf(withId(R.id.snackbar_btn), withText(expectedText))).check(
|
||||
matches(withEffectiveVisibility(Visibility.VISIBLE))
|
||||
).perform(click())
|
||||
fun clickUndoCollectionDeletion(expectedText: String) {
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.snackbar_btn),
|
||||
withText(expectedText)
|
||||
)
|
||||
).click()
|
||||
}
|
||||
|
||||
class Transition {
|
||||
|
Loading…
Reference in New Issue
Block a user