Merge lp:~canonical-platform-qa/ubuntu-system-tests/stability-longer-preview-timeout into lp:ubuntu-system-tests

Proposed by Richard Huddie
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-tests/stability-longer-preview-timeout
Merge into: lp:ubuntu-system-tests
Diff against target: 66 lines (+28/-2)
1 file modified
ubuntu_system_tests/helpers/unity8/dash.py (+28/-2)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-tests/stability-longer-preview-timeout
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Approve
Brendan Donegan (community) Needs Information
prod-platform-qa continuous-integration Pending
Review via email: mp+273022@code.launchpad.net

Commit message

Fix to extend the timeout period used to open an application preview.

Description of the change

Fix to extend the timeout period used to open an application preview. Fixes failures in sanity test ubuntu_system_tests.tests.test_uninstall_application.UninstallApplicationTestCase.test_uninstall_application: https://prod.practitest.com/p/1548/qtest_runs/2646196/edit

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Playing devils advocate here but if you look at the history of the test (Tracability tab) it's only failed on vivid like this once (it fails on Wily for other reasons). The disadvantage of copying the open_preview helper is that it leaves us open to any changes that happen in unity8 breaking our version. I would keep this branch around and see if the failure starts happening more but wouldn't merge it just now.

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

220. By Richard Huddie

Extend timeout peroid used in opening preview.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_system_tests/helpers/unity8/dash.py'
2--- ubuntu_system_tests/helpers/unity8/dash.py 2015-09-25 22:09:29 +0000
3+++ ubuntu_system_tests/helpers/unity8/dash.py 2015-10-01 08:20:18 +0000
4@@ -18,11 +18,13 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6 #
7
8+import logging
9 import ubuntuuitoolkit
10
11 from retrying import retry
12
13 from autopilot import introspection
14+from autopilot import logging as autopilot_logging
15 from autopilot.input._common import get_center_point
16
17 from ubuntu_system_tests.helpers.autopilot import order_by_x_coord
18@@ -30,6 +32,8 @@
19 from unity8 import process_helpers
20 from unity8.shell.emulators import dash as unity8_dash
21
22+logger = logging.getLogger(__name__)
23+
24
25 def get_dash():
26 """Return the Unity8 Dash autopilot custom proxy object."""
27@@ -43,11 +47,11 @@
28
29 class Dash(unity8_dash.Dash):
30
31- def wait_for_processing_to_complete(self):
32+ def wait_for_processing_to_complete(self, timeout=90):
33 """Wait until the dash is fully loaded"""
34 self.select_single(
35 objectName='processingIndicator').visible.wait_for(False,
36- timeout=90)
37+ timeout=timeout)
38
39 def open_scope(self, scope):
40 """Open the scope once the dash is ready to start the scroll
41@@ -189,3 +193,25 @@
42 x, y, width, height = icon.globalRect
43 self.pointing_device.move(x + 1, y + 1)
44 self.pointing_device.click(press_duration=press_duration)
45+
46+ @autopilot_logging.log_action(logger.info)
47+ def open_preview(self, category, app_name, press_duration=0.10):
48+ """Open the preview of an application.
49+
50+ This over-rides the implementation in unity8 because the timeout
51+ for waiting for processing indicator to complete is not sufficient.
52+
53+ :parameter category: The name of the category where the application is.
54+ :parameter app_name: The name of the application.
55+ :return: The opened preview.
56+
57+ """
58+ self.click_scope_item(category, app_name, press_duration)
59+ preview_list = self.wait_select_single(
60+ 'QQuickLoader', objectName='subPageLoader')
61+ preview_list.subPageShown.wait_for(True)
62+ preview_list.x.wait_for(0)
63+ get_dash().wait_for_processing_to_complete()
64+ return preview_list.select_single(
65+ unity8_dash.Preview, objectName='preview{}'.format(
66+ preview_list.initialIndex))

Subscribers

People subscribed via source and target branches

to all changes: