Merge lp:~veebers/unity8/adding-extra-helpers-from-sanity into lp:unity8

Proposed by Christopher Lee
Status: Work in progress
Proposed branch: lp:~veebers/unity8/adding-extra-helpers-from-sanity
Merge into: lp:unity8
Prerequisite: lp:~canonical-platform-qa/unity8/click_item_with_swipe
Diff against target: 110 lines (+35/-9)
3 files modified
tests/autopilot/unity8/shell/emulators/dash.py (+26/-7)
tests/autopilot/unity8/shell/tests/__init__.py (+3/-2)
tests/autopilot/unity8/shell/tests/test_emulators.py (+6/-0)
To merge this branch: bzr merge lp:~veebers/unity8/adding-extra-helpers-from-sanity
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Brendan Donegan (community) Needs Fixing
Review via email: mp+256419@code.launchpad.net

Commit message

Upstreaming required helpers that originate from the Ubuntu sanity test suite.

Description of the change

Upstreaming required helpers that originate from the Ubuntu sanity test suite.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I suppose we need to add some tests using these two helpers to unity8

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Yes, using swipe to top in a test would be good.

In the case of wait_for_processing_to_complete, it should replace the other calls to the same statement in dash.py. Then it will be used in tests.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in tests/autopilot/unity8/shell/emulators/dash.py
1 conflicts encountered.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in tests/autopilot/unity8/shell/emulators/dash.py
1 conflicts encountered.

1525. By Christopher Lee

Merge trunk + resolve conflict

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Please clean your tags as described in https://wiki.ubuntu.com/Process/Merges/Checklists/Unity8

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in tests/autopilot/unity8/shell/emulators/dash.py
1 conflicts encountered.

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

No work on it for over two months, i'll set it to Work In Progress to clear the dashboard a bit.

Unmerged revisions

1525. By Christopher Lee

Merge trunk + resolve conflict

1524. By Christopher Lee

Added wait_for_processing_to_complete to Dash CPO.

1523. By Christopher Lee

Add swipe_to_top method to GenericScopeView

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2015-04-28 15:20:13 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2015-05-22 15:41:49 +0000
@@ -72,6 +72,10 @@
72 return self.dash_content_list.wait_select_single(72 return self.dash_content_list.wait_select_single(
73 'QQuickLoader', objectName=("scopeLoader%i" % scope_index))73 'QQuickLoader', objectName=("scopeLoader%i" % scope_index))
7474
75 def wait_for_processing_to_complete(self):
76 self.select_single(
77 objectName='processingIndicator').visible.wait_for(False)
78
75 @autopilot_logging.log_action(logger.info)79 @autopilot_logging.log_action(logger.info)
76 def open_scope(self, scope_id):80 def open_scope(self, scope_id):
77 """Open a dash scope.81 """Open a dash scope.
@@ -185,14 +189,17 @@
185189
186190
187class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):191class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
188 pass192
193 # Overriden because the margin to start the swipe is bigger than in the
194 # other apps. --elopio - 2014-12-11
195 margin_to_swipe_from_bottom = 50
189196
190197
191class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):198class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
192 """Autopilot emulator for generic scopes."""199 """Autopilot emulator for generic scopes."""
193200
194 @autopilot_logging.log_action(logger.info)201 @autopilot_logging.log_action(logger.info)
195 def open_preview(self, category, app_name):202 def open_preview(self, category, app_name, press_duration=0.10):
196 """Open the preview of an application.203 """Open the preview of an application.
197204
198 :parameter category: The name of the category where the application is.205 :parameter category: The name of the category where the application is.
@@ -203,16 +210,25 @@
203 # FIXME some categories need a long press in order to see the preview.210 # FIXME some categories need a long press in order to see the preview.
204 # Some categories do not show previews, like recent apps.211 # Some categories do not show previews, like recent apps.
205 # --elopio - 2014-1-14212 # --elopio - 2014-1-14
206 self.click_scope_item(category, app_name)213 self.click_scope_item(category, app_name, press_duration)
207 preview_list = self.wait_select_single(214 preview_list = self.wait_select_single(
208 'QQuickLoader', objectName='subPageLoader')215 'QQuickLoader', objectName='subPageLoader')
209 preview_list.subPageShown.wait_for(True)216 preview_list.subPageShown.wait_for(True)
210 preview_list.x.wait_for(0)217 preview_list.x.wait_for(0)
218 self.get_root_instance().select_single(
219 objectName='processingIndicator').visible.wait_for(False)
211 return preview_list.select_single(220 return preview_list.select_single(
212 Preview, objectName='preview{}'.format(preview_list.currentIndex))221 Preview, objectName='preview{}'.format(preview_list.currentIndex))
213222
214 @autopilot_logging.log_action(logger.debug)223 @autopilot_logging.log_action(logger.debug)
215 def click_scope_item(self, category, title):224 def swipe_to_top(self):
225 """Swipe to the top of the scope."""
226 list_view = self.select_single(
227 ListViewWithPageHeader, objectName='categoryListView')
228 list_view.swipe_to_top()
229
230 @autopilot_logging.log_action(logger.debug)
231 def click_scope_item(self, category, title, press_duration=0.10):
216 """Click an item from the scope.232 """Click an item from the scope.
217233
218 :parameter category: The name of the category where the item is.234 :parameter category: The name of the category where the item is.
@@ -220,9 +236,12 @@
220236
221 """237 """
222 category_element = self._get_category_element(category)238 category_element = self._get_category_element(category)
223 icon = category_element.wait_select_single('AbstractButton',239 icon = category_element.wait_select_single(
224 title=title)240 'AbstractButton', title=title)
225 self.pointing_device.click_object(icon)241 list_view = self.select_single(
242 ListViewWithPageHeader, objectName='categoryListView')
243 list_view.swipe_child_into_view(icon)
244 self.pointing_device.click_object(icon, press_duration=press_duration)
226245
227 def _get_category_element(self, category):246 def _get_category_element(self, category):
228 try:247 try:
229248
=== modified file 'tests/autopilot/unity8/shell/tests/__init__.py'
--- tests/autopilot/unity8/shell/tests/__init__.py 2015-05-05 14:46:49 +0000
+++ tests/autopilot/unity8/shell/tests/__init__.py 2015-05-22 15:41:49 +0000
@@ -338,8 +338,9 @@
338 self.wait_for_dash()338 self.wait_for_dash()
339339
340 def ensure_dash_not_running(self):340 def ensure_dash_not_running(self):
341 if process_helpers.is_job_running('unity8-dash'):341 if model() != 'Desktop':
342 process_helpers.stop_job('unity8-dash')342 if process_helpers.is_job_running('unity8-dash'):
343 process_helpers.stop_job('unity8-dash')
343344
344 def launch_dash(self, binary_path, variables):345 def launch_dash(self, binary_path, variables):
345 launch_dash_app_fixture = fixture_setup.LaunchDashApp(346 launch_dash_app_fixture = fixture_setup.LaunchDashApp(
346347
=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
--- tests/autopilot/unity8/shell/tests/test_emulators.py 2015-04-17 21:58:16 +0000
+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2015-05-22 15:41:49 +0000
@@ -120,6 +120,12 @@
120 self.assertIsInstance(preview, dash_emulators.Preview)120 self.assertIsInstance(preview, dash_emulators.Preview)
121 self.assertTrue(preview.isCurrent)121 self.assertTrue(preview.isCurrent)
122122
123 def test_open_preview_of_non_visible_item(self):
124 """Open an item that requires swiping to make it visible."""
125 preview = self.generic_scope.open_preview('2', 'Title.2.0')
126 self.assertIsInstance(preview, dash_emulators.Preview)
127 self.assertTrue(preview.isCurrent)
128
123129
124class DashAppsEmulatorTestCase(tests.DashBaseTestCase):130class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
125131

Subscribers

People subscribed via source and target branches