on xenial help sign in
Attempt swiping the indicators bar.
commit34ce1d6cdd6846384ab08813c0ee53b4e0d74960 authorLeo Arias <leo.arias@canonical.com> dateMon 12 Jan 2015, 12:55 (12 years ago) parent6391cee
2 files changed+23−1
tests/autopilot/unity8/indicators/tests/test_indicators.py+5−1 tests/autopilot/unity8/shell/emulators/main_window.py+18
tests/autopilot/unity8/indicators/tests/test_indicators.py+5−1
@@ -111,6 +111,10 @@ class DisplayIndicatorTestCase(IndicatorTestCase):
111111
112112 def test(self):
113113 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()
114118 indicator_rotation_icon = self.main_window.select_single(
115− objectName='indicator.rotation-lock')
119+ objectName='indicator-rotation-lock-panelItem')
116120 self.main_window.pointing_device.click_object(indicator_rotation_icon)
tests/autopilot/unity8/shell/emulators/main_window.py+18
@@ -19,6 +19,7 @@
1919
2020import logging
2121
22+import ubuntuuitoolkit
2223from autopilot import logging as autopilot_logging
2324from autopilot import input
2425
@@ -169,3 +170,20 @@ class QQuickView(emulators.UnityEmulatorBase):
169170class IndicatorPage(emulators.UnityEmulatorBase):
170171
171172 """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)