on xenial help sign in
Workaround keyboard issues and make test pass again

By typing with the test keyboard instead of letting the SDK try to type with the OSK that is not there because autopilot creates a "hardware" keyboard Approved by: Michael Terry

commit4b3262dfcfa7ff06d40f8f4514da55fcb287ecae authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 15 Sep 2015, 12:04 (11 years ago) parente788d2e1844e1f
2 files changed+5−6
tests/autopilot/unity8/dash.py+3−4 tests/autopilot/unity8/shell/tests/test_helpers.py+2−2
tests/autopilot/unity8/dash.py+3−4
@@ -155,7 +155,7 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
155155 self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
156156 self.dash_content_list.currentIndex.wait_for(original_index + 1)
157157
158− def enter_search_query(self, query):
158+ def enter_search_query(self, query, keyboard):
159159 current_header = self._get_current_page_header()
160160 search_button = \
161161 current_header.select_single(objectName="search_header_button")
@@ -166,12 +166,11 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
166166 headerContainer = current_header.select_single(
167167 objectName="headerContainer")
168168 headerContainer.contentY.wait_for(0)
169− search_text_field = self._get_search_text_field()
170− search_text_field.write(query)
169+ keyboard.type(query)
171170 self.select_single(
172171 objectName="processingIndicator").visible.wait_for(False)
173172
174− def _get_search_text_field(self):
173+ def get_search_text_field(self):
175174 page_header = self._get_current_page_header()
176175 return page_header.select_single(objectName='searchTextField')
177176
tests/autopilot/unity8/shell/tests/test_helpers.py+2−2
@@ -47,8 +47,8 @@ class MainWindowTestCase(tests.UnityTestCase):
4747class DashHelperTestCase(tests.DashBaseTestCase):
4848
4949 def test_search(self):
50− self.dash.enter_search_query('Test')
51− text_field = self.dash._get_search_text_field()
50+ self.dash.enter_search_query('Test', self.keyboard)
51+ text_field = self.dash.get_search_text_field()
5252 self.assertEqual(text_field.text, 'Test')
5353
5454 def test_open_scope_to_the_right(self):