@@ -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 Indicators Autopilot Test Suite
3# Unity Indicators Autopilot Test Suite
4−# Copyright (C) 2013, 2014, 2015 Canonical
4+# Copyright (C) 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,13 +19,16 @@
19from autopilot import input
19from autopilot import input
20from unity8.shell import emulators
20from unity8.shell import emulators
21from unity8.shell.emulators import main_window
21from unity8.shell.emulators import main_window
22−import unity8.indicators
23import ubuntuuitoolkit
22import ubuntuuitoolkit
25class IndicatorsMenu (emulators.UnityEmulatorBase):
25class IndicatorsMenu (emulators.UnityEmulatorBase):
26 """Autopilot helper for the IndicatorPage component."""
27 """Autopilot helper for the IndicatorPage component."""
27 def open(self):
29 def open(self):
30+ widget = self.select_single(
28− widget = self.select_single('IndicatorItem',objectName='indicator-sound-panelItem')
31+ 'IndicatorItem', objectName='indicator-sound-panelItem')
29 start_x, start_y = input.get_center_point(widget)
32 start_x, start_y = input.get_center_point(widget)
30 end_x = start_x
33 end_x = start_x
31 end_y = self.globalRect.y + self.openedHeight
34 end_y = self.globalRect.y + self.openedHeight
@@ -42,11 +45,16 @@ class IndicatorsMenu (emulators.UnityEmulatorBase):
42 objectName='indicator-rotation-lock-panelItem')
45 objectName='indicator-rotation-lock-panelItem')
43 self.pointing_device.click_object(indicator_rotation_icon)
46 self.pointing_device.click_object(indicator_rotation_icon)
44 self.fullyOpened.wait_for(True)
47 self.fullyOpened.wait_for(True)
48+ return DisplayIndicator(
45− return DisplayIndicator(self.select_single('IndicatorPage', objectName='indicator-rotation-lock-page'))
50+ 'IndicatorPage', objectName='indicator-rotation-lock-page'))
47−class DisplayIndicator (emulators.UnityEmulatorBase):
53+class DisplayIndicator(emulators.UnityEmulatorBase):
48− def __init__ (self, subject):
55+ def __init__(self, subject):
49 self.__subject = subject
56 self.__subject = subject
50 def __getattr__(self, name):
58 def __getattr__(self, name):
51 return getattr(self.__subject, name)
59 return getattr(self.__subject, name)
@@ -57,9 +65,9 @@ class DisplayIndicator (emulators.UnityEmulatorBase):
68+ switcher = self.select_single(
60− switcher = self.select_single(ubuntuuitoolkit.CheckBox, objectName='switcher')
69+ ubuntuuitoolkit.CheckBox, objectName='switcher')
61 switcher.check()
70 switcher.check()
64 def unlock_rotation(self):
72 def unlock_rotation(self):
65 """Toggles the rotation lock indicator to unlocked.
73 """Toggles the rotation lock indicator to unlocked.
@@ -68,6 +76,6 @@ class DisplayIndicator (emulators.UnityEmulatorBase):
79+ switcher = self.select_single(
71− switcher = self.select_single(ubuntuuitoolkit.CheckBox, objectName='switcher')
80+ ubuntuuitoolkit.CheckBox, objectName='switcher')
72 switcher.uncheck()
81 switcher.uncheck()