Unity 8
 All Classes Functions Properties
unity8.shell.tests.disabled_test_hud.TestHud Class Reference
Inheritance diagram for unity8.shell.tests.disabled_test_hud.TestHud:
Collaboration diagram for unity8.shell.tests.disabled_test_hud.TestHud:

Public Member Functions

def test_show_hud_button_appears
 
def test_show_hud_appears
 
def test_hide_hud_click
 
def test_hide_hud_dragging
 
def test_launcher_hides_hud
 
- Public Member Functions inherited from unity8.shell.tests.UnityTestCase
def setUpClass
 
def setUp
 
def launch_unity
 
def patch_lightdm_mock
 
def assertUnityReady
 
def get_dash
 
def main_window
 

Static Public Attributes

tuple scenarios = _get_device_emulation_scenarios()
 

Additional Inherited Members

- Public Attributes inherited from unity8.shell.tests.UnityTestCase
 touch
 
 unity_geometry_args
 
 grid_size
 

Detailed Description

Tests the Shell HUD.

Definition at line 29 of file disabled_test_hud.py.

Member Function Documentation

def unity8.shell.tests.disabled_test_hud.TestHud.test_hide_hud_click (   self)
Tapping the close button of the Hud must dismiss it.

Definition at line 117 of file disabled_test_hud.py.

118  def test_hide_hud_click(self):
119  """Tapping the close button of the Hud must dismiss it."""
120  unity_proxy = self.launch_unity()
121  unlock_unity(unity_proxy)
122  hud = self.main_window.get_hud()
123 
125 
126  hud.show()
127 
128  x, y = hud.get_close_button_coords()
129  self.touch.tap(x, y)
130  self.assertThat(hud.shown, Eventually(Equals(False)))
def unity8.shell.tests.disabled_test_hud.TestHud.test_hide_hud_dragging (   self)
Once open the Hud must close if the upper bar is dragged and
released downward.

Definition at line 131 of file disabled_test_hud.py.

132  def test_hide_hud_dragging(self):
133  """Once open the Hud must close if the upper bar is dragged and
134  released downward.
135 
136  """
137  unity_proxy = self.launch_unity()
138  unlock_unity(unity_proxy)
139  hud = self.main_window.get_hud()
140 
142 
143  hud.show()
144 
145  start_x, start_y = hud.get_close_button_coords()
146  end_x = start_x
147  end_y = int(self.main_window.height / 2)
148 
149  self.touch.drag(start_x, start_y, end_x, end_y)
150  self.assertThat(hud.shown, Eventually(Equals(False)))
def unity8.shell.tests.disabled_test_hud.TestHud.test_launcher_hides_hud (   self)
Opening the Launcher while the Hud is active must close the Hud.

Definition at line 151 of file disabled_test_hud.py.

152  def test_launcher_hides_hud(self):
153  """Opening the Launcher while the Hud is active must close the Hud."""
154  unity_proxy = self.launch_unity()
155  unlock_unity(unity_proxy)
156  hud = self.main_window.get_hud()
157  launcher = self.main_window.get_launcher()
158 
160 
161  hud.show()
162  launcher.show()
163 
164  self.assertThat(hud.shown, Eventually(Equals(False)))
def unity8.shell.tests.disabled_test_hud.TestHud.test_show_hud_appears (   self)
Releasing the touch on the 'show hud' button must display the hud.
   Test that the hud button stays on screen and tapping it opens the hud.

Definition at line 78 of file disabled_test_hud.py.

78 
79  def test_show_hud_appears(self):
80  """Releasing the touch on the 'show hud' button must display the hud.
81  Test that the hud button stays on screen and tapping it opens the hud.
82 
83  """
84  unity_proxy = self.launch_unity()
85  unlock_unity(unity_proxy)
86  hud_show_button = self.main_window.get_hud_show_button()
87  hud = self.main_window.get_hud()
88 
90 
91  swipe_coords = hud.get_button_swipe_coords(
92  self.main_window,
93  hud_show_button
94  )
95 
96  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
97  self.addCleanup(self._maybe_release_finger)
98  self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y)
99  self.assertThat(hud.shown, Eventually(Equals(False)))
100  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
101  self.touch.release()
102  self.assertThat(hud.shown, Eventually(Equals(True)))
103  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
104  x, y = hud.get_close_button_coords()
105  self.touch.tap(x, y)
106  self.assertThat(hud.shown, Eventually(Equals(False)))
107 
108  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
109  self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
110  self.assertThat(hud.shown, Equals(False))
111  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
112  self.touch.release()
113  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
114  self.touch.tap(swipe_coords.end_x, swipe_coords.end_y)
115  self.assertThat(hud.shown, Eventually(Equals(True)))
116  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
def unity8.shell.tests.disabled_test_hud.TestHud.test_show_hud_button_appears (   self)
Swiping up while an app is active must show the 'show hud' button, following some behaviours.
   The button must disappear not opening the HUD when releasing the
   mouse again somewhere on the screen except on the button itself following a timeout.
   The button must disappear when touching somewhere on the screen except the button itself.

Definition at line 35 of file disabled_test_hud.py.

35 
37  """Swiping up while an app is active must show the 'show hud' button, following some behaviours.
38  The button must disappear not opening the HUD when releasing the
39  mouse again somewhere on the screen except on the button itself following a timeout.
40  The button must disappear when touching somewhere on the screen except the button itself.
41 
42  """
43  unity_proxy = self.launch_unity()
44  unlock_unity(unity_proxy)
45  hud_show_button = self.main_window.get_hud_show_button()
46  edge_drag_area = self.main_window.get_hud_edge_drag_area()
47  hud = self.main_window.get_hud()
48 
50 
51  swipe_coords = hud.get_button_swipe_coords(
52  self.main_window,
53  hud_show_button
54  )
55  initialBottomMargin = int(hud_show_button.bottomMargin)
56 
57  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
58  self.addCleanup(self._maybe_release_finger)
59  self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
60  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
61  self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(initialBottomMargin)))
62  self._drag(swipe_coords.start_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5, swipe_coords.end_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - int(edge_drag_area.commitDistance) - 5)
63  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
64  self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
65  self.touch.release();
66  self.assertThat(hud.shown, Equals(False))
67  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
68 
69  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
70  self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
71  self.assertThat(hud.shown, Equals(False))
72  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
73  self.touch.release()
74  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
75  self.touch.tap(swipe_coords.end_x, swipe_coords.end_y - int(hud_show_button.height))
76  self.assertThat(hud.shown, Equals(False))
77  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))

The documentation for this class was generated from the following file: