Fixed disabled UI test openExternalLinksInPrivateTest
This commit is contained in:
parent
53206df9b6
commit
1015072db6
|
@ -9,7 +9,6 @@ import androidx.test.uiautomator.UiDevice
|
|||
import okhttp3.mockwebserver.MockWebServer
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Ignore
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.ext.settings
|
||||
|
@ -46,6 +45,9 @@ class SettingsPrivacyTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
val settings = activityTestRule.activity.applicationContext.settings()
|
||||
settings.hasShownHomeOnboardingDialog = true
|
||||
}
|
||||
|
||||
@After
|
||||
|
@ -272,7 +274,6 @@ class SettingsPrivacyTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Ignore("Disabled for failing with new Compose Awesomebar")
|
||||
@Test
|
||||
fun openExternalLinksInPrivateTest() {
|
||||
val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.junit.After
|
|||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.ext.settings
|
||||
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
||||
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||
|
@ -51,6 +52,9 @@ class TabbedBrowsingTest {
|
|||
dispatcher = AndroidAssetDispatcher()
|
||||
start()
|
||||
}
|
||||
|
||||
val settings = activityTestRule.activity.applicationContext.settings()
|
||||
settings.hasShownHomeOnboardingDialog = true
|
||||
}
|
||||
|
||||
@After
|
||||
|
@ -281,7 +285,6 @@ class TabbedBrowsingTest {
|
|||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
// verifyPageContent(defaultWebPage.content)
|
||||
}.openTabDrawer {
|
||||
verifyExistingTabList()
|
||||
verifyNewTabButton()
|
||||
|
@ -289,7 +292,9 @@ class TabbedBrowsingTest {
|
|||
verifyExistingOpenTabs(defaultWebPage.title)
|
||||
verifyCloseTabsButton(defaultWebPage.title)
|
||||
}.openNewTab {
|
||||
}.dismissSearchBar { }
|
||||
verifySearchBarEmpty()
|
||||
verifyKeyboardVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -298,14 +303,6 @@ class TabbedBrowsingTest {
|
|||
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
// verifyPageContent(defaultWebPage.content)
|
||||
}.openTabDrawer {
|
||||
verifyExistingTabList()
|
||||
verifyNewTabButton()
|
||||
verifyTabTrayOverflowMenu(true)
|
||||
verifyExistingOpenTabs(defaultWebPage.title)
|
||||
verifyCloseTabsButton(defaultWebPage.title)
|
||||
}.closeTabDrawer {
|
||||
}.openTabButtonShortcutsMenu {
|
||||
verifyTabButtonShortcutMenuItems()
|
||||
}.closeTabFromShortcutsMenu {
|
||||
|
@ -316,28 +313,19 @@ class TabbedBrowsingTest {
|
|||
verifyFocusedNavigationToolbar()
|
||||
// dismiss search dialog
|
||||
homeScreen { }.pressBack()
|
||||
verifyHomePrivateBrowsingButton()
|
||||
verifyHomeMenu()
|
||||
verifyHomeWordmark()
|
||||
verifyTabButton()
|
||||
verifyPrivateSessionMessage()
|
||||
verifyHomeToolbar()
|
||||
verifyHomeComponent()
|
||||
}
|
||||
navigationToolbar {
|
||||
}.enterURLAndEnterToBrowser(defaultWebPage.url) {
|
||||
|
||||
}.openTabButtonShortcutsMenu {
|
||||
}.openTabFromShortcutsMenu {
|
||||
verifyKeyboardVisible()
|
||||
verifyFocusedNavigationToolbar()
|
||||
// dismiss search dialog
|
||||
homeScreen { }.pressBack()
|
||||
verifyHomeMenu()
|
||||
verifyHomeWordmark()
|
||||
verifyTabButton()
|
||||
verifyHomeToolbar()
|
||||
verifyHomeComponent()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -497,25 +497,16 @@ class BrowserRobot {
|
|||
}
|
||||
|
||||
fun openTabDrawer(interact: TabDrawerRobot.() -> Unit): TabDrawerRobot.Transition {
|
||||
mDevice.waitForIdle(waitingTime)
|
||||
mDevice.findObject(
|
||||
UiSelector()
|
||||
.resourceId("$packageName:id/counter_box")
|
||||
.descriptionContains("The tab counter toolbar button.")
|
||||
).waitForExists(waitingTime)
|
||||
mDevice.waitNotNull(Until.findObject(By.desc("Tabs")))
|
||||
tabsCounter().click()
|
||||
mDevice.waitNotNull(
|
||||
Until.findObject(By.res("$packageName:id/tab_layout")),
|
||||
waitingTime
|
||||
)
|
||||
mDevice.waitNotNull(Until.findObject(By.res("$packageName:id/tab_layout")))
|
||||
|
||||
TabDrawerRobot().interact()
|
||||
return TabDrawerRobot.Transition()
|
||||
}
|
||||
|
||||
fun openTabButtonShortcutsMenu(interact: NavigationToolbarRobot.() -> Unit): NavigationToolbarRobot.Transition {
|
||||
mDevice.waitForIdle(waitingTime)
|
||||
|
||||
mDevice.waitNotNull(Until.findObject(By.desc("Tabs")))
|
||||
tabsCounter().click(LONG_CLICK_DURATION)
|
||||
|
||||
NavigationToolbarRobot().interact()
|
||||
|
@ -594,7 +585,7 @@ private fun assertMenuButton() {
|
|||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
}
|
||||
|
||||
private fun tabsCounter() = mDevice.findObject(By.res("$packageName:id/counter_box"))
|
||||
private fun tabsCounter() = mDevice.findObject(By.desc("Tabs"))
|
||||
|
||||
private fun mediaPlayerPlayButton() =
|
||||
mDevice.findObject(
|
||||
|
|
Loading…
Reference in New Issue
Block a user