Merge lp:~nskaggs/ubuntu-calculator-app/add-min-press-time into lp:ubuntu-calculator-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 81
Merged at revision: 81
Proposed branch: lp:~nskaggs/ubuntu-calculator-app/add-min-press-time
Merge into: lp:ubuntu-calculator-app
Diff against target: 25 lines (+5/-3)
1 file modified
app/tests/autopilot/ubuntu_calculator_app/__init__.py (+5/-3)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-calculator-app/add-min-press-time
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Riccardo Padovani Approve
Review via email: mp+248061@code.launchpad.net

Commit message

add min press duration so tests don't randomly fail

Description of the change

Make Riccardo happy :-)

Ohh, and also add a min press duration so tests don't randomly fail.

I believe what is sometimes happening is that the press time is/was effectively microseconds long and the UI doesn't have a chance to respond. Likely the migration to bignumber showed this as it seemed to occur for me when hitting '='. I assume the slightly longer overhead for calculations showed through causing bignumber to fail, while the original did not, despite the only difference being the math engine.

To post a comment you must log in.
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Makes sense, thanks :-)

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

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-13 15:42:30 +0000
3+++ app/tests/autopilot/ubuntu_calculator_app/__init__.py 2015-01-29 22:25:50 +0000
4@@ -17,6 +17,7 @@
5 """Calculator app autopilot emulators."""
6
7 import ubuntuuitoolkit
8+from time import sleep
9
10
11 class CalculatorApp(object):
12@@ -98,10 +99,11 @@
13 # using a larger press_duration for click_object would be inferior
14 # as it would cause longer delays (we are forced to arbitrarily decide
15 # how long to press each time) and potentially fail.
16- # Also, https://bugs.launchpad.net/autopilot/+bug/1366949
17- # causes press_duration argument to be ignored currently
18- # balloons 2014-09-08
19+ # balloons 2015-01-29
20 self.pointing_device.press()
21+ # this sleeps represents our minimum press time,
22+ # should button_area.pressed be true without any wait
23+ sleep(0.3)
24 button_area.pressed.wait_for(True)
25 self.pointing_device.release()
26

Subscribers

People subscribed via source and target branches