2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

Closes 9291: Fix shortcutSearchEngineSettingsTest (#9292)

This commit is contained in:
Aaron Train 2020-03-23 11:04:10 -04:00 committed by GitHub
parent eaa69cf72b
commit f8048462b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -61,7 +61,6 @@ class SearchTest {
} }
@Test @Test
@Ignore("Temp disable flakey test - see: https://github.com/mozilla-mobile/fenix/issues/5462")
fun shortcutSearchEngineSettingsTest() { fun shortcutSearchEngineSettingsTest() {
homeScreen { homeScreen {
}.openSearch { }.openSearch {

View File

@ -9,7 +9,9 @@ package org.mozilla.fenix.ui.robots
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewInteraction import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.typeText import androidx.test.espresso.action.ViewActions.typeText
import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions import androidx.test.espresso.contrib.RecyclerViewActions
@ -21,7 +23,6 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiObject
import androidx.test.uiautomator.UiScrollable
import androidx.test.uiautomator.UiSelector import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until import androidx.test.uiautomator.Until
import org.hamcrest.CoreMatchers.allOf import org.hamcrest.CoreMatchers.allOf
@ -79,10 +80,12 @@ class SearchRobot {
) )
} }
fun scrollToSearchEngineSettings(): UiScrollable { fun scrollToSearchEngineSettings() {
val appView = UiScrollable(UiSelector().scrollable(true)) // Soft keyboard is visible on screen on view access; hide it
appView.scrollTextIntoView("Search engine settings") onView(allOf(withId(R.id.search_layout))).perform(
return appView closeSoftKeyboard()
)
onView(allOf(withId(R.id.awesomeBar))).perform(ViewActions.swipeUp())
} }
fun clickSearchEngineSettings() { fun clickSearchEngineSettings() {