2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/19090: Re-enable createFirstCollectionTest, shareCollectionTest, deleteCollectionTest

This commit is contained in:
Oana Horvath 2021-06-11 11:55:29 +03:00
parent 76e4acdb54
commit deeca45cff
2 changed files with 29 additions and 14 deletions

View File

@ -37,6 +37,7 @@ import org.mozilla.fenix.helpers.ViewVisibilityIdlingResource
import org.mozilla.fenix.ui.robots.browserScreen import org.mozilla.fenix.ui.robots.browserScreen
import org.mozilla.fenix.ui.robots.clickTabCrashedRestoreButton import org.mozilla.fenix.ui.robots.clickTabCrashedRestoreButton
import org.mozilla.fenix.ui.robots.clickUrlbar import org.mozilla.fenix.ui.robots.clickUrlbar
import org.mozilla.fenix.ui.robots.collectionRobot
import org.mozilla.fenix.ui.robots.customTabScreen import org.mozilla.fenix.ui.robots.customTabScreen
import org.mozilla.fenix.ui.robots.dismissTrackingOnboarding import org.mozilla.fenix.ui.robots.dismissTrackingOnboarding
import org.mozilla.fenix.ui.robots.downloadRobot import org.mozilla.fenix.ui.robots.downloadRobot
@ -877,7 +878,6 @@ class SmokeTest {
} }
} }
@Ignore("Enable after #19738 and #19090 land.")
@Test @Test
fun createFirstCollectionTest() { fun createFirstCollectionTest() {
val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
@ -892,10 +892,13 @@ class SmokeTest {
mDevice.waitForIdle() mDevice.waitForIdle()
}.goToHomescreen { }.goToHomescreen {
}.clickSaveTabsToCollectionButton { }.clickSaveTabsToCollectionButton {
selectTab(firstWebPage.title) longClickTab(firstWebPage.title)
selectTab(secondWebPage.title) longClickTab(secondWebPage.title)
clickSaveCollection() }.clickSaveCollection {
typeCollectionName(collectionName) typeCollectionNameAndSave(collectionName)
}
tabDrawer {
verifySnackBarText("Collection saved!") verifySnackBarText("Collection saved!")
snackBarButtonClick("VIEW") snackBarButtonClick("VIEW")
} }
@ -920,14 +923,16 @@ class SmokeTest {
homeScreen { homeScreen {
verifyCollectionIsDisplayed(collectionName) verifyCollectionIsDisplayed(collectionName)
verifyCollectionIcon() verifyCollectionIcon()
expandCollection(collectionName) }.expandCollection(collectionName) {
verifyTabSavedInCollection(webPage.title) verifyTabSavedInCollection(webPage.title)
verifyCollectionTabLogo() verifyCollectionTabLogo()
verifyCollectionTabUrl() verifyCollectionTabUrl()
verifyShareCollectionButtonIsVisible(true) verifyShareCollectionButtonIsVisible(true)
verifyCollectionMenuIsVisible(true) verifyCollectionMenuIsVisible(true)
verifyCollectionItemRemoveButtonIsVisible(webPage.title, true) verifyCollectionItemRemoveButtonIsVisible(webPage.title, true)
collapseCollection(collectionName) }.collapseCollection(collectionName) {}
collectionRobot {
verifyTabSavedInCollection(webPage.title, false) verifyTabSavedInCollection(webPage.title, false)
verifyShareCollectionButtonIsVisible(false) verifyShareCollectionButtonIsVisible(false)
verifyCollectionMenuIsVisible(false) verifyCollectionMenuIsVisible(false)
@ -942,11 +947,12 @@ class SmokeTest {
}.enterURLAndEnterToBrowser(webPage.url) { }.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer { }.openTabDrawer {
createCollection(webPage.title, collectionName) createCollection(webPage.title, collectionName)
verifySnackBarText("Collection saved!")
closeTab() closeTab()
} }
browserScreen {
}.goToHomescreen { homeScreen {
expandCollection(collectionName) }.expandCollection(collectionName) {
clickCollectionThreeDotButton() clickCollectionThreeDotButton()
selectOpenTabs() selectOpenTabs()
} }
@ -955,7 +961,6 @@ class SmokeTest {
} }
} }
@Ignore("Disabling until re-implemented by #19090")
@Test @Test
fun shareCollectionTest() { fun shareCollectionTest() {
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
@ -966,14 +971,17 @@ class SmokeTest {
createCollection(webPage.title, collectionName) createCollection(webPage.title, collectionName)
snackBarButtonClick("VIEW") snackBarButtonClick("VIEW")
} }
homeScreen { homeScreen {
expandCollection(collectionName) }.expandCollection(collectionName) {
clickShareCollectionButton() clickShareCollectionButton()
}
homeScreen {
verifyShareTabsOverlay() verifyShareTabsOverlay()
} }
} }
@Ignore("Disabling until re-implemented by #19090")
@Test @Test
fun deleteCollectionTest() { fun deleteCollectionTest() {
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
@ -984,11 +992,15 @@ class SmokeTest {
createCollection(webPage.title, collectionName) createCollection(webPage.title, collectionName)
snackBarButtonClick("VIEW") snackBarButtonClick("VIEW")
} }
homeScreen { homeScreen {
expandCollection(collectionName) }.expandCollection(collectionName) {
clickCollectionThreeDotButton() clickCollectionThreeDotButton()
selectDeleteCollection() selectDeleteCollection()
confirmDeleteCollection() confirmDeleteCollection()
}
homeScreen {
verifyNoCollectionsText() verifyNoCollectionsText()
} }
} }

View File

@ -119,8 +119,10 @@ class HomeScreenRobot {
// Collections elements // Collections elements
fun verifyCollectionIsDisplayed(title: String, collectionExists: Boolean = true) { fun verifyCollectionIsDisplayed(title: String, collectionExists: Boolean = true) {
if (collectionExists) { if (collectionExists) {
scrollToElementByText(title)
assertTrue(mDevice.findObject(UiSelector().text(title)).waitForExists(waitingTime)) assertTrue(mDevice.findObject(UiSelector().text(title)).waitForExists(waitingTime))
} else { } else {
scrollToElementByText("Collections")
assertTrue(mDevice.findObject(UiSelector().text(title)).waitUntilGone(waitingTime)) assertTrue(mDevice.findObject(UiSelector().text(title)).waitUntilGone(waitingTime))
} }
} }
@ -311,6 +313,7 @@ class HomeScreenRobot {
collectionTitle(title).click() collectionTitle(title).click()
} catch (e: NoMatchingViewException) { } catch (e: NoMatchingViewException) {
scrollToElementByText(title) scrollToElementByText(title)
collectionTitle(title).click()
} }
CollectionRobot().interact() CollectionRobot().interact()