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

commit49ac73657f7eece3881186219bf6647323ed8d44 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 1 Sep 2015, 17:26 (11 years ago) parent2492baf
2 files changed+3−3
tests/autopilot/unity8/dash.py+2−2 tests/autopilot/unity8/shell/tests/test_helpers.py+1−1
tests/autopilot/unity8/dash.py+2−2
@@ -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")
@@ -167,7 +167,7 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
167167 objectName="headerContainer")
168168 headerContainer.contentY.wait_for(0)
169169 search_text_field = self._get_search_text_field()
170− search_text_field.write(query)
170+ keyboard.type(query)
171171 self.select_single(
172172 objectName="processingIndicator").visible.wait_for(False)
173173
tests/autopilot/unity8/shell/tests/test_helpers.py+1−1
@@ -47,7 +47,7 @@ class MainWindowTestCase(tests.UnityTestCase):
4747class DashHelperTestCase(tests.DashBaseTestCase):
4848
4949 def test_search(self):
50− self.dash.enter_search_query('Test')
50+ self.dash.enter_search_query('Test', self.keyboard)
5151 text_field = self.dash._get_search_text_field()
5252 self.assertEqual(text_field.text, 'Test')
5353