on xenial help sign in
Fixed whitespaces.
032768bLeo Arias
tests/autopilot/unity8/shell/emulators/__init__.py+1−1
@@ -25,7 +25,7 @@ class UnityEmulatorBase(introspection.CustomEmulatorBase):
25
25
26 def __init__(self, *args):
26 def __init__(self, *args):
27 super(UnityEmulatorBase, self).__init__(*args)
27 super(UnityEmulatorBase, self).__init__(*args)
28− self.pointing_device = input.Touch.create()
28+ self.pointing_device = input.Pointer(device=input.Touch.create())
29
29
30
30
31class UnityEmulatorException(Exception):
31class UnityEmulatorException(Exception):
tests/autopilot/unity8/shell/emulators/dash.py+3−2
@@ -175,10 +175,11 @@ class DashApps(emulators.UnityEmulatorBase):
175 category_element = self._get_category_element(category)
175 category_element = self._get_category_element(category)
176 icon = category_element.select_single('Tile', text=app_name)
176 icon = category_element.select_single('Tile', text=app_name)
177 # FIXME some categories need a long press in order to see the preview.
177 # FIXME some categories need a long press in order to see the preview.
178− # Some categories no not show previews, like recent apps.
178+ # Some categories do not show previews, like recent apps.
179 # --elopio - 2014-1-14
179 # --elopio - 2014-1-14
180 self.pointing_device.click_object(icon)
180 self.pointing_device.click_object(icon)
181+ import pdb; pdb.set_trace()
181− return self.get_root_instance.select_single(AppPreview)
182+ return self.get_root_instance().wait_select_single(AppPreview)
182
183
183
184
184class AppPreview(emulators.UnityEmulatorBase):
185class AppPreview(emulators.UnityEmulatorBase):
tests/autopilot/unity8/shell/tests/test_emulators.py+6−2
@@ -155,7 +155,7 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
155 'Title.1', 'Title.21', 'Title.41', 'Title.61', 'Title.81',
155 'Title.1', 'Title.21', 'Title.41', 'Title.61', 'Title.81',
156 'Title.101', 'Title.121', 'Title.141', 'Title.161', 'Title.181',
156 'Title.101', 'Title.121', 'Title.141', 'Title.161', 'Title.181',
157 'Title.201', 'Title.221', 'Title.241', 'Title.261', 'Title.281',]
157 'Title.201', 'Title.221', 'Title.241', 'Title.261', 'Title.281',]
158−
158+
159 def setUp(self):
159 def setUp(self):
160 super(DashAppsEmulatorTestCase, self).setUp()
160 super(DashAppsEmulatorTestCase, self).setUp()
161 self.applications_scope = self.dash.open_scope('applications')
161 self.applications_scope = self.dash.open_scope('applications')
@@ -176,7 +176,7 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
176 :expected_apps_count]
176 :expected_apps_count]
177
177
178 applications = self.applications_scope.get_applications(category)
178 applications = self.applications_scope.get_applications(category)
179−
179+
180 self.assertThat(applications, HasLength(expected_apps_count))
180 self.assertThat(applications, HasLength(expected_apps_count))
181 for expected in expected_applications:
181 for expected in expected_applications:
182 self.assertThat(applications, Contains(expected))
182 self.assertThat(applications, Contains(expected))
@@ -186,3 +186,7 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
186 category)
186 category)
187 grid = category_element.select_single('GenericFilterGrid')
187 grid = category_element.select_single('GenericFilterGrid')
188 return grid.columns * grid.rows
188 return grid.columns * grid.rows
189+
190+ def test_open_preview(self):
191+ preview = self.applications_scope.open_preview('installed', 'Title.1')
192+ self.assertIsInstance(preview, dash_emulators.AppPreview)