All Classes Functions Properties
unity8.shell.tests.disabled_test_hud.TestHud Class Reference
Inheritance diagram for unity8.shell.tests.disabled_test_hud.TestHud:
[legend]
Collaboration diagram for unity8.shell.tests.disabled_test_hud.TestHud:
[legend]

## 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.

def test_hide_hud_click(self):
"""Tapping the close button of the Hud must dismiss it."""
unity_proxy = self.launch_unity()
unlock_unity(unity_proxy)
hud = self.main_window.get_hud()
self._launch_test_app_from_app_screen()
hud.show()
x, y = hud.get_close_button_coords()
self.touch.tap(x, y)
self.assertThat(hud.shown, Eventually(Equals(False)))
unity8.shell.tests.disabled_test_hud.TestHud.test_hide_hud_click
def test_hide_hud_click
Definition: disabled_test_hud.py:117
unity8.shell.tests.disabled_test_hud.TestHud._launch_test_app_from_app_screen
def _launch_test_app_from_app_screen
Definition: disabled_test_hud.py:165
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252

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.

def test_hide_hud_dragging(self):
"""Once open the Hud must close if the upper bar is dragged and
released downward.
"""
unity_proxy = self.launch_unity()
unlock_unity(unity_proxy)
hud = self.main_window.get_hud()
self._launch_test_app_from_app_screen()
hud.show()
start_x, start_y = hud.get_close_button_coords()
end_x = start_x
end_y = int(self.main_window.height / 2)
self.touch.drag(start_x, start_y, end_x, end_y)
self.assertThat(hud.shown, Eventually(Equals(False)))
unity8.shell.tests.disabled_test_hud.TestHud.test_hide_hud_dragging
def test_hide_hud_dragging
Definition: disabled_test_hud.py:131
unity8.shell.tests.disabled_test_hud.TestHud._launch_test_app_from_app_screen
def _launch_test_app_from_app_screen
Definition: disabled_test_hud.py:165
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252

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.

def test_launcher_hides_hud(self):
"""Opening the Launcher while the Hud is active must close the Hud."""
unity_proxy = self.launch_unity()
unlock_unity(unity_proxy)
hud = self.main_window.get_hud()
launcher = self.main_window.get_launcher()
self._launch_test_app_from_app_screen()
hud.show()
launcher.show()
self.assertThat(hud.shown, Eventually(Equals(False)))
unity8.shell.tests.disabled_test_hud.TestHud._launch_test_app_from_app_screen
def _launch_test_app_from_app_screen
Definition: disabled_test_hud.py:165
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252
unity8.shell.tests.disabled_test_hud.TestHud.test_launcher_hides_hud
def test_launcher_hides_hud
Definition: disabled_test_hud.py:151

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.

def 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.
"""
unity_proxy = self.launch_unity()
unlock_unity(unity_proxy)
hud_show_button = self.main_window.get_hud_show_button()
hud = self.main_window.get_hud()
self._launch_test_app_from_app_screen()
swipe_coords = hud.get_button_swipe_coords(
self.main_window,
hud_show_button
)
self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
self.addCleanup(self._maybe_release_finger)
self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y)
self.assertThat(hud.shown, Eventually(Equals(False)))
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.touch.release()
self.assertThat(hud.shown, Eventually(Equals(True)))
self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
x, y = hud.get_close_button_coords()
self.touch.tap(x, y)
self.assertThat(hud.shown, Eventually(Equals(False)))
self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
self.assertThat(hud.shown, Equals(False))
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.touch.release()
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.touch.tap(swipe_coords.end_x, swipe_coords.end_y)
self.assertThat(hud.shown, Eventually(Equals(True)))
self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
unity8.shell.DragMixin._drag
def _drag
Definition: __init__.py:52
unity8.shell.tests.disabled_test_hud.TestHud._maybe_release_finger
def _maybe_release_finger
Definition: disabled_test_hud.py:185
unity8.shell.tests.disabled_test_hud.TestHud._launch_test_app_from_app_screen
def _launch_test_app_from_app_screen
Definition: disabled_test_hud.py:165
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252
unity8.shell.tests.UnityTestCase.main_window
def main_window
Definition: __init__.py:394
unity8.shell.tests.disabled_test_hud.TestHud.test_show_hud_appears
def test_show_hud_appears
Definition: disabled_test_hud.py:78

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.

def 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.
"""
unity_proxy = self.launch_unity()
unlock_unity(unity_proxy)
hud_show_button = self.main_window.get_hud_show_button()
edge_drag_area = self.main_window.get_hud_edge_drag_area()
hud = self.main_window.get_hud()
self._launch_test_app_from_app_screen()
swipe_coords = hud.get_button_swipe_coords(
self.main_window,
hud_show_button
)
initialBottomMargin = int(hud_show_button.bottomMargin)
self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
self.addCleanup(self._maybe_release_finger)
self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(initialBottomMargin)))
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)
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
self.touch.release();
self.assertThat(hud.shown, Equals(False))
self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
self.assertThat(hud.shown, Equals(False))
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.touch.release()
self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
self.touch.tap(swipe_coords.end_x, swipe_coords.end_y - int(hud_show_button.height))
self.assertThat(hud.shown, Equals(False))
self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
unity8.shell.DragMixin._drag
def _drag
Definition: __init__.py:52
unity8.shell.tests.disabled_test_hud.TestHud._maybe_release_finger
def _maybe_release_finger
Definition: disabled_test_hud.py:185
unity8.shell.tests.disabled_test_hud.TestHud._launch_test_app_from_app_screen
def _launch_test_app_from_app_screen
Definition: disabled_test_hud.py:165
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252
unity8.shell.tests.UnityTestCase.main_window
def main_window
Definition: __init__.py:394
unity8.shell.tests.disabled_test_hud.TestHud.test_show_hud_button_appears
def test_show_hud_button_appears
Definition: disabled_test_hud.py:35

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

- tests/autopilot/unity8/shell/tests/disabled_test_hud.py