~canonical-platform-qa/ubuntu-system-tests/vivid

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/helpers/indicators/battery.py

  • Committer: Richard Huddie
  • Date: 2017-01-04 10:09:31 UTC
  • mfrom: (474.1.26 trunk)
  • Revision ID: richard.huddie@canonical.com-20170104100931-phxqhed28t6n10r5
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
 
19
 
from ubuntu_system_tests.helpers.brightness._cpo import BrightnessPageBase
20
 
from ubuntu_system_tests.helpers.indicators._cpo import (IndicatorPage,
21
 
                                                         INDICATOR_PAGE_PATH)
 
19
from ubuntu_system_tests.helpers.brightness.cpo import BrightnessPageBase
 
20
from ubuntu_system_tests.helpers.indicators.cpo import (IndicatorPage,
 
21
                                                        INDICATOR_PAGE_PATH)
22
22
from ubuntu_system_tests.helpers.autopilot import validate_dbus_object
23
 
from ubuntu_system_tests.helpers import unity8
 
23
from ubuntu_system_tests.helpers.input_manager import input_manager
 
24
from ubuntu_system_tests.helpers.unity8.utils import UNITY8_PATH_ROOT
24
25
 
25
26
 
26
27
class BatteryIndicatorPage(IndicatorPage, BrightnessPageBase):
31
32
    @classmethod
32
33
    def validate_dbus_object(cls, path, state):
33
34
        return validate_dbus_object(
34
 
            path, state, unity8.UNITY8_PATH_ROOT, INDICATOR_PAGE_PATH,
 
35
            path, state, UNITY8_PATH_ROOT, INDICATOR_PAGE_PATH,
35
36
            objectName='indicator-power-page')
36
37
 
37
38
    def _get_battery_settings_menu_item(self):
38
39
        """Return the battery settings list item."""
39
40
        return self.select_single(
40
 
            'StandardMenu',
41
 
            objectName='indicator.activate-phone-settings')
 
41
            objectName='indicator.activate-phone-settings', visible=True)
42
42
 
43
43
    def open_battery_settings(self):
44
44
        """Tap the battery settings menu item to open settings."""
45
 
        self.pointing_device.click_object(
 
45
        input_manager.pointer.click_object(
46
46
            self._get_battery_settings_menu_item())
47
47
 
48
48
    def get_auto_adjust_checkbox(self):
72
72
        """Press the auto adjust switch and wait for state to change."""
73
73
        brightness_switch = self._get_brightness_switch()
74
74
        original_state = brightness_switch.checked
75
 
        self.pointing_device.click_object(brightness_switch)
 
75
        input_manager.pointer.click_object(brightness_switch)
76
76
        brightness_switch.checked.wait_for(not original_state)