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 30 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 148 of file disabled_test_hud.py.

149  def test_hide_hud_click(self):
150  """Tapping the close button of the Hud must dismiss it."""
151  unity_proxy = self.launch_unity()
152  unlock_unity(unity_proxy)
153  hud = self.main_window.get_hud()
154 
156 
157  hud.show()
158 
159  x, y = hud.get_close_button_coords()
160  self.touch.tap(x, y)
161  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 162 of file disabled_test_hud.py.

163  def test_hide_hud_dragging(self):
164  """Once open the Hud must close if the upper bar is dragged and
165  released downward.
166 
167  """
168  unity_proxy = self.launch_unity()
169  unlock_unity(unity_proxy)
170  hud = self.main_window.get_hud()
171 
173 
174  hud.show()
175 
176  start_x, start_y = hud.get_close_button_coords()
177  end_x = start_x
178  end_y = int(self.main_window.height / 2)
179 
180  self.touch.drag(start_x, start_y, end_x, end_y)
181  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 182 of file disabled_test_hud.py.

183  def test_launcher_hides_hud(self):
184  """Opening the Launcher while the Hud is active must close the Hud."""
185  unity_proxy = self.launch_unity()
186  unlock_unity(unity_proxy)
187  hud = self.main_window.get_hud()
188  launcher = self.main_window.get_launcher()
189 
191 
192  hud.show()
193  launcher.show()
194 
195  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 100 of file disabled_test_hud.py.

101  def test_show_hud_appears(self):
102  """Releasing the touch on the 'show hud' button must display the hud.
103  Test that the hud button stays on screen and tapping it opens the
104  hud.
105 
106  """
107  unity_proxy = self.launch_unity()
108  unlock_unity(unity_proxy)
109  hud_show_button = self.main_window.get_hud_show_button()
110  hud = self.main_window.get_hud()
111 
113 
114  swipe_coords = hud.get_button_swipe_coords(
115  self.main_window,
116  hud_show_button
117  )
118 
119  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
120  self.addCleanup(self._maybe_release_finger)
121  self._drag(
122  swipe_coords.start_x,
123  swipe_coords.start_y,
124  swipe_coords.start_x,
125  swipe_coords.end_y)
126  self.assertThat(hud.shown, Eventually(Equals(False)))
127  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
128  self.touch.release()
129  self.assertThat(hud.shown, Eventually(Equals(True)))
130  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
131  x, y = hud.get_close_button_coords()
132  self.touch.tap(x, y)
133  self.assertThat(hud.shown, Eventually(Equals(False)))
134 
135  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
136  self._drag(
137  swipe_coords.start_x,
138  swipe_coords.start_y,
139  swipe_coords.start_x,
140  swipe_coords.end_y - int(hud_show_button.height))
141  self.assertThat(hud.shown, Equals(False))
142  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
143  self.touch.release()
144  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
145  self.touch.tap(swipe_coords.end_x, swipe_coords.end_y)
146  self.assertThat(hud.shown, Eventually(Equals(True)))
147  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.

It should follow 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 36 of file disabled_test_hud.py.

36 
38  """Swiping up while an app is active must show the 'show hud' button.
39 
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
43  following a timeout.
44  The button must disappear when touching somewhere on the screen
45  except the button itself.
46 
47  """
48  unity_proxy = self.launch_unity()
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()
53 
55 
56  swipe_coords = hud.get_button_swipe_coords(
57  self.main_window,
58  hud_show_button
59  )
60  initialBottomMargin = int(hud_show_button.bottomMargin)
61 
62  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
63  self.addCleanup(self._maybe_release_finger)
64  self._drag(
65  swipe_coords.start_x,
66  swipe_coords.start_y,
67  swipe_coords.start_x,
68  swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
69  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
70  self.assertThat(
71  hud_show_button.bottomMargin,
72  Eventually(Equals(initialBottomMargin)))
73  self._drag(
74  swipe_coords.start_x,
75  swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5,
76  swipe_coords.end_x,
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)))
81  self.touch.release()
82  self.assertThat(hud.shown, Equals(False))
83  self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
84 
85  self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
86  self._drag(
87  swipe_coords.start_x,
88  swipe_coords.start_y,
89  swipe_coords.start_x,
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)))
93  self.touch.release()
94  self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
95  self.touch.tap(
96  swipe_coords.end_x,
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)))

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