on xenial help sign in
On the autopilot helpers, swipe if the item to open from the dash is not visible.
a321ca7Leo Arias
tests/autopilot/unity8/shell/emulators/dash.py+9−2
@@ -183,7 +183,10 @@ class Dash(emulators.UnityEmulatorBase):
183
183
184
184
185class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
185class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
186− pass
186+
187+ # Overriden because the margin to start the swipe is bigger than in the
188+ # other apps. --elopio - 2014-12-11
189+ margin_to_swipe_from_bottom = 50
187
190
188
191
189class GenericScopeView(emulators.UnityEmulatorBase):
192class GenericScopeView(emulators.UnityEmulatorBase):
@@ -218,7 +221,11 @@ class GenericScopeView(emulators.UnityEmulatorBase):
218
221
219 """
222 """
220 category_element = self._get_category_element(category)
223 category_element = self._get_category_element(category)
221− icon = category_element.wait_select_single('AbstractButton', title=title)
224+ icon = category_element.wait_select_single(
225+ 'AbstractButton', title=title)
226+ list_view = self.select_single(
227+ ListViewWithPageHeader, objectName='categoryListView')
228+ list_view.swipe_child_into_view(icon)
222 self.pointing_device.click_object(icon)
229 self.pointing_device.click_object(icon)
223
230
224 def _get_category_element(self, category):
231 def _get_category_element(self, category):
tests/autopilot/unity8/shell/tests/test_emulators.py+6
@@ -118,6 +118,12 @@ class GenericScopeViewEmulatorTestCase(tests.DashBaseTestCase):
118 self.assertIsInstance(preview, dash_emulators.Preview)
118 self.assertIsInstance(preview, dash_emulators.Preview)
119 self.assertTrue(preview.isCurrent)
119 self.assertTrue(preview.isCurrent)
120
120
121+ def test_open_preview_of_non_visible_item(self):
122+ """Open an item that requires swiping to make it visible."""
123+ preview = self.generic_scope.open_preview('2', 'Title.2.0')
124+ self.assertIsInstance(preview, dash_emulators.Preview)
125+ self.assertTrue(preview.isCurrent)
126+
121
127
122class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
128class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
123
129