@@ -1,7 +1,7 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3# Unity Autopilot Test Suite
3# Unity Autopilot Test Suite
4−# Copyright (C) 2012, 2013, 2014 Canonical
4+# Copyright (C) 2012, 2013, 2014, 2015 Canonical
6# This program is free software: you can redistribute it and/or modify
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
7# it under the terms of the GNU General Public License as published by
@@ -19,14 +19,12 @@
20import logging
20import logging
22−import ubuntuuitoolkit
23from autopilot import logging as autopilot_logging
22from autopilot import logging as autopilot_logging
24from autopilot import input
23from autopilot import input
26from unity8.shell import emulators
25from unity8.shell import emulators
27from unity8.shell.emulators.greeter import Greeter
26from unity8.shell.emulators.greeter import Greeter
28from unity8.shell.emulators.launcher import Launcher
27from unity8.shell.emulators.launcher import Launcher
29−import unity8.indicators
31logger = logging.getLogger(__name__)
29logger = logging.getLogger(__name__)
@@ -90,6 +88,16 @@ class QQuickView(emulators.UnityEmulatorBase):
90 self.wait_select_single('IndicatorsMenu', fullyOpened=True)
88 self.wait_select_single('IndicatorsMenu', fullyOpened=True)
91 return self._get_indicator_page(indicator_name)
89 return self._get_indicator_page(indicator_name)
91+ @autopilot_logging.log_action(logger.info)
92+ def close_indicator_page(self):
93+ """Swipe to close the opened indicator, wait until it's closed."""
94+ indicators_menu = self.wait_select_single('IndicatorsMenu')
95+ end_x, end_y = input.get_center_point(indicators_menu)
97+ start_y = self.height
98+ self.pointing_device.drag(start_x, start_y, end_x, end_y)
99+ indicators_menu.fullyClosed.wait_for(True)
93 @autopilot_logging.log_action(logger.info)
101 @autopilot_logging.log_action(logger.info)
94 def show_dash_swiping(self):
102 def show_dash_swiping(self):
95 """Show the dash swiping from the left."""
103 """Show the dash swiping from the left."""