on xenial help sign in
Attempt swiping the indicators bar.
34ce1d6Leo Arias
tests/autopilot/unity8/indicators/tests/test_indicators.py+5−1
@@ -111,6 +111,10 @@ class DisplayIndicatorTestCase(IndicatorTestCase):
111
111
112 def test(self):
112 def test(self):
113 self.main_window.open_indicator_page('indicator-sound')
113 self.main_window.open_indicator_page('indicator-sound')
114+ indicators_bar_flickable = self.main_window.select_single(
115+ 'IndicatorsBar').select_single(
116+ main_window.QQuickFlickable, objectName='flickable')
117+ indicators_bar_flickable.swipe_to_x_end()
114 indicator_rotation_icon = self.main_window.select_single(
118 indicator_rotation_icon = self.main_window.select_single(
115− objectName='indicator.rotation-lock')
119+ objectName='indicator-rotation-lock-panelItem')
116 self.main_window.pointing_device.click_object(indicator_rotation_icon)
120 self.main_window.pointing_device.click_object(indicator_rotation_icon)
tests/autopilot/unity8/shell/emulators/main_window.py+18
@@ -19,6 +19,7 @@
19
19
20import logging
20import logging
21
21
22+import ubuntuuitoolkit
22from autopilot import logging as autopilot_logging
23from autopilot import logging as autopilot_logging
23from autopilot import input
24from autopilot import input
24
25
@@ -169,3 +170,20 @@ class QQuickView(emulators.UnityEmulatorBase):
169class IndicatorPage(emulators.UnityEmulatorBase):
170class IndicatorPage(emulators.UnityEmulatorBase):
170
171
171 """Autopilot helper for the IndicatorPage component."""
172 """Autopilot helper for the IndicatorPage component."""
173+
174+
175+class QQuickFlickable(ubuntuuitoolkit.QQuickFlickable):
176+
177+ def swipe_to_x_end(self):
178+ if not self.atXEnd:
179+ containers = self._get_containers()
180+ while not self.atXEnd:
181+ self.swipe_to_show_x_end(containers)
182+
183+ def swipe_to_show_x_end(self, containers):
184+ start_y = stop_y = self.globalRect.y + (self.globalRect.height // 2)
185+ start_x = self.globalRect.x + self.globalRect.width - 5
186+ stop_x = self.globalRect.x + 5
187+ self._slow_drag(start_x, stop_x, start_y, stop_y)
188+ self.dragging.wait_for(False)
189+ self.moving.wait_for(False)