Merge lp:~sil2100/ubuntu-terminal-app/autopilot_fix_thumbspacing_0 into lp:ubuntu-terminal-app

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 42
Merged at revision: 41
Proposed branch: lp:~sil2100/ubuntu-terminal-app/autopilot_fix_thumbspacing_0
Merge into: lp:ubuntu-terminal-app
Diff against target: 38 lines (+7/-6)
1 file modified
tests/autopilot/ubuntu_terminal_app/emulators.py (+7/-6)
To merge this branch: bzr merge lp:~sil2100/ubuntu-terminal-app/autopilot_fix_thumbspacing_0
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs (community) Approve
Review via email: mp+209427@code.launchpad.net

Commit message

Modify drag_horizontal_slider to accomodate the changes in UITK that made thumbSpacing for the slider == 0. Calulate the step value differently as a workaround

Description of the change

Modify drag_horizontal_slider to accomodate the changes in UITK that made thumbSpacing for the slider == 0

To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

The drag operation should go from the last size to the new size in the slider. You are redragging each time it seems

review: Needs Fixing
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

The tests do pass and fix the issue observed on the latest image.

Revision history for this message
Nicholas Skaggs (nskaggs) :
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
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 'tests/autopilot/ubuntu_terminal_app/emulators.py'
2--- tests/autopilot/ubuntu_terminal_app/emulators.py 2014-02-27 16:16:27 +0000
3+++ tests/autopilot/ubuntu_terminal_app/emulators.py 2014-03-05 16:10:36 +0000
4@@ -59,9 +59,7 @@
5 """Drag slider until value is set"""
6 slItem = self.get_slider_item(slider)
7
8- # calculate required shift per position
9 slRect = slItem.select_single("SliderStyle")
10- thumbSpacing = slRect.thumbSpacing
11
12 slideMin = int(slItem.minimumValue)
13 slideMax = int(slItem.maximumValue)
14@@ -73,8 +71,11 @@
15 raise ValueError("Pos cannot be less than" + str(slideMin))
16
17 x, y, w, h = slRect.globalRect
18- sx = x + thumbSpacing
19- sy = y+h/2
20+ # calculate the approximate slide step width
21+ # we take half of the theoretical step value just to make sure we don't miss any values
22+ step = w / ((slideMax - slideMin) * 2)
23+ sx = x + step
24+ sy = y + h / 2
25 loop = 1
26
27 #set the slider to minimum value and loop
28@@ -84,9 +85,9 @@
29 #drag through the slider until the pos matches our desired value
30 #in case of bad sliding, loop will also timeout
31 while round(slItem.value) != pos and slItem.value<slideMax and loop<=(slideMax*2):
32- #we can speed it along at twice the thumbSpacing and still hit everything
33- valuePos = int(sx + (thumbSpacing * 2 * loop))
34+ valuePos = int(sx + step)
35 self.pointing_device.drag(sx, sy, valuePos, sy)
36+ sx = valuePos
37 sleep(0.3)
38 loop = loop + 1
39

Subscribers

People subscribed via source and target branches