Merge lp:~elopio/ubuntu-ui-toolkit/autopilot_logging into lp:ubuntu-ui-toolkit

Proposed by Leo Arias
Status: Merged
Approved by: Cris Dywan
Approved revision: 827
Merged at revision: 857
Proposed branch: lp:~elopio/ubuntu-ui-toolkit/autopilot_logging
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 160 lines (+23/-1)
1 file modified
tests/autopilot/ubuntuuitoolkit/emulators.py (+23/-1)
To merge this branch: bzr merge lp:~elopio/ubuntu-ui-toolkit/autopilot_logging
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+194251@code.launchpad.net

Commit message

Added logging for all the public methods on the autopilot emulators.

Description of the change

Making use of one of the nice things that come with autopilot 1.4.
This will help while diagnosing failures.

To post a comment you must log in.
826. By Leo Arias

Mistake, missing the @.

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

PASSED: Continuous integration, rev:826
http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-ci/1175/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/544
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/532
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-amd64-ci/123
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-ci/123
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-ci/123/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/501
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/544
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/544/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/532
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/532/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2998
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3180
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1179
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1180

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/ubuntu-ui-toolkit-ci/1175/rebuild

review: Approve (continuous-integration)
827. By Leo Arias

Merged with trunk.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice stuff! This will make debugging a little easier.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntuuitoolkit/emulators.py'
2--- tests/autopilot/ubuntuuitoolkit/emulators.py 2013-11-17 04:41:14 +0000
3+++ tests/autopilot/ubuntuuitoolkit/emulators.py 2013-11-22 16:00:30 +0000
4@@ -18,7 +18,11 @@
5 from distutils import version
6
7 import autopilot
8-from autopilot import input, platform
9+from autopilot import (
10+ input,
11+ logging as autopilot_logging,
12+ platform
13+)
14 from autopilot.introspection import dbus
15
16 _NO_TABS_ERROR = 'The MainView has no Tabs.'
17@@ -82,6 +86,7 @@
18 """Return the Toolbar emulator of the MainView."""
19 return self.select_single(Toolbar)
20
21+ @autopilot_logging.log_action(logger.info)
22 def open_toolbar(self):
23 """Open the toolbar if it's not already opened.
24
25@@ -90,6 +95,7 @@
26 """
27 return self.get_toolbar().open()
28
29+ @autopilot_logging.log_action(logger.info)
30 def close_toolbar(self):
31 """Close the toolbar if it's opened."""
32 self.get_toolbar().close()
33@@ -105,6 +111,7 @@
34 except dbus.StateNotFoundError:
35 raise ToolkitEmulatorException(_NO_TABS_ERROR)
36
37+ @autopilot_logging.log_action(logger.info)
38 def switch_to_next_tab(self):
39 """Open the next tab.
40
41@@ -117,6 +124,7 @@
42 current_tab.visible.wait_for(True)
43 return current_tab
44
45+ @autopilot_logging.log_action(logger.info)
46 def switch_to_tab_by_index(self, index):
47 """Open a tab.
48
49@@ -144,6 +152,7 @@
50 number_of_switches += 1
51 return current_tab
52
53+ @autopilot_logging.log_action(logger.info)
54 def switch_to_previous_tab(self):
55 """Open the previous tab.
56
57@@ -157,6 +166,7 @@
58 previous_tab_index = tabs.selectedTabIndex - 1
59 return self.switch_to_tab_by_index(previous_tab_index)
60
61+ @autopilot_logging.log_action(logger.info)
62 def switch_to_tab(self, object_name):
63 """Open a tab.
64
65@@ -182,6 +192,7 @@
66 return self.select_single(
67 ActionSelectionPopover, objectName=object_name)
68
69+ @autopilot_logging.log_action(logger.info)
70 def go_back(self):
71 """Go to the previous page."""
72 toolbar = self.open_toolbar()
73@@ -199,6 +210,7 @@
74 tab_bar_style = self.select_single('TabBarStyle')
75 return tab_bar_style.animating
76
77+ @autopilot_logging.log_action(logger.info)
78 def switch_to_next_tab(self):
79 """Open the next tab.
80
81@@ -216,6 +228,7 @@
82 class Toolbar(UbuntuUIToolkitEmulatorBase):
83 """Toolbar Autopilot emulator."""
84
85+ @autopilot_logging.log_action(logger.info)
86 def open(self):
87 """Open the toolbar if it's not already opened.
88
89@@ -238,6 +251,7 @@
90
91 self.pointing_device.drag(line_x, start_y, line_x, stop_y)
92
93+ @autopilot_logging.log_action(logger.info)
94 def close(self):
95 """Close the toolbar if it's opened."""
96 self.animating.wait_for(False)
97@@ -254,6 +268,7 @@
98
99 self.pointing_device.drag(line_x, start_y, line_x, stop_y)
100
101+ @autopilot_logging.log_action(logger.info)
102 def click_button(self, object_name):
103 """Click a button of the toolbar.
104
105@@ -285,6 +300,7 @@
106 def _get_button(self, object_name):
107 return self.select_single('ActionItem', objectName=object_name)
108
109+ @autopilot_logging.log_action(logger.info)
110 def click_back_button(self):
111 """Click the back button of the toolbar."""
112 self.click_button('back_toolbar_button')
113@@ -317,6 +333,7 @@
114 class TabBar(UbuntuUIToolkitEmulatorBase):
115 """TabBar Autopilot emulator."""
116
117+ @autopilot_logging.log_action(logger.info)
118 def switch_to_next_tab(self):
119 """Open the next tab."""
120 self._activate_tab_bar()
121@@ -390,6 +407,7 @@
122 class CheckBox(UbuntuUIToolkitEmulatorBase):
123 """CheckBox Autopilot emulator."""
124
125+ @autopilot_logging.log_action(logger.info)
126 def check(self, timeout=10):
127 """Check a CheckBox, if its not already checked.
128
129@@ -400,6 +418,7 @@
130 if not self.checked:
131 self.change_state(timeout)
132
133+ @autopilot_logging.log_action(logger.info)
134 def uncheck(self, timeout=10):
135 """Uncheck a CheckBox, if its not already unchecked.
136
137@@ -410,6 +429,7 @@
138 if self.checked:
139 self.change_state(timeout)
140
141+ @autopilot_logging.log_action(logger.info)
142 def change_state(self, timeout=10):
143 """Change the state of a CheckBox.
144
145@@ -438,6 +458,7 @@
146 return self.select_single(
147 'QQuickItem', objectName='confirmRemovalDialog')
148
149+ @autopilot_logging.log_action(logger.info)
150 def swipe_to_delete(self, direction='right'):
151 """Swipe the item in a specific direction."""
152 if (self.removable):
153@@ -472,6 +493,7 @@
154 # The item was destroyed.
155 pass
156
157+ @autopilot_logging.log_action(logger.info)
158 def confirm_removal(self):
159 """Comfirm item removal if this was already swiped."""
160 if (self.waitingConfirmationForRemoval):

Subscribers

People subscribed via source and target branches

to status/vote changes: