on xenial help sign in
Make the hud autopilot tests more reliable by fixing a use of relative coordinates
commiteffdca0f754cce03dd6fd9ac430f9f40d3d50ea4 authorMichael Terry <michael.terry@canonical.com> dateThu 1 Aug 2013, 12:50 (13 years ago) parent6348965
1 file changed+4−7
tests/autopilot/unity8/shell/emulators/hud.py+4−7
tests/autopilot/unity8/shell/emulators/hud.py+4−7
@@ -38,13 +38,10 @@ class Hud(UnityEmulatorBase):
3838 window = self.get_root_instance().select_single('QQuickView')
3939 hud_show_button = window.select_single("HudButton")
4040
41− start_x = int(window.x + (window.width / 2))
42− end_x = start_x
43− start_y = window.y + window.height
44− end_y = int(hud_show_button.y + (hud_show_button.height/2))
41+ swipe_coords = self.get_button_swipe_coords(window, hud_show_button)
4542
46− touch.press(start_x, start_y)
47− touch._finger_move(end_x, end_y)
43+ touch.press(swipe_coords.start_x, swipe_coords.start_y)
44+ touch._finger_move(swipe_coords.end_x, swipe_coords.end_y)
4845 try:
4946 hud_show_button.opacity.wait_for(1.0)
5047 touch.release()
@@ -78,6 +75,6 @@ class Hud(UnityEmulatorBase):
7875 start_x = int(main_view.x + (main_view.width / 2))
7976 end_x = start_x
8077 start_y = main_view.y + (main_view.height - 3)
81− end_y = int(hud_show_button.y + (hud_show_button.height/2))
78+ end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
8279
8380 return SwipeCoords(start_x, end_x, start_y, end_y)