@@ -20,13 +20,13 @@
2020import logging
2121
2222from autopilot import logging as autopilot_logging
23+from autopilot.input._common import get_center_point
2324
2425from unity8.shell import emulators
2526from unity8.shell.emulators.greeter import Greeter
2627from unity8.shell.emulators.hud import Hud
2728from unity8.shell.emulators.dash import Dash
2829from unity8.shell.emulators.launcher import Launcher
29−from unity8.indicators.emulators.widget import DefaultIndicatorWidget
3030
3131logger = logging.getLogger(__name__)
3232
@@ -90,16 +90,40 @@ class QQuickView(emulators.UnityEmulatorBase):
9090
9191 def get_indicator_widget(self, indicator_name):
9292 return self.select_single(
93− DefaultIndicatorWidget,
93+ 'DefaultIndicatorWidget',
9494 objectName=indicator_name+'-widget'
9595 )
9696
97− def get_indicator_page(self, indicator_title):
97+ def get_indicator_page(self, indicator_name):
9898 return self.select_single(
9999 'DefaultIndicatorPage',
100− title=indicator_title
100+ objectName=indicator_name+'-page'
101101 )
102102
103+ @autopilot_logging.log_action(logger.info)
104+ def open_indicator_page(self, indicator_name):
105+ """Return the indicator page.
106+
107+ Swipe to open the indicator, wait until it's open.
108+ """
109+ widget = self.get_indicator_widget(indicator_name)
110+ start_x, start_y = get_center_point(widget)
111+ end_x = start_x
112+ end_y = self.height
113+ self.pointing_device.drag(start_x, start_y, end_x, end_y)
114+ # TODO: assert that the indicator page opened [alesage 2013-12-06]
115+ return self.get_indicator_page(indicator_name)
116+
117+ @autopilot_logging.log_action(logger.info)
118+ def close_indicator_page(self, indicator_name):
119+ """Swipe to close the indicator, wait until it's closed."""
120+ widget = self.get_indicator_widget(indicator_name)
121+ end_x, end_y = get_center_point(widget)
122+ start_x = end_x
123+ start_y = self.height
124+ self.pointing_device.drag(start_x, start_y, end_x, end_y)
125+ # TODO: assert that the indicator page closed [alesage 2013-12-06]
126+
103127 def get_shell_background(self):
104128 return self.select_single(
105129 "CrossFadeImage", objectName="backgroundImage")