@@ -45,26 +45,6 @@ class TestHud(Unity8TestCase):
46 scenarios = _get_device_emulation_scenarios()
46 scenarios = _get_device_emulation_scenarios()
48− def _launch_application_from_app_screen(self):
49− # find the first application and launch it.
50− # becuase launch_application on the desktop will launch it on the
52− dash = self.main_window.get_dash()
53− icon = dash.get_application_icon()
54− self.touch.tap_object(icon)
56− # Ensure application is open
57− bottombar = self.main_window.get_bottombar()
58− self.assertThat(bottombar.applicationIsOnForeground, Eventually(Equals(True)))
60− # Because some tests are manually manipulating the finger, we want to
61− # cleanup if the test fails, but we don't want to fail with an exception if
63− def _maybe_release_finger(self):
64− """Only release the finger if it is in fact down."""
65− if self.touch._touch_finger is not None:
68 def test_show_hud_button_appears(self):
48 def test_show_hud_button_appears(self):
69 """Swiping up while an app is active must show the 'show hud' button."""
49 """Swiping up while an app is active must show the 'show hud' button."""
70 self.launch_unity()
50 self.launch_unity()
@@ -74,12 +54,7 @@ class TestHud(Unity8TestCase):
74 hud_show_button = self.main_window.get_hud_show_button()
54 hud_show_button = self.main_window.get_hud_show_button()
75 hud = self.main_window.get_hud()
55 hud = self.main_window.get_hud()
77− # determine the swipe
78 swipe_coords = self._get_hud_button_swipe_coords(window, hud_show_button)
57 swipe_coords = self._get_hud_button_swipe_coords(window, hud_show_button)
79− # start_x = int(window.x + (window.width / 2))
81− # start_y = window.y + (window.height -3)
82− # end_y = int(hud_show_button.y)
84 self._launch_application_from_app_screen()
59 self._launch_application_from_app_screen()
@@ -99,12 +74,7 @@ class TestHud(Unity8TestCase):
99 hud_show_button = self.main_window.get_hud_show_button()
74 hud_show_button = self.main_window.get_hud_show_button()
100 hud = self.main_window.get_hud()
75 hud = self.main_window.get_hud()
102− # determine the swipe
103 swipe_coords = self._get_hud_button_swipe_coords(window, hud_show_button)
77 swipe_coords = self._get_hud_button_swipe_coords(window, hud_show_button)
104− # start_x = int(window.x + (window.width / 2))
106− # start_y = window.y + (window.height -3)
107− # end_y = int(hud_show_button.y)
109 self._launch_application_from_app_screen()
79 self._launch_application_from_app_screen()
@@ -118,16 +88,6 @@ class TestHud(Unity8TestCase):
118 self.touch.release()
88 self.touch.release()
119 self.assertThat(hud.shown, Eventually(Equals(True)))
89 self.assertThat(hud.shown, Eventually(Equals(True)))
121− # self.launch_unity()
122− # hud = self.main_window.get_hud()
123− # greeter = self.main_window.get_greeter()
126− # self._launch_application_from_app_screen()
129− # self.assertThat(hud.shown, Eventually(Equals(True)))
131 # def test_show_hud_button_dont_open(self):
91 # def test_show_hud_button_dont_open(self):
132 # self.launch_unity()
92 # self.launch_unity()
133 # hud_show_button = self.main_window.get_hud_show_button()
93 # hud_show_button = self.main_window.get_hud_show_button()
@@ -211,6 +171,31 @@ class TestHud(Unity8TestCase):
212 self.assertThat(hud.shown, Eventually(Equals(False)))
172 self.assertThat(hud.shown, Eventually(Equals(False)))
174+ def _launch_application_from_app_screen(self):
175+ """Launches the camera app using the Dash UI.
177+ This is becuase when testing on the desktop running
178+ self.launch_application() will launch the application on the desktop
179+ itself and not within the Unity8 UI.
182+ dash = self.main_window.get_dash()
183+ icon = dash.get_application_icon('Camera')
184+ self.touch.tap_object(icon)
186+ # Ensure application is open
187+ bottombar = self.main_window.get_bottombar()
188+ self.assertThat(bottombar.applicationIsOnForeground, Eventually(Equals(True)))
190+ # Because some tests are manually manipulating the finger, we want to
191+ # cleanup if the test fails, but we don't want to fail with an exception if
193+ def _maybe_release_finger(self):
194+ """Only release the finger if it is in fact down."""
195+ if self.touch._touch_finger is not None:
196+ self.touch.release()
214 def _get_hud_button_swipe_coords(self, main_view, hud_show_button):
199 def _get_hud_button_swipe_coords(self, main_view, hud_show_button):
215 start_x = int(main_view.x + (main_view.width / 2))
200 start_x = int(main_view.x + (main_view.width / 2))
216 end_x = start_x
201 end_x = start_x