mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
[fenix] No issue: cleanup of unused tabs related code in HomeScreenRobot.kt
Deleted SmokeTest#selectTabsButtonVisibilityTest, feature removed
This commit is contained in:
parent
4219f12c67
commit
ba1ebb1413
@ -32,6 +32,7 @@ import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper
|
||||
import org.mozilla.fenix.helpers.TestHelper.createCustomTabIntent
|
||||
import org.mozilla.fenix.helpers.TestHelper.deleteDownloadFromStorage
|
||||
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.clickTabCrashedRestoreButton
|
||||
@ -1079,34 +1080,6 @@ class SmokeTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("Feature is temporarily removed; disabling test. See https://github.com/mozilla-mobile/fenix/issues/18656")
|
||||
@Test
|
||||
fun selectTabsButtonVisibilityTest() {
|
||||
homeScreen {
|
||||
}.dismissOnboarding()
|
||||
|
||||
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()
|
||||
}.openTabDrawer {
|
||||
}.toggleToPrivateTabs {
|
||||
}.openNewTab {
|
||||
}.dismissSearchBar { }
|
||||
|
||||
homeScreen {
|
||||
}.openTabDrawer {
|
||||
}.toggleToNormalTabs {
|
||||
verifySelectTabsButton()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun privateTabsTrayWithOpenedTabTest() {
|
||||
val website = TestAssetHelper.getGenericAsset(mockWebServer, 1)
|
||||
|
@ -23,7 +23,6 @@ import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
|
||||
import androidx.test.espresso.matcher.ViewMatchers.hasSibling
|
||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withHint
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
@ -241,12 +240,6 @@ class HomeScreenRobot {
|
||||
}
|
||||
}
|
||||
|
||||
fun scrollToElementByText(text: String): UiScrollable {
|
||||
val appView = UiScrollable(UiSelector().scrollable(true))
|
||||
appView.scrollTextIntoView(text)
|
||||
return appView
|
||||
}
|
||||
|
||||
fun togglePrivateBrowsingModeOnOff() {
|
||||
onView(ViewMatchers.withResourceName("privateBrowsingButton"))
|
||||
.perform(click())
|
||||
@ -257,12 +250,6 @@ class HomeScreenRobot {
|
||||
fun swipeToTop() =
|
||||
onView(withId(R.id.sessionControlRecyclerView)).perform(ViewActions.swipeDown())
|
||||
|
||||
fun swipeTabRight(title: String) =
|
||||
tab(title).perform(ViewActions.swipeRight())
|
||||
|
||||
fun swipeTabLeft(title: String) =
|
||||
tab(title).perform(ViewActions.swipeLeft())
|
||||
|
||||
fun verifySnackBarText(expectedText: String) {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
mDevice.waitNotNull(findObject(By.text(expectedText)), waitingTime)
|
||||
@ -274,21 +261,6 @@ class HomeScreenRobot {
|
||||
).perform(click())
|
||||
}
|
||||
|
||||
fun verifyTabMediaControlButtonState(action: String) {
|
||||
mDevice.waitNotNull(
|
||||
findObject(
|
||||
By
|
||||
.res("org.mozilla.fenix.debug:id/play_pause_button")
|
||||
.desc(action)
|
||||
),
|
||||
waitingTime
|
||||
)
|
||||
|
||||
tabMediaControlButton().check(matches(withContentDescription(action)))
|
||||
}
|
||||
|
||||
fun clickTabMediaControlButton() = tabMediaControlButton().click()
|
||||
|
||||
class Transition {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
|
||||
@ -363,22 +335,6 @@ class HomeScreenRobot {
|
||||
onView(ViewMatchers.isRoot()).perform(ViewActions.pressBack())
|
||||
}
|
||||
|
||||
fun openTabsListThreeDotMenu(interact: ThreeDotMenuMainRobot.() -> Unit): ThreeDotMenuMainRobot.Transition {
|
||||
// tabsListThreeDotButton().perform(click())
|
||||
|
||||
ThreeDotMenuMainRobot().interact()
|
||||
return ThreeDotMenuMainRobot.Transition()
|
||||
}
|
||||
|
||||
fun closeAllPrivateTabs(interact: HomeScreenRobot.() -> Unit): Transition {
|
||||
onView(withId(R.id.close_tabs_button))
|
||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
.perform(click())
|
||||
|
||||
HomeScreenRobot().interact()
|
||||
return Transition()
|
||||
}
|
||||
|
||||
fun openNavigationToolbar(interact: NavigationToolbarRobot.() -> Unit): NavigationToolbarRobot.Transition {
|
||||
mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar"))
|
||||
.waitForExists(waitingTime)
|
||||
@ -487,8 +443,6 @@ private fun assertKeyboardVisibility(isExpectedToBeVisible: Boolean) =
|
||||
|
||||
private fun navigationToolbar() = onView(withId(R.id.toolbar))
|
||||
|
||||
private fun closeTabButton() = onView(withId(R.id.close_tab_button))
|
||||
|
||||
private fun assertNavigationToolbar() =
|
||||
navigationToolbar().check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
|
||||
@ -724,8 +678,6 @@ private fun assertShareTabsOverlay() {
|
||||
|
||||
private fun privateBrowsingButton() = onView(withId(R.id.privateBrowsingButton))
|
||||
|
||||
private fun tabMediaControlButton() = onView(withId(R.id.play_pause_button))
|
||||
|
||||
private fun collectionItem(title: String) =
|
||||
onView(allOf(withId(R.id.label), withText(title)))
|
||||
|
||||
@ -743,14 +695,6 @@ private fun removeTabFromCollectionButton(title: String) =
|
||||
|
||||
private fun tabsCounter() = onView(withId(R.id.tab_button))
|
||||
|
||||
private fun tab(title: String) =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.tab_title),
|
||||
withText(title)
|
||||
)
|
||||
)
|
||||
|
||||
private fun startBrowsingButton(): UiObject {
|
||||
val startBrowsingButton = mDevice.findObject(UiSelector().resourceId("$packageName:id/finish_button"))
|
||||
homeScreenList()
|
||||
|
Loading…
Reference in New Issue
Block a user