@@ -15,11 +15,21 @@ from unity8.indicators_client.tests import IndicatorsTestCase
15from time import sleep
15from time import sleep
16import random
16import random
17import math
17import math
19class TestDisplayMenus(IndicatorsTestCase):
20class TestDisplayMenus(IndicatorsTestCase):
20 def setUp(self):
21 def setUp(self):
21 super(TestDisplayMenus, self).setUp(self.geometry, self.grid_unit)
22 super(TestDisplayMenus, self).setUp(self.geometry, self.grid_unit)
25+ # self.main_window.get_indicators_client().reset()
26+ super(TestDisplayMenus, self).tearDown()
29+ # We need to move these to emulators once autopilot supports emulators for
30+ # applications started with AutopilotTestCase.launch_test_application
32+ def open_battery_menu(self):
23 # This opens the messaging menu so you don't have to do that in
33 # This opens the messaging menu so you don't have to do that in
24 # every test case
34 # every test case
25 self.assertThat(lambda: self.main_window.get_battery_menu(), Eventually(NotEquals(None)));
35 self.assertThat(lambda: self.main_window.get_battery_menu(), Eventually(NotEquals(None)));
@@ -31,14 +41,6 @@ class TestDisplayMenus(IndicatorsTestCase):
31 page_loader = fn_loader();
41 page_loader = fn_loader();
32 self.assertThat(page_loader.progress, Eventually(Equals(1.0)))
42 self.assertThat(page_loader.progress, Eventually(Equals(1.0)))
35− # self.main_window.get_indicators_client().reset()
36− super(TestDisplayMenus, self).tearDown()
39− # We need to move these to emulators once autopilot supports emulators for
40− # applications started with AutopilotTestCase.launch_test_application
42 def switch_auto_brightness(self, auto_brightness):
44 def switch_auto_brightness(self, auto_brightness):
43 ab_switch = auto_brightness.select_single("CheckBox");
45 ab_switch = auto_brightness.select_single("CheckBox");
44 self.assertThat(ab_switch, NotEquals(None))
46 self.assertThat(ab_switch, NotEquals(None))
@@ -65,8 +67,10 @@ class TestDisplayMenus(IndicatorsTestCase):
66 old_ab_value = brightness_slider.value
68 old_ab_value = brightness_slider.value
70+ @unittest.skip("Battery indicator has been removed.")
68 def test_auto_bright_switch(self):
71 def test_auto_bright_switch(self):
69 """Test the auto-bright switch"""
72 """Test the auto-bright switch"""
73+ self.open_battery_menu()
71 # wait for the switch menu item
75 # wait for the switch menu item
72 fn_auto_brightness = lambda: self.app.select_single("SwitchMenuItem", objectName="auto-brightness");
76 fn_auto_brightness = lambda: self.app.select_single("SwitchMenuItem", objectName="auto-brightness");
@@ -84,8 +88,10 @@ class TestDisplayMenus(IndicatorsTestCase):
84 # TODO - should check backend when it's introspectable.
88 # TODO - should check backend when it's introspectable.
85 self.assertThat(auto_brightness.checked, Eventually(NotEquals(old_ab_value)))
89 self.assertThat(auto_brightness.checked, Eventually(NotEquals(old_ab_value)))
91+ @unittest.skip("Battery indicator has been removed.")
87 def test_brightness_slider(self):
92 def test_brightness_slider(self):
88 """Test the auto-bright switch"""
93 """Test the auto-bright switch"""
94+ self.open_battery_menu()
90 fn_brightness_menu = lambda: self.app.select_single("SliderMenuItem", objectName="brightness");
96 fn_brightness_menu = lambda: self.app.select_single("SliderMenuItem", objectName="brightness");
91 # FIXME: this should go away when we switch to indicator-power
97 # FIXME: this should go away when we switch to indicator-power