mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
Bug 1859564 - Context menus TestRail matching
This commit is contained in:
parent
7a8ea95ed6
commit
2d55fe6f6b
@ -76,7 +76,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkNewTab() {
|
fun verifyOpenLinkNewTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -99,7 +99,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkPrivateTab() {
|
fun verifyOpenLinkInNewPrivateTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -121,7 +121,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyLink() {
|
fun verifyCopyLinkContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -141,29 +141,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyLinkNotDisplayedAfterApplied() {
|
fun verifyShareLinkContextMenuOptionTest() {
|
||||||
val pageLinks = TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
|
||||||
val genericURL = TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
|
||||||
|
|
||||||
navigationToolbar {
|
|
||||||
}.enterURLAndEnterToBrowser(pageLinks.url) {
|
|
||||||
longClickPageObject(itemWithText("Link 3"))
|
|
||||||
verifyContextMenuForLocalHostLinks(genericURL.url)
|
|
||||||
clickContextMenuItem("Copy link")
|
|
||||||
verifySnackBarText("Link copied to clipboard")
|
|
||||||
}.openNavigationToolbar {
|
|
||||||
}.visitLinkFromClipboard {
|
|
||||||
verifyUrl(genericURL.url.toString())
|
|
||||||
}.openComposeTabDrawer(composeTestRule) {
|
|
||||||
}.openNewTab {
|
|
||||||
}
|
|
||||||
navigationToolbar {
|
|
||||||
verifyClipboardSuggestionsAreDisplayed(shouldBeDisplayed = false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun verifyContextShareLink() {
|
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -182,7 +160,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenImageNewTab() {
|
fun verifyOpenImageNewTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -201,7 +179,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyImageLocation() {
|
fun verifyCopyImageLocationContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -221,7 +199,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextSaveImage() {
|
fun verifySaveImageContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -244,7 +222,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextMixedVariations() {
|
fun verifyContextMenuLinkVariationsTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -267,7 +245,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextMixedVariationsInPDFTest() {
|
fun verifyPDFContextMenuLinkVariationsTest() {
|
||||||
val genericURL =
|
val genericURL =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
||||||
|
|
||||||
@ -287,7 +265,7 @@ class ComposeContextMenusTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkInAppTest() {
|
fun verifyOpenLinkInAppContextMenuOptionTest() {
|
||||||
val defaultWebPage = TestAssetHelper.getExternalLinksAsset(mockWebServer)
|
val defaultWebPage = TestAssetHelper.getExternalLinksAsset(mockWebServer)
|
||||||
|
|
||||||
navigationToolbar {
|
navigationToolbar {
|
||||||
|
@ -10,7 +10,6 @@ import androidx.test.uiautomator.UiDevice
|
|||||||
import okhttp3.mockwebserver.MockWebServer
|
import okhttp3.mockwebserver.MockWebServer
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
@ -70,8 +69,9 @@ class ContextMenusTest {
|
|||||||
mockWebServer.shutdown()
|
mockWebServer.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243837
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkNewTab() {
|
fun verifyOpenLinkNewTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -93,8 +93,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/244655
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkPrivateTab() {
|
fun verifyOpenLinkInNewPrivateTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -115,8 +116,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243832
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyLink() {
|
fun verifyCopyLinkContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -135,31 +137,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Failing, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1807268")
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243838
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyLinkNotDisplayedAfterApplied() {
|
fun verifyShareLinkContextMenuOptionTest() {
|
||||||
val pageLinks = TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
|
||||||
val genericURL = TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
|
||||||
|
|
||||||
navigationToolbar {
|
|
||||||
}.enterURLAndEnterToBrowser(pageLinks.url) {
|
|
||||||
longClickPageObject(itemWithText("Link 3"))
|
|
||||||
verifyContextMenuForLocalHostLinks(genericURL.url)
|
|
||||||
clickContextMenuItem("Copy link")
|
|
||||||
verifySnackBarText("Link copied to clipboard")
|
|
||||||
}.openNavigationToolbar {
|
|
||||||
}.visitLinkFromClipboard {
|
|
||||||
verifyUrl(genericURL.url.toString())
|
|
||||||
}.openTabDrawer {
|
|
||||||
}.openNewTab {
|
|
||||||
}
|
|
||||||
navigationToolbar {
|
|
||||||
verifyClipboardSuggestionsAreDisplayed(shouldBeDisplayed = false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun verifyContextShareLink() {
|
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -177,8 +157,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243833
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenImageNewTab() {
|
fun verifyOpenImageNewTabContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -196,8 +177,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243834
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyImageLocation() {
|
fun verifyCopyImageLocationContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -216,8 +198,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/243835
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextSaveImage() {
|
fun verifySaveImageContextMenuOptionTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val imageResource =
|
val imageResource =
|
||||||
@ -239,8 +222,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/352050
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextMixedVariations() {
|
fun verifyContextMenuLinkVariationsTest() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
val genericURL =
|
val genericURL =
|
||||||
@ -262,8 +246,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/2333840
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextMixedVariationsInPDFTest() {
|
fun verifyPDFContextMenuLinkVariationsTest() {
|
||||||
val genericURL =
|
val genericURL =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
TestAssetHelper.getGenericAsset(mockWebServer, 3)
|
||||||
|
|
||||||
@ -282,8 +267,9 @@ class ContextMenusTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/832094
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkInAppTest() {
|
fun verifyOpenLinkInAppContextMenuOptionTest() {
|
||||||
val defaultWebPage = TestAssetHelper.getExternalLinksAsset(mockWebServer)
|
val defaultWebPage = TestAssetHelper.getExternalLinksAsset(mockWebServer)
|
||||||
|
|
||||||
navigationToolbar {
|
navigationToolbar {
|
||||||
|
@ -29,6 +29,7 @@ import org.mozilla.fenix.helpers.TestHelper.setTextToClipBoard
|
|||||||
import org.mozilla.fenix.helpers.TestHelper.verifySnackBarText
|
import org.mozilla.fenix.helpers.TestHelper.verifySnackBarText
|
||||||
import org.mozilla.fenix.ui.robots.EngineShortcut
|
import org.mozilla.fenix.ui.robots.EngineShortcut
|
||||||
import org.mozilla.fenix.ui.robots.homeScreen
|
import org.mozilla.fenix.ui.robots.homeScreen
|
||||||
|
import org.mozilla.fenix.ui.robots.navigationToolbar
|
||||||
import org.mozilla.fenix.ui.robots.searchScreen
|
import org.mozilla.fenix.ui.robots.searchScreen
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
@ -507,6 +508,7 @@ class SettingsSearchTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/412927
|
// TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/412927
|
||||||
|
@Ignore("Failing, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1807268")
|
||||||
@Test
|
@Test
|
||||||
fun verifyShowClipboardSuggestionsToggleTest() {
|
fun verifyShowClipboardSuggestionsToggleTest() {
|
||||||
val link = "https://www.mozilla.org/en-US/"
|
val link = "https://www.mozilla.org/en-US/"
|
||||||
@ -516,6 +518,21 @@ class SettingsSearchTest {
|
|||||||
}.openNavigationToolbar {
|
}.openNavigationToolbar {
|
||||||
verifyClipboardSuggestionsAreDisplayed(link, true)
|
verifyClipboardSuggestionsAreDisplayed(link, true)
|
||||||
}.visitLinkFromClipboard {
|
}.visitLinkFromClipboard {
|
||||||
|
waitForPageToLoad()
|
||||||
|
}.openTabDrawer {
|
||||||
|
}.openNewTab {
|
||||||
|
}
|
||||||
|
navigationToolbar {
|
||||||
|
// After visiting the link from clipboard it shouldn't be displayed again
|
||||||
|
verifyClipboardSuggestionsAreDisplayed(shouldBeDisplayed = false)
|
||||||
|
}.goBackToHomeScreen {
|
||||||
|
setTextToClipBoard(appContext, link)
|
||||||
|
}.openTabDrawer {
|
||||||
|
}.openNewTab {
|
||||||
|
}
|
||||||
|
navigationToolbar {
|
||||||
|
verifyClipboardSuggestionsAreDisplayed(link, true)
|
||||||
|
}.goBackToHomeScreen {
|
||||||
}.openThreeDotMenu {
|
}.openThreeDotMenu {
|
||||||
}.openSettings {
|
}.openSettings {
|
||||||
}.openSearchSubMenu {
|
}.openSearchSubMenu {
|
||||||
@ -525,7 +542,10 @@ class SettingsSearchTest {
|
|||||||
exitMenu()
|
exitMenu()
|
||||||
}
|
}
|
||||||
homeScreen {
|
homeScreen {
|
||||||
}.openNavigationToolbar {
|
}.openTabDrawer {
|
||||||
|
}.openNewTab {
|
||||||
|
}
|
||||||
|
navigationToolbar {
|
||||||
verifyClipboardSuggestionsAreDisplayed(link, false)
|
verifyClipboardSuggestionsAreDisplayed(link, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,23 +147,6 @@ class NavigationToolbarRobot {
|
|||||||
class Transition {
|
class Transition {
|
||||||
private lateinit var sessionLoadedIdlingResource: SessionLoadedIdlingResource
|
private lateinit var sessionLoadedIdlingResource: SessionLoadedIdlingResource
|
||||||
|
|
||||||
fun goBackToWebsite(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
|
||||||
openEditURLView()
|
|
||||||
clearAddressBarButton().click()
|
|
||||||
assertTrue(
|
|
||||||
mDevice.findObject(
|
|
||||||
UiSelector()
|
|
||||||
.resourceId("$packageName:id/mozac_browser_toolbar_edit_url_view")
|
|
||||||
.textContains(""),
|
|
||||||
).waitForExists(waitingTime),
|
|
||||||
)
|
|
||||||
|
|
||||||
goBackButton()
|
|
||||||
|
|
||||||
BrowserRobot().interact()
|
|
||||||
return BrowserRobot.Transition()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun enterURLAndEnterToBrowser(
|
fun enterURLAndEnterToBrowser(
|
||||||
url: Uri,
|
url: Uri,
|
||||||
interact: BrowserRobot.() -> Unit,
|
interact: BrowserRobot.() -> Unit,
|
||||||
@ -298,8 +281,9 @@ class NavigationToolbarRobot {
|
|||||||
return BrowserRobot.Transition()
|
return BrowserRobot.Transition()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun goBack(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
fun goBackToHomeScreen(interact: HomeScreenRobot.() -> Unit): HomeScreenRobot.Transition {
|
||||||
goBackButton()
|
mDevice.pressBack()
|
||||||
|
mDevice.waitForWindowUpdate(packageName, waitingTimeShort)
|
||||||
|
|
||||||
HomeScreenRobot().interact()
|
HomeScreenRobot().interact()
|
||||||
return HomeScreenRobot.Transition()
|
return HomeScreenRobot.Transition()
|
||||||
@ -425,7 +409,6 @@ private fun tabsCounter() =
|
|||||||
mDevice.findObject(By.res("$packageName:id/counter_root"))
|
mDevice.findObject(By.res("$packageName:id/counter_root"))
|
||||||
private fun fillLinkButton() = onView(withId(R.id.fill_link_from_clipboard))
|
private fun fillLinkButton() = onView(withId(R.id.fill_link_from_clipboard))
|
||||||
private fun clearAddressBarButton() = itemWithResId("$packageName:id/mozac_browser_toolbar_clear_view")
|
private fun clearAddressBarButton() = itemWithResId("$packageName:id/mozac_browser_toolbar_clear_view")
|
||||||
private fun goBackButton() = mDevice.pressBack()
|
|
||||||
private fun readerViewToggle() =
|
private fun readerViewToggle() =
|
||||||
onView(withParent(withId(R.id.mozac_browser_toolbar_page_actions)))
|
onView(withParent(withId(R.id.mozac_browser_toolbar_page_actions)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user