mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
[fenix] Fix flaky UI Tests https://github.com/mozilla-mobile/fenix/issues/19306 https://github.com/mozilla-mobile/fenix/issues/19160 https://github.com/mozilla-mobile/fenix/issues/19404 https://github.com/mozilla-mobile/fenix/issues/19373
This commit is contained in:
parent
f9477db816
commit
9855b1d05a
@ -32,6 +32,7 @@ class SearchTest {
|
||||
verifySearchView()
|
||||
verifyBrowserToolbar()
|
||||
verifyScanButton()
|
||||
verifySearchEngineButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,6 +315,8 @@ class HomeScreenRobot {
|
||||
|
||||
fun openSearch(interact: SearchRobot.() -> Unit): SearchRobot.Transition {
|
||||
navigationToolbar().perform(click())
|
||||
mDevice.findObject(UiSelector().resourceId("$packageName:id/search_wrapper"))
|
||||
.waitForExists(waitingTime)
|
||||
|
||||
SearchRobot().interact()
|
||||
return SearchRobot.Transition()
|
||||
@ -374,8 +376,8 @@ class HomeScreenRobot {
|
||||
}
|
||||
|
||||
fun openNavigationToolbar(interact: NavigationToolbarRobot.() -> Unit): NavigationToolbarRobot.Transition {
|
||||
|
||||
assertNavigationToolbar().perform(click())
|
||||
|
||||
NavigationToolbarRobot().interact()
|
||||
return NavigationToolbarRobot.Transition()
|
||||
}
|
||||
@ -471,13 +473,12 @@ private fun assertKeyboardVisibility(isExpectedToBeVisible: Boolean) =
|
||||
)
|
||||
|
||||
private fun navigationToolbar() =
|
||||
onView(allOf(withText("Search or enter address")))
|
||||
onView(withId(R.id.toolbar_wrapper))
|
||||
|
||||
private fun closeTabButton() = onView(withId(R.id.close_tab_button))
|
||||
|
||||
private fun assertNavigationToolbar() =
|
||||
onView(allOf(withText("Search or enter address")))
|
||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
navigationToolbar().check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
|
||||
private fun assertFocusedNavigationToolbar() =
|
||||
onView(allOf(withHint("Search or enter address")))
|
||||
|
@ -49,6 +49,7 @@ class SearchRobot {
|
||||
fun verifySearchView() = assertSearchView()
|
||||
fun verifyBrowserToolbar() = assertBrowserToolbarEditView()
|
||||
fun verifyScanButton() = assertScanButton()
|
||||
fun verifySearchEngineButton() = assertSearchEngineButton()
|
||||
fun verifySearchWithText() = assertSearchWithText()
|
||||
fun verifySearchEngineResults(searchEngineName: String) =
|
||||
assertSearchEngineResults(searchEngineName)
|
||||
@ -215,7 +216,7 @@ private fun assertSearchEngineResults(searchEngineName: String) {
|
||||
}
|
||||
|
||||
private fun assertSearchView() {
|
||||
onView(allOf(withId(R.id.search_layout)))
|
||||
onView(withId(R.id.search_wrapper)).check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
}
|
||||
|
||||
private fun assertBrowserToolbarEditView() =
|
||||
@ -226,6 +227,10 @@ private fun assertScanButton() =
|
||||
onView(allOf(withText("Scan")))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
|
||||
private fun assertSearchEngineButton() =
|
||||
onView(withId(R.id.search_engines_shortcut_button))
|
||||
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
|
||||
|
||||
private fun assertSearchWithText() =
|
||||
onView(allOf(withText("THIS TIME, SEARCH WITH:")))
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
|
Loading…
Reference in New Issue
Block a user