For #24333 - Disable ui tests code affected by the migration

After migrating to compose identifying widgets and interacting with them will
need to be updated.
Checked with Oana about the approach, commenting the code seems better.
This commit is contained in:
Mugurell 2022-03-31 10:10:29 +03:00 committed by mergify[bot]
parent 1e3319f0e8
commit 6a798ebfbc
4 changed files with 391 additions and 402 deletions

View File

@ -11,16 +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
import org.mozilla.fenix.ui.robots.navigationToolbar
import org.mozilla.fenix.ui.robots.tabDrawer
/**
* Tests for verifying basic functionality of tab collections
@ -81,10 +76,10 @@ class CollectionTest {
}.openSaveToCollection {
}.selectExistingCollection(firstCollectionName) {
verifySnackBarText("Tab saved!")
}.goToHomescreen {
}.expandCollection(firstCollectionName) {
verifyTabSavedInCollection(firstWebPage.title)
verifyTabSavedInCollection(secondWebPage.title)
// }.goToHomescreen {
// }.expandCollection(firstCollectionName) {
// verifyTabSavedInCollection(firstWebPage.title)
// verifyTabSavedInCollection(secondWebPage.title)
}
}
@ -104,115 +99,115 @@ class CollectionTest {
navigationToolbar {
}.enterURLAndEnterToBrowser(secondWebPage.url) {
}.goToHomescreen {
}.expandCollection(firstCollectionName) {
clickCollectionThreeDotButton()
selectAddTabToCollection()
verifyTabsSelectedCounterText(1)
saveTabsSelectedForCollection()
verifySnackBarText("Tab saved!")
verifyTabSavedInCollection(secondWebPage.title)
// }.expandCollection(firstCollectionName) {
// clickCollectionThreeDotButton()
// selectAddTabToCollection()
// verifyTabsSelectedCounterText(1)
// saveTabsSelectedForCollection()
// verifySnackBarText("Tab saved!")
// verifyTabSavedInCollection(secondWebPage.title)
}
}
@Test
fun renameCollectionTest() {
val webPage = getGenericAsset(mockWebServer, 1)
// @Test
// fun renameCollectionTest() {
// val webPage = getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, firstCollectionName)
// verifySnackBarText("Collection saved!")
// }.closeTabDrawer {
// }.goToHomescreen {
// }.expandCollection(firstCollectionName) {
// clickCollectionThreeDotButton()
// selectRenameCollection()
// }.typeCollectionNameAndSave("renamed_collection") {}
//
// homeScreen {
// verifyCollectionIsDisplayed("renamed_collection")
// }
// }
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, firstCollectionName)
verifySnackBarText("Collection saved!")
}.closeTabDrawer {
}.goToHomescreen {
}.expandCollection(firstCollectionName) {
clickCollectionThreeDotButton()
selectRenameCollection()
}.typeCollectionNameAndSave("renamed_collection") {}
// @Test
// fun createSecondCollectionTest() {
// val webPage = getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, firstCollectionName)
// verifySnackBarText("Collection saved!")
// createCollection(webPage.title, secondCollectionName, false)
// verifySnackBarText("Collection saved!")
// }.closeTabDrawer {
// }.goToHomescreen {}
//
// homeScreen {
// verifyCollectionIsDisplayed(firstCollectionName)
// verifyCollectionIsDisplayed(secondCollectionName)
// }
// }
homeScreen {
verifyCollectionIsDisplayed("renamed_collection")
}
}
// @Test
// fun removeTabFromCollectionTest() {
// val webPage = getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, firstCollectionName)
// verifySnackBarText("Collection saved!")
// closeTab()
// }
//
// homeScreen {
// }.expandCollection(firstCollectionName) {
// removeTabFromCollection(webPage.title)
// verifyTabSavedInCollection(webPage.title, false)
// }
// // To add this step when https://github.com/mozilla-mobile/fenix/issues/13177 is fixed
// // homeScreen {
// // verifyCollectionIsDisplayed(firstCollectionName, false)
// // }
// }
@Test
fun createSecondCollectionTest() {
val webPage = getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, firstCollectionName)
verifySnackBarText("Collection saved!")
createCollection(webPage.title, secondCollectionName, false)
verifySnackBarText("Collection saved!")
}.closeTabDrawer {
}.goToHomescreen {}
homeScreen {
verifyCollectionIsDisplayed(firstCollectionName)
verifyCollectionIsDisplayed(secondCollectionName)
}
}
@Test
fun removeTabFromCollectionTest() {
val webPage = getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, firstCollectionName)
verifySnackBarText("Collection saved!")
closeTab()
}
homeScreen {
}.expandCollection(firstCollectionName) {
removeTabFromCollection(webPage.title)
verifyTabSavedInCollection(webPage.title, false)
}
// To add this step when https://github.com/mozilla-mobile/fenix/issues/13177 is fixed
// @Test
// fun swipeToRemoveTabFromCollectionTest() {
// val firstWebPage = getGenericAsset(mockWebServer, 1)
// val secondWebPage = getGenericAsset(mockWebServer, 2)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(firstWebPage.url) {
// }.openTabDrawer {
// createCollection(firstWebPage.title, firstCollectionName)
// verifySnackBarText("Collection saved!")
// closeTab()
// }
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(secondWebPage.url) {
// }.openThreeDotMenu {
// }.openSaveToCollection {
// }.selectExistingCollection(firstCollectionName) {
// }.openTabDrawer {
// closeTab()
// }
//
// homeScreen {
// }.expandCollection(firstCollectionName) {
// swipeToBottom()
// swipeCollectionItemLeft(firstWebPage.title)
// verifyTabSavedInCollection(firstWebPage.title, false)
// swipeCollectionItemRight(secondWebPage.title)
// verifyTabSavedInCollection(secondWebPage.title, false)
// }
// To add this step when https://github.com/mozilla-mobile/fenix/issues/13177 is fixed
// homeScreen {
// verifyCollectionIsDisplayed(firstCollectionName, false)
// }
}
@Test
fun swipeToRemoveTabFromCollectionTest() {
val firstWebPage = getGenericAsset(mockWebServer, 1)
val secondWebPage = getGenericAsset(mockWebServer, 2)
navigationToolbar {
}.enterURLAndEnterToBrowser(firstWebPage.url) {
}.openTabDrawer {
createCollection(firstWebPage.title, firstCollectionName)
verifySnackBarText("Collection saved!")
closeTab()
}
navigationToolbar {
}.enterURLAndEnterToBrowser(secondWebPage.url) {
}.openThreeDotMenu {
}.openSaveToCollection {
}.selectExistingCollection(firstCollectionName) {
}.openTabDrawer {
closeTab()
}
homeScreen {
}.expandCollection(firstCollectionName) {
swipeToBottom()
swipeCollectionItemLeft(firstWebPage.title)
verifyTabSavedInCollection(firstWebPage.title, false)
swipeCollectionItemRight(secondWebPage.title)
verifyTabSavedInCollection(secondWebPage.title, false)
}
// To add this step when https://github.com/mozilla-mobile/fenix/issues/13177 is fixed
// homeScreen {
// verifyCollectionIsDisplayed(firstCollectionName, false)
// }
}
// }
@Test
fun selectTabOnLongTapTest() {
@ -235,69 +230,69 @@ class CollectionTest {
verifySnackBarText("Tabs saved!")
}
tabDrawer {
}.closeTabDrawer {
}.goToHomescreen {
}.expandCollection(firstCollectionName) {
verifyTabSavedInCollection(firstWebPage.title)
verifyTabSavedInCollection(secondWebPage.title)
}
// tabDrawer {
// }.closeTabDrawer {
// }.goToHomescreen {
// }.expandCollection(firstCollectionName) {
// verifyTabSavedInCollection(firstWebPage.title)
// verifyTabSavedInCollection(secondWebPage.title)
// }
}
@Test
fun navigateBackInCollectionFlowTest() {
val webPage = getGenericAsset(mockWebServer, 1)
// @Test
// fun navigateBackInCollectionFlowTest() {
// val webPage = getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, firstCollectionName)
// verifySnackBarText("Collection saved!")
// }.closeTabDrawer {
// }.openThreeDotMenu {
// }.openSaveToCollection {
// verifySelectCollectionScreen()
// goBackInCollectionFlow()
// }
//
// browserScreen {
// }.openThreeDotMenu {
// }.openSaveToCollection {
// verifySelectCollectionScreen()
// clickAddNewCollection()
// verifyCollectionNameTextField()
// goBackInCollectionFlow()
// verifySelectCollectionScreen()
// goBackInCollectionFlow()
// }
// // verify the browser layout is visible
// browserScreen {
// verifyMenuButton()
// }
// }
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, firstCollectionName)
verifySnackBarText("Collection saved!")
}.closeTabDrawer {
}.openThreeDotMenu {
}.openSaveToCollection {
verifySelectCollectionScreen()
goBackInCollectionFlow()
}
browserScreen {
}.openThreeDotMenu {
}.openSaveToCollection {
verifySelectCollectionScreen()
clickAddNewCollection()
verifyCollectionNameTextField()
goBackInCollectionFlow()
verifySelectCollectionScreen()
goBackInCollectionFlow()
}
// verify the browser layout is visible
browserScreen {
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)
}
}
// @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

@ -40,7 +40,6 @@ import org.mozilla.fenix.helpers.TestHelper.createCustomTabIntent
import org.mozilla.fenix.helpers.TestHelper.scrollToElementByText
import org.mozilla.fenix.helpers.ViewVisibilityIdlingResource
import org.mozilla.fenix.ui.robots.browserScreen
import org.mozilla.fenix.ui.robots.collectionRobot
import org.mozilla.fenix.ui.robots.customTabScreen
import org.mozilla.fenix.ui.robots.enhancedTrackingProtection
import org.mozilla.fenix.ui.robots.homeScreen
@ -48,7 +47,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar
import org.mozilla.fenix.ui.robots.notificationShade
import org.mozilla.fenix.ui.robots.openEditURLView
import org.mozilla.fenix.ui.robots.searchScreen
import org.mozilla.fenix.ui.robots.tabDrawer
import org.mozilla.fenix.ui.util.FRENCH_LANGUAGE_HEADER
import org.mozilla.fenix.ui.util.FRENCH_SYSTEM_LOCALE_OPTION
import org.mozilla.fenix.ui.util.ROMANIAN_LANGUAGE_HEADER
@ -348,18 +346,18 @@ class SmokeTest {
}
}
@Test
// Verifies the Add to collection option in a tab's 3 dot menu
fun openMainMenuAddToCollectionTest() {
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
}.openThreeDotMenu {
}.openSaveToCollection {
verifyCollectionNameTextField()
}
}
// @Test
// // Verifies the Add to collection option in a tab's 3 dot menu
// fun openMainMenuAddToCollectionTest() {
// val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(defaultWebPage.url) {
// }.openThreeDotMenu {
// }.openSaveToCollection {
// verifyCollectionNameTextField()
// }
// }
@Test
// Verifies the Bookmark button in a tab's 3 dot menu
@ -618,172 +616,171 @@ class SmokeTest {
}
}
@Test
fun createFirstCollectionTest() {
// disabling these features to have better visibility of Collections
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
featureSettingsHelper.setPocketEnabled(false)
// @Test
// fun createFirstCollectionTest() {
// // disabling these features to have better visibility of Collections
// featureSettingsHelper.setRecentTabsFeatureEnabled(false)
// featureSettingsHelper.setPocketEnabled(false)
//
// val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
// val secondWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 2)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(firstWebPage.url) {
// mDevice.waitForIdle()
// }.openTabDrawer {
// }.openNewTab {
// }.submitQuery(secondWebPage.url.toString()) {
// mDevice.waitForIdle()
// }.goToHomescreen {
// swipeToBottom()
// }.clickSaveTabsToCollectionButton {
// longClickTab(firstWebPage.title)
// selectTab(secondWebPage.title)
// }.clickSaveCollection {
// typeCollectionNameAndSave(collectionName)
// }
//
// tabDrawer {
// verifySnackBarText("Collection saved!")
// snackBarButtonClick("VIEW")
// }
//
// homeScreen {
// verifyCollectionIsDisplayed(collectionName)
// verifyCollectionIcon()
// }
// }
val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
val secondWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 2)
navigationToolbar {
}.enterURLAndEnterToBrowser(firstWebPage.url) {
mDevice.waitForIdle()
}.openTabDrawer {
}.openNewTab {
}.submitQuery(secondWebPage.url.toString()) {
mDevice.waitForIdle()
}.goToHomescreen {
swipeToBottom()
}.clickSaveTabsToCollectionButton {
longClickTab(firstWebPage.title)
selectTab(secondWebPage.title)
}.clickSaveCollection {
typeCollectionNameAndSave(collectionName)
}
tabDrawer {
verifySnackBarText("Collection saved!")
snackBarButtonClick("VIEW")
}
homeScreen {
verifyCollectionIsDisplayed(collectionName)
verifyCollectionIcon()
}
}
@Test
fun verifyExpandedCollectionItemsTest() {
// disabling these features to have better visibility of Collections
featureSettingsHelper.setRecentTabsFeatureEnabled(false)
featureSettingsHelper.setPocketEnabled(false)
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, collectionName)
snackBarButtonClick("VIEW")
}
homeScreen {
verifyCollectionIsDisplayed(collectionName)
verifyCollectionIcon()
}.expandCollection(collectionName) {
verifyTabSavedInCollection(webPage.title)
verifyCollectionTabLogo(true)
verifyCollectionTabUrl(true)
verifyShareCollectionButtonIsVisible(true)
verifyCollectionMenuIsVisible(true)
verifyCollectionItemRemoveButtonIsVisible(webPage.title, true)
}.collapseCollection(collectionName) {}
collectionRobot {
verifyTabSavedInCollection(webPage.title, false)
verifyShareCollectionButtonIsVisible(false)
verifyCollectionMenuIsVisible(false)
verifyCollectionTabLogo(false)
verifyCollectionTabUrl(false)
verifyCollectionItemRemoveButtonIsVisible(webPage.title, false)
}
homeScreen {
}.expandCollection(collectionName) {
verifyTabSavedInCollection(webPage.title)
verifyCollectionTabLogo(true)
verifyCollectionTabUrl(true)
verifyShareCollectionButtonIsVisible(true)
verifyCollectionMenuIsVisible(true)
verifyCollectionItemRemoveButtonIsVisible(webPage.title, true)
}.collapseCollection(collectionName) {}
collectionRobot {
verifyTabSavedInCollection(webPage.title, false)
verifyShareCollectionButtonIsVisible(false)
verifyCollectionMenuIsVisible(false)
verifyCollectionTabLogo(false)
verifyCollectionTabUrl(false)
verifyCollectionItemRemoveButtonIsVisible(webPage.title, false)
}
}
@Test
fun openAllTabsInCollectionTest() {
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, collectionName)
verifySnackBarText("Collection saved!")
closeTab()
}
homeScreen {
}.expandCollection(collectionName) {
clickCollectionThreeDotButton()
selectOpenTabs()
}
tabDrawer {
verifyExistingOpenTabs(webPage.title)
}
}
@Test
fun shareCollectionTest() {
val firstWebsite = TestAssetHelper.getGenericAsset(mockWebServer, 1)
val secondWebsite = TestAssetHelper.getGenericAsset(mockWebServer, 2)
val sharingApp = "Gmail"
val urlString = "${secondWebsite.url}\n\n${firstWebsite.url}"
navigationToolbar {
}.enterURLAndEnterToBrowser(firstWebsite.url) {
verifyPageContent(firstWebsite.content)
}.openTabDrawer {
createCollection(firstWebsite.title, collectionName)
}.openNewTab {
}.submitQuery(secondWebsite.url.toString()) {
verifyPageContent(secondWebsite.content)
}.openThreeDotMenu {
}.openSaveToCollection {
}.selectExistingCollection(collectionName) {
}.goToHomescreen {
}.expandCollection(collectionName) {
}.clickShareCollectionButton {
verifyShareTabsOverlay(firstWebsite.title, secondWebsite.title)
selectAppToShareWith(sharingApp)
verifySharedTabsIntent(urlString, collectionName)
}
}
@Ignore("Failing, see: https://github.com/mozilla-mobile/fenix/issues/23296")
@Test
// Test running on beta/release builds in CI:
// caution when making changes to it, so they don't block the builds
fun deleteCollectionTest() {
val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(webPage.url) {
}.openTabDrawer {
createCollection(webPage.title, collectionName)
snackBarButtonClick("VIEW")
}
homeScreen {
}.expandCollection(collectionName) {
clickCollectionThreeDotButton()
selectDeleteCollection()
}
homeScreen {
verifySnackBarText("Collection deleted")
verifyNoCollectionsText()
}
}
// @Test
// fun verifyExpandedCollectionItemsTest() {
// // disabling these features to have better visibility of Collections
// featureSettingsHelper.setRecentTabsFeatureEnabled(false)
// featureSettingsHelper.setPocketEnabled(false)
//
// val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, collectionName)
// snackBarButtonClick("VIEW")
// }
//
// homeScreen {
// verifyCollectionIsDisplayed(collectionName)
// verifyCollectionIcon()
// }.expandCollection(collectionName) {
// verifyTabSavedInCollection(webPage.title)
// verifyCollectionTabLogo(true)
// verifyCollectionTabUrl(true)
// verifyShareCollectionButtonIsVisible(true)
// verifyCollectionMenuIsVisible(true)
// verifyCollectionItemRemoveButtonIsVisible(webPage.title, true)
// }.collapseCollection(collectionName) {}
//
// collectionRobot {
// verifyTabSavedInCollection(webPage.title, false)
// verifyShareCollectionButtonIsVisible(false)
// verifyCollectionMenuIsVisible(false)
// verifyCollectionTabLogo(false)
// verifyCollectionTabUrl(false)
// verifyCollectionItemRemoveButtonIsVisible(webPage.title, false)
// }
//
// homeScreen {
// }.expandCollection(collectionName) {
// verifyTabSavedInCollection(webPage.title)
// verifyCollectionTabLogo(true)
// verifyCollectionTabUrl(true)
// verifyShareCollectionButtonIsVisible(true)
// verifyCollectionMenuIsVisible(true)
// verifyCollectionItemRemoveButtonIsVisible(webPage.title, true)
// }.collapseCollection(collectionName) {}
//
// collectionRobot {
// verifyTabSavedInCollection(webPage.title, false)
// verifyShareCollectionButtonIsVisible(false)
// verifyCollectionMenuIsVisible(false)
// verifyCollectionTabLogo(false)
// verifyCollectionTabUrl(false)
// verifyCollectionItemRemoveButtonIsVisible(webPage.title, false)
// }
// }
//
// @Test
// fun openAllTabsInCollectionTest() {
// val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, collectionName)
// verifySnackBarText("Collection saved!")
// closeTab()
// }
//
// homeScreen {
// }.expandCollection(collectionName) {
// clickCollectionThreeDotButton()
// selectOpenTabs()
// }
// tabDrawer {
// verifyExistingOpenTabs(webPage.title)
// }
// }
//
// @Test
// fun shareCollectionTest() {
// val firstWebsite = TestAssetHelper.getGenericAsset(mockWebServer, 1)
// val secondWebsite = TestAssetHelper.getGenericAsset(mockWebServer, 2)
// val sharingApp = "Gmail"
// val urlString = "${secondWebsite.url}\n\n${firstWebsite.url}"
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(firstWebsite.url) {
// verifyPageContent(firstWebsite.content)
// }.openTabDrawer {
// createCollection(firstWebsite.title, collectionName)
// }.openNewTab {
// }.submitQuery(secondWebsite.url.toString()) {
// verifyPageContent(secondWebsite.content)
// }.openThreeDotMenu {
// }.openSaveToCollection {
// }.selectExistingCollection(collectionName) {
// }.goToHomescreen {
// }.expandCollection(collectionName) {
// }.clickShareCollectionButton {
// verifyShareTabsOverlay(firstWebsite.title, secondWebsite.title)
// selectAppToShareWith(sharingApp)
// verifySharedTabsIntent(urlString, collectionName)
// }
// }
//
// @Test
// // Test running on beta/release builds in CI:
// // caution when making changes to it, so they don't block the builds
// fun deleteCollectionTest() {
// val webPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
//
// navigationToolbar {
// }.enterURLAndEnterToBrowser(webPage.url) {
// }.openTabDrawer {
// createCollection(webPage.title, collectionName)
// snackBarButtonClick("VIEW")
// }
//
// homeScreen {
// }.expandCollection(collectionName) {
// clickCollectionThreeDotButton()
// selectDeleteCollection()
// }
//
// homeScreen {
// verifySnackBarText("Collection deleted")
// verifyNoCollectionsText()
// }
// }
@Test
// Verifies that deleting a Bookmarks folder also removes the item from inside it.

View File

@ -98,33 +98,33 @@ class CollectionRobot {
)
}
fun verifyShareCollectionButtonIsVisible(visible: Boolean) {
shareCollectionButton()
.check(
if (visible) matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))
else matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))
)
}
// fun verifyShareCollectionButtonIsVisible(visible: Boolean) {
// shareCollectionButton()
// .check(
// if (visible) matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))
// else matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))
// )
// }
fun verifyCollectionMenuIsVisible(visible: Boolean) {
collectionThreeDotButton()
.check(
if (visible) matches(
withEffectiveVisibility(
ViewMatchers.Visibility.VISIBLE
)
)
else matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))
)
}
// fun verifyCollectionMenuIsVisible(visible: Boolean) {
// collectionThreeDotButton()
// .check(
// if (visible) matches(
// withEffectiveVisibility(
// ViewMatchers.Visibility.VISIBLE
// )
// )
// else matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))
// )
// }
fun clickCollectionThreeDotButton() {
collectionThreeDotButton().click()
mDevice.waitNotNull(
Until.findObject(By.text("Delete collection")),
waitingTime
)
}
// fun clickCollectionThreeDotButton() {
// collectionThreeDotButton().click()
// mDevice.waitNotNull(
// Until.findObject(By.text("Delete collection")),
// waitingTime
// )
// }
fun selectOpenTabs() {
onView(withText("Open tabs")).click()
@ -251,12 +251,12 @@ class CollectionRobot {
return BrowserRobot.Transition()
}
fun clickShareCollectionButton(interact: ShareOverlayRobot.() -> Unit): ShareOverlayRobot.Transition {
shareCollectionButton().click()
ShareOverlayRobot().interact()
return ShareOverlayRobot.Transition()
}
// fun clickShareCollectionButton(interact: ShareOverlayRobot.() -> Unit): ShareOverlayRobot.Transition {
// shareCollectionButton().click()
//
// ShareOverlayRobot().interact()
// return ShareOverlayRobot.Transition()
// }
}
}
@ -265,13 +265,13 @@ fun collectionRobot(interact: CollectionRobot.() -> Unit): CollectionRobot.Trans
return CollectionRobot.Transition()
}
private fun collectionThreeDotButton() =
onView(withId(R.id.collection_overflow_button))
// private fun collectionThreeDotButton() =
// onView(withId(R.id.collection_overflow_button))
private fun collectionItem(title: String) =
onView(allOf(withId(R.id.label), withText(title)))
private fun shareCollectionButton() = onView(withId(R.id.collection_share_button))
// private fun shareCollectionButton() = onView(withId(R.id.collection_share_button))
private fun removeTabFromCollectionButton(title: String) =
onView(

View File

@ -399,21 +399,21 @@ class HomeScreenRobot {
return TabDrawerRobot.Transition()
}
fun expandCollection(
title: String,
interact: CollectionRobot.() -> Unit
): CollectionRobot.Transition {
// Depending on the screen dimensions collections might report as visible on screen
// but actually have the bottom toolbar above so interactions with collections might fail.
// As a quick solution we'll try scrolling to the element below collection on the homescreen
// so that they are displayed above in their entirety.
scrollToElementByText(appContext.getString(R.string.pocket_stories_header_1))
collectionTitle(title).click()
CollectionRobot().interact()
return CollectionRobot.Transition()
}
// fun expandCollection(
// title: String,
// interact: CollectionRobot.() -> Unit
// ): CollectionRobot.Transition {
// // Depending on the screen dimensions collections might report as visible on screen
// // but actually have the bottom toolbar above so interactions with collections might fail.
// // As a quick solution we'll try scrolling to the element below collection on the homescreen
// // so that they are displayed above in their entirety.
// scrollToElementByText(appContext.getString(R.string.pocket_stories_header_1))
//
// collectionTitle(title).click()
//
// CollectionRobot().interact()
// return CollectionRobot.Transition()
// }
fun openRecentlyVisitedSearchGroupHistoryList(
title: String,
@ -670,9 +670,6 @@ private fun assertPrivateSessionMessage() =
).waitForExists(waitingTime)
)
private fun collectionTitle(title: String) =
onView(allOf(withId(R.id.collection_title), withText(title)))
private fun assertExistingTopSitesList() =
onView(allOf(withId(R.id.top_sites_list)))
.check((matches(withEffectiveVisibility(Visibility.VISIBLE))))