@@ -23,6 +23,8 @@ from unity8.shell import emulators
24from autopilot import logging as autopilot_logging
24from autopilot import logging as autopilot_logging
25from autopilot.introspection import dbus
25from autopilot.introspection import dbus
26+from testtools.matchers import MatchesAny, Equals
27+from ubuntuuitoolkit import emulators as toolkit_emulators
28logger = logging.getLogger(__name__)
30logger = logging.getLogger(__name__)
@@ -132,6 +134,19 @@ class Dash(emulators.UnityEmulatorBase):
132 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
134 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
133 self.dash_content_list.currentIndex.wait_for(original_index + 1)
135 self.dash_content_list.currentIndex.wait_for(original_index + 1)
137+ def enter_search_query(self, query):
138+ search_text_field = self._get_search_text_field()
139+ search_text_field.write(query)
140+ search_text_field.state.wait_for('idle')
142+ def _get_search_text_field(self):
143+ page_header = self._get_page_header()
144+ search_container = page_header.select_single(
145+ 'QQuickItem', objectName='searchContainer')
146+ search_container.state.wait_for(
147+ MatchesAny(Equals('narrowActive'), Equals('active')))
148+ return search_container.select_single(toolkit_emulators.TextField)
136class GenericScopeView(emulators.UnityEmulatorBase):
151class GenericScopeView(emulators.UnityEmulatorBase):
137 """Autopilot emulator for generic scopes."""
152 """Autopilot emulator for generic scopes."""