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

Bug 1858607 - Top sites TestRail matching

This commit is contained in:
AndiAJ 2023-10-11 14:45:41 +03:00 committed by mergify[bot]
parent 2c6401dc63
commit 1bad550c3f
5 changed files with 35 additions and 59 deletions

View File

@ -62,7 +62,7 @@ class ComposeTopSitesTest {
@SmokeTest @SmokeTest
@Test @Test
fun verifyAddToFirefoxHome() { fun addAWebsiteAsATopSiteTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -79,7 +79,7 @@ class ComposeTopSitesTest {
} }
@Test @Test
fun verifyOpenTopSiteNormalTab() { fun openTopSiteInANewTabTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -106,7 +106,7 @@ class ComposeTopSitesTest {
} }
@Test @Test
fun verifyOpenTopSitePrivateTab() { fun openTopSiteInANewPrivateTabTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -127,7 +127,7 @@ class ComposeTopSitesTest {
} }
@Test @Test
fun verifyRenameTopSite() { fun renameATopSiteTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
val newPageTitle = generateRandomString(5) val newPageTitle = generateRandomString(5)
@ -151,28 +151,7 @@ class ComposeTopSitesTest {
} }
@Test @Test
fun verifyRemoveTopSite() { fun removeTopSiteUsingMenuButtonTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
}.openThreeDotMenu {
expandMenu()
verifyAddToShortcutsButton(true)
}.addToFirefoxHome {
verifySnackBarText(getStringResource(R.string.snackbar_added_to_shortcuts))
}.goToHomescreenWithComposeTopSites(composeTestRule) {
verifyExistingTopSitesList()
verifyExistingTopSiteItem(defaultWebPage.title)
}.openContextMenuOnTopSitesWithTitle(defaultWebPage.title) {
verifyTopSiteContextMenuItems()
}.removeTopSite {
verifyNotExistingTopSiteItem(defaultWebPage.title)
}
}
@Test
fun verifyUndoRemoveTopSite() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -190,11 +169,15 @@ class ComposeTopSitesTest {
}.removeTopSite { }.removeTopSite {
clickSnackbarButton("UNDO") clickSnackbarButton("UNDO")
verifyExistingTopSiteItem(defaultWebPage.title) verifyExistingTopSiteItem(defaultWebPage.title)
}.openContextMenuOnTopSitesWithTitle(defaultWebPage.title) {
verifyTopSiteContextMenuItems()
}.removeTopSite {
verifyNotExistingTopSiteItem(defaultWebPage.title)
} }
} }
@Test @Test
fun verifyRemoveTopSiteFromMainMenu() { fun removeTopSiteFromMainMenuTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -218,7 +201,7 @@ class ComposeTopSitesTest {
// Expected for en-us defaults // Expected for en-us defaults
@Test @Test
fun verifyDefaultTopSitesList() { fun verifyENLocalesDefaultTopSitesListTest() {
homeScreenWithComposeTopSites(composeTestRule) { homeScreenWithComposeTopSites(composeTestRule) {
verifyExistingTopSitesList() verifyExistingTopSitesList()
val topSitesTitles = arrayListOf("Google", "Top Articles", "Wikipedia") val topSitesTitles = arrayListOf("Google", "Top Articles", "Wikipedia")

View File

@ -67,7 +67,7 @@ class PDFViewerTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/edit/2159718/1 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2159718
@Test @Test
fun verifyPDFViewerOpenInAppButtonTest() { fun verifyPDFViewerOpenInAppButtonTest() {
val genericURL = getGenericAsset(mockWebServer, 3) val genericURL = getGenericAsset(mockWebServer, 3)

View File

@ -55,9 +55,10 @@ class TopSitesTest {
mockWebServer.shutdown() mockWebServer.shutdown()
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/532598
@SmokeTest @SmokeTest
@Test @Test
fun verifyAddToFirefoxHome() { fun addAWebsiteAsATopSiteTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -73,8 +74,9 @@ class TopSitesTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/532599
@Test @Test
fun verifyOpenTopSiteNormalTab() { fun openTopSiteInANewTabTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -100,8 +102,9 @@ class TopSitesTest {
mDevice.pressBack() mDevice.pressBack()
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/532600
@Test @Test
fun verifyOpenTopSitePrivateTab() { fun openTopSiteInANewPrivateTabTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -121,8 +124,9 @@ class TopSitesTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/1110321
@Test @Test
fun verifyRenameTopSite() { fun renameATopSiteTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
val newPageTitle = generateRandomString(5) val newPageTitle = generateRandomString(5)
@ -145,29 +149,9 @@ class TopSitesTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/532601
@Test @Test
fun verifyRemoveTopSite() { fun removeTopSiteUsingMenuButtonTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar {
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
}.openThreeDotMenu {
expandMenu()
verifyAddToShortcutsButton(shouldExist = true)
}.addToFirefoxHome {
verifySnackBarText(getStringResource(R.string.snackbar_added_to_shortcuts))
}.goToHomescreen {
verifyExistingTopSitesList()
verifyExistingTopSitesTabs(defaultWebPage.title)
}.openContextMenuOnTopSitesWithTitle(defaultWebPage.title) {
verifyTopSiteContextMenuItems()
}.removeTopSite {
verifyNotExistingTopSitesList(defaultWebPage.title)
}
}
@Test
fun verifyUndoRemoveTopSite() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -185,11 +169,16 @@ class TopSitesTest {
}.removeTopSite { }.removeTopSite {
clickSnackbarButton("UNDO") clickSnackbarButton("UNDO")
verifyExistingTopSitesTabs(defaultWebPage.title) verifyExistingTopSitesTabs(defaultWebPage.title)
}.openContextMenuOnTopSitesWithTitle(defaultWebPage.title) {
verifyTopSiteContextMenuItems()
}.removeTopSite {
verifyNotExistingTopSitesList(defaultWebPage.title)
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2323641
@Test @Test
fun verifyRemoveTopSiteFromMainMenu() { fun removeTopSiteFromMainMenuTest() {
val defaultWebPage = getGenericAsset(mockWebServer, 1) val defaultWebPage = getGenericAsset(mockWebServer, 1)
navigationToolbar { navigationToolbar {
@ -211,9 +200,10 @@ class TopSitesTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/561582
// Expected for en-us defaults // Expected for en-us defaults
@Test @Test
fun verifyDefaultTopSitesList() { fun verifyENLocalesDefaultTopSitesListTest() {
homeScreen { homeScreen {
verifyExistingTopSitesList() verifyExistingTopSitesList()
defaultTopSitesList.values.forEach { value -> defaultTopSitesList.values.forEach { value ->
@ -222,6 +212,7 @@ class TopSitesTest {
} }
} }
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/1050642
@SmokeTest @SmokeTest
@Test @Test
fun addAndRemoveMostViewedTopSiteTest() { fun addAndRemoveMostViewedTopSiteTest() {

View File

@ -17,12 +17,14 @@ import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollTo import androidx.compose.ui.test.performScrollTo
import androidx.compose.ui.test.performTouchInput import androidx.compose.ui.test.performTouchInput
import androidx.test.uiautomator.UiSelector
import org.mozilla.fenix.helpers.HomeActivityComposeTestRule import org.mozilla.fenix.helpers.HomeActivityComposeTestRule
import org.mozilla.fenix.helpers.MatcherHelper.itemContainingText import org.mozilla.fenix.helpers.MatcherHelper.itemContainingText
import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId
import org.mozilla.fenix.helpers.MatcherHelper.itemWithResIdContainingText import org.mozilla.fenix.helpers.MatcherHelper.itemWithResIdContainingText
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeShort import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeShort
import org.mozilla.fenix.helpers.TestHelper.mDevice
import org.mozilla.fenix.helpers.TestHelper.packageName import org.mozilla.fenix.helpers.TestHelper.packageName
import org.mozilla.fenix.home.topsites.TopSitesTestTag import org.mozilla.fenix.home.topsites.TopSitesTestTag
@ -37,7 +39,7 @@ class ComposeTopSitesRobot(private val composeTestRule: HomeActivityComposeTestR
@OptIn(ExperimentalTestApi::class) @OptIn(ExperimentalTestApi::class)
fun verifyExistingTopSiteItem(vararg titles: String) { fun verifyExistingTopSiteItem(vararg titles: String) {
titles.forEach { title -> titles.forEach { title ->
composeTestRule.waitUntilAtLeastOneExists(hasText(title), waitingTime) mDevice.findObject(UiSelector().textContains(title)).waitForExists(waitingTimeShort)
composeTestRule.topSiteItem(title).assertExists() composeTestRule.topSiteItem(title).assertExists()
} }
} }

View File

@ -31,7 +31,7 @@ gcloud:
- class org.mozilla.fenix.ui.HistoryTest#noHistoryInPrivateBrowsingTest - class org.mozilla.fenix.ui.HistoryTest#noHistoryInPrivateBrowsingTest
- class org.mozilla.fenix.ui.TabbedBrowsingTest#openNewTabTest - class org.mozilla.fenix.ui.TabbedBrowsingTest#openNewTabTest
- class org.mozilla.fenix.ui.TabbedBrowsingTest#openNewPrivateTabTest - class org.mozilla.fenix.ui.TabbedBrowsingTest#openNewPrivateTabTest
- class org.mozilla.fenix.ui.TopSitesTest#verifyOpenTopSiteNormalTab - class org.mozilla.fenix.ui.TopSitesTest#openTopSiteInANewTabTest
- class org.mozilla.fenix.ui.BookmarksTest#addBookmarkTest - class org.mozilla.fenix.ui.BookmarksTest#addBookmarkTest
device: device: