Commit 81ab082c authored by ekager's avatar ekager Committed by Emily Kager
Browse files

For #6707 #6708 - Fix UI Tests for new Search Engine Behavior

parent 607c3d4c
......@@ -63,25 +63,26 @@ class SettingsBasicsTest {
verifyBasicsHeading()
verifySearchEngineButton()
// drill down to submenu
}.openSearchSubMenu {
verifyDefaultSearchEngineHeader()
verifySearchEngineList()
verifyShowSearchSuggestions()
verifyShowClipboardSuggestions()
verifySearchBrowsingHistory()
verifySearchBookmarks()
}.goBack {
}.openThemeSubMenu {
verifyThemes()
}.goBack {
}.openAccessibilitySubMenu {
verifyAutomaticFontSizing()
}.goBack {
}.openSearchSubMenu {
verifyDefaultSearchEngineHeader()
verifySearchEngineList()
verifyShowSearchSuggestions()
verifyShowSearchShortcuts()
verifyShowClipboardSuggestions()
verifySearchBrowsingHistory()
verifySearchBookmarks()
}.goBack {
}.openThemeSubMenu {
verifyThemes()
}.goBack {
}.openAccessibilitySubMenu {
verifyAutomaticFontSizing()
}.goBack {
// drill down to submenu
}.openDefaultBrowserSubMenu {
// verify item: set as default browser (duplicates, verify child of recyclerview)
// Verify label: Open links in private tab
}.goBack {
}.openDefaultBrowserSubMenu {
// verify item: set as default browser (duplicates, verify child of recyclerview)
// Verify label: Open links in private tab
}.goBack {
}
}
......
......@@ -22,6 +22,7 @@ class SettingsSubMenuSearchRobot {
fun verifyDefaultSearchEngineHeader() = assertDefaultSearchEngineHeader()
fun verifySearchEngineList() = assertSearchEngineList()
fun verifyShowSearchSuggestions() = assertShowSearchSuggestions()
fun verifyShowSearchShortcuts() = assertShowSearchShortcuts()
fun verifyShowClipboardSuggestions() = assertShowClipboardSuggestions()
fun verifySearchBrowsingHistory() = assertSearchBrowsingHistory()
fun verifySearchBookmarks() = assertSearchBookmarks()
......@@ -54,10 +55,15 @@ private fun assertSearchEngineList() {
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
onView(ViewMatchers.withText("Wikipedia"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
onView(ViewMatchers.withText("Add search engine"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
private fun assertShowSearchSuggestions() = onView(ViewMatchers.withText("Show search suggestions"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertShowSearchShortcuts() = onView(ViewMatchers.withText("Show search shortcuts"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertShowClipboardSuggestions() = onView(ViewMatchers.withText("Show clipboard suggestions"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertSearchBrowsingHistory() = onView(ViewMatchers.withText("Search browsing history"))
......
......@@ -329,7 +329,8 @@ class AwesomeBarView(
searchSuggestionProviderMap.put(
engine, SearchSuggestionProvider(
components.search.provider.getDefaultEngine(this),
components.search.provider.installedSearchEngines(this).list.find { it.name == engine.name }
?: components.search.provider.getDefaultEngine(this),
shortcutSearchUseCase,
components.core.client,
limit = 3,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment