Merge lp:~elopio/ubuntu-ui-toolkit/fix1302706-click_toolbar_button_failure_window into lp:ubuntu-ui-toolkit

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

Commit message

On the autopilot helpers to click a toolbar button, check that the toolbar is opened first.

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

It makes sense to check the pre-requisite at the beginning of the function.

And this may be a little bit more stable because while _get_button() is being executed it will be ok for the toolbar
to close (during timeout?) because it will be opened again afterwards.

review: Approve
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 :
review: Needs Fixing (continuous-integration)
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 2014-03-22 06:53:24 +0000
3+++ tests/autopilot/ubuntuuitoolkit/emulators.py 2014-04-04 16:47:37 +0000
4@@ -301,15 +301,15 @@
5 name.
6
7 """
8+ # ensure the toolbar is open
9+ if not self.opened:
10+ raise ToolkitEmulatorException(
11+ 'Toolbar must be opened before calling click_button().')
12 try:
13 button = self._get_button(object_name)
14 except dbus.StateNotFoundError:
15 raise ToolkitEmulatorException(
16 'Button with objectName "{0}" not found.'.format(object_name))
17- # ensure the toolbar is open
18- if not self.opened:
19- raise ToolkitEmulatorException(
20- 'Toolbar must be opened before calling click_button().')
21 self.pointing_device.move_to_object(button)
22 # ensure the toolbar is still open (may have closed due to timeout)
23 self.open()

Subscribers

People subscribed via source and target branches

to status/vote changes: