on xenial help sign in
On the autopilot helpers, swipe if the item to open from the dash is not visible.
commita321ca7599b15280612da874efa216129a8ad309 authorLeo Arias <leo.arias@canonical.com> dateWed 17 Dec 2014, 16:42 (12 years ago) parenta5c6e33
2 files changed+15−2
tests/autopilot/unity8/shell/emulators/dash.py+9−2 tests/autopilot/unity8/shell/tests/test_emulators.py+6
tests/autopilot/unity8/shell/emulators/dash.py+9−2
@@ -183,7 +183,10 @@ class Dash(emulators.UnityEmulatorBase):
183183
184184
185185class 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
187190
188191
189192class GenericScopeView(emulators.UnityEmulatorBase):
@@ -218,7 +221,11 @@ class GenericScopeView(emulators.UnityEmulatorBase):
218221
219222 """
220223 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)
222229 self.pointing_device.click_object(icon)
223230
224231 def _get_category_element(self, category):
tests/autopilot/unity8/shell/tests/test_emulators.py+6
@@ -118,6 +118,12 @@ class GenericScopeViewEmulatorTestCase(tests.DashBaseTestCase):
118118 self.assertIsInstance(preview, dash_emulators.Preview)
119119 self.assertTrue(preview.isCurrent)
120120
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+
121127
122128class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
123129