Merge lp:~elopio/gallery-app/workaround1302706-fix1302706-click_toolbar_button_failure into lp:gallery-app

Proposed by Leo Arias
Status: Merged
Approved by: Bill Filler
Approved revision: 943
Merged at revision: 948
Proposed branch: lp:~elopio/gallery-app/workaround1302706-fix1302706-click_toolbar_button_failure
Merge into: lp:gallery-app
Diff against target: 49 lines (+33/-1)
1 file modified
tests/autopilot/gallery_app/emulators/toolbar.py (+33/-1)
To merge this branch: bzr merge lp:~elopio/gallery-app/workaround1302706-fix1302706-click_toolbar_button_failure
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+214310@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
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: Needs Fixing (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/gallery_app/emulators/toolbar.py'
--- tests/autopilot/gallery_app/emulators/toolbar.py 2013-11-03 22:47:55 +0000
+++ tests/autopilot/gallery_app/emulators/toolbar.py 2014-04-04 16:55:41 +0000
@@ -1,5 +1,5 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical2# Copyright 2013, 2014 Canonical
3#3#
4# This program is free software: you can redistribute it and/or modify it4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published5# under the terms of the GNU General Public License version 3, as published
@@ -15,6 +15,38 @@
15class Toolbar(toolkit_emulators.Toolbar):15class Toolbar(toolkit_emulators.Toolbar):
16 """An emulator class that makes it easy to interact with the tool bar"""16 """An emulator class that makes it easy to interact with the tool bar"""
1717
18 def click_button(self, object_name):
19 """Click a button of the toolbar.
20
21 The toolbar should be opened before clicking the button, or an
22 exception will be raised. If the toolbar is closed for some reason
23 (e.g., timer finishes) after moving the mouse cursor and before
24 clicking the button, it is re-opened automatically by this function.
25
26 Overriden from the toolkit because of bug http://pad.lv/1302706
27 TODO remove this method once that bug is fixed on the toolkit.
28 --elopio - 2014-04-04
29
30 :parameter object_name: The QML objectName property of the button.
31 :raise ToolkitEmulatorException: If there is no button with that object
32 name.
33
34 """
35 # ensure the toolbar is open
36 if not self.opened:
37 raise toolkit_emulators.ToolkitEmulatorException(
38 'Toolbar must be opened before calling click_button().')
39 try:
40 button = self._get_button(object_name)
41 except StateNotFoundError:
42 raise toolkit_emulators.ToolkitEmulatorException(
43 'Button with objectName "{0}" not found.'.format(object_name))
44 self.pointing_device.move_to_object(button)
45 # ensure the toolbar is still open (may have closed due to timeout)
46 self.open()
47 # click the button
48 self.pointing_device.click_object(button)
49
18 def click_custom_button(self, object_name):50 def click_custom_button(self, object_name):
19 try:51 try:
20 button = self.select_single('Button', objectName=object_name)52 button = self.select_single('Button', objectName=object_name)

Subscribers

People subscribed via source and target branches

to all changes: