Merge lp:~acerisara/ubuntu-calculator-app/check-button-pressed into lp:ubuntu-calculator-app

Proposed by Andrea Cerisara on 2015-01-06
Status: Merged
Approved by: Riccardo Padovani on 2015-01-06
Approved revision: 53
Merged at revision: 53
Proposed branch: lp:~acerisara/ubuntu-calculator-app/check-button-pressed
Merge into: lp:ubuntu-calculator-app
Diff against target: 39 lines (+17/-1)
2 files modified
app/tests/autopilot/ubuntu_calculator_app/__init__.py (+16/-1)
app/ui/KeyboardButton.qml (+1/-0)
To merge this branch: bzr merge lp:~acerisara/ubuntu-calculator-app/check-button-pressed
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve on 2015-01-06
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-01-06
Nicholas Skaggs 2015-01-06 Pending
Review via email: mp+245690@code.launchpad.net

Commit Message

Added check button has been pressed.

Description of the Change

Added check button has been pressed. Should avoid failing on Jenkins.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/tests/autopilot/ubuntu_calculator_app/__init__.py'
2--- app/tests/autopilot/ubuntu_calculator_app/__init__.py 2015-01-03 19:22:22 +0000
3+++ app/tests/autopilot/ubuntu_calculator_app/__init__.py 2015-01-06 19:54:52 +0000
4@@ -86,7 +86,22 @@
5 button = self.wait_select_single('KeyboardButton',
6 objectName=MainView.BUTTONS[button])
7
8- self.pointing_device.click_object(button)
9+ button_area = button.wait_select_single('QQuickMouseArea',
10+ objectName='buttonMA')
11+
12+ self.pointing_device.move_to_object(button)
13+ # we use press and release so we can check the qml property
14+ # and ensure the button is pressed long enough to be recieved
15+ # and processed correctly
16+ # using a larger press_duration for click_object would be inferior
17+ # as it would cause longer delays (we are forced to arbitrarily decide
18+ # how long to press each time) and potentially fail.
19+ # Also, https://bugs.launchpad.net/autopilot/+bug/1366949
20+ # causes press_duration argument to be ignored currently
21+ # balloons 2014-09-08
22+ self.pointing_device.press()
23+ button_area.pressed.wait_for(True)
24+ self.pointing_device.release()
25
26 def get_history(self):
27 history = self.wait_select_single('ScrollableView',
28
29=== modified file 'app/ui/KeyboardButton.qml'
30--- app/ui/KeyboardButton.qml 2014-12-09 08:59:08 +0000
31+++ app/ui/KeyboardButton.qml 2015-01-06 19:54:52 +0000
32@@ -56,6 +56,7 @@
33
34 MouseArea {
35 id: buttonMA
36+ objectName: "buttonMA"
37 anchors.fill: parent
38 onClicked: buttonRect.clicked();
39 }

Subscribers

People subscribed via source and target branches