38 """Swiping up while an app is active must show the 'show hud' button.
40 It should follow some behaviours.
41 The button must disappear not opening the HUD when releasing the
42 mouse again somewhere on the screen except on the button itself
44 The button must disappear when touching somewhere on the screen
45 except the button itself.
49 unlock_unity(unity_proxy)
50 hud_show_button = self.main_window.get_hud_show_button()
51 edge_drag_area = self.main_window.get_hud_edge_drag_area()
52 hud = self.main_window.get_hud()
56 swipe_coords = hud.get_button_swipe_coords(
60 initialBottomMargin = int(hud_show_button.bottomMargin)
62 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
68 swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
69 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
71 hud_show_button.bottomMargin,
72 Eventually(Equals(initialBottomMargin)))
75 swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5,
77 swipe_coords.start_y - int(edge_drag_area.distanceThreshold) -
78 int(edge_drag_area.commitDistance) - 5)
79 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
80 self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
82 self.assertThat(hud.shown, Equals(
False))
83 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
85 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
90 swipe_coords.end_y - int(hud_show_button.height))
91 self.assertThat(hud.shown, Equals(
False))
92 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
94 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
97 swipe_coords.end_y - int(hud_show_button.height))
98 self.assertThat(hud.shown, Equals(
False))
99 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))