@@ -15,11 +15,21 @@ from unity8.indicators_client.tests import IndicatorsTestCase
1515from time import sleep
1616import random
1717import math
18+import unittest
1819
1920class TestDisplayMenus(IndicatorsTestCase):
2021 def setUp(self):
2122 super(TestDisplayMenus, self).setUp(self.geometry, self.grid_unit)
2223
24+ def tearDown(self):
25+ # self.main_window.get_indicators_client().reset()
26+ super(TestDisplayMenus, self).tearDown()
27+
28+ # START SECTION
29+ # We need to move these to emulators once autopilot supports emulators for
30+ # applications started with AutopilotTestCase.launch_test_application
31+
32+ def open_battery_menu(self):
2333 # This opens the messaging menu so you don't have to do that in
2434 # every test case
2535 self.assertThat(lambda: self.main_window.get_battery_menu(), Eventually(NotEquals(None)));
@@ -31,14 +41,6 @@ class TestDisplayMenus(IndicatorsTestCase):
3141 page_loader = fn_loader();
3242 self.assertThat(page_loader.progress, Eventually(Equals(1.0)))
3343
34− def tearDown(self):
35− # self.main_window.get_indicators_client().reset()
36− super(TestDisplayMenus, self).tearDown()
37−
38− # START SECTION
39− # We need to move these to emulators once autopilot supports emulators for
40− # applications started with AutopilotTestCase.launch_test_application
41−
4244 def switch_auto_brightness(self, auto_brightness):
4345 ab_switch = auto_brightness.select_single("CheckBox");
4446 self.assertThat(ab_switch, NotEquals(None))
@@ -65,8 +67,10 @@ class TestDisplayMenus(IndicatorsTestCase):
6567
6668 old_ab_value = brightness_slider.value
6769
70+ @unittest.skip("Battery indicator has been removed.")
6871 def test_auto_bright_switch(self):
6972 """Test the auto-bright switch"""
73+ self.open_battery_menu()
7074
7175 # wait for the switch menu item
7276 fn_auto_brightness = lambda: self.app.select_single("SwitchMenuItem", objectName="auto-brightness");
@@ -84,8 +88,10 @@ class TestDisplayMenus(IndicatorsTestCase):
8488 # TODO - should check backend when it's introspectable.
8589 self.assertThat(auto_brightness.checked, Eventually(NotEquals(old_ab_value)))
8690
91+ @unittest.skip("Battery indicator has been removed.")
8792 def test_brightness_slider(self):
8893 """Test the auto-bright switch"""
94+ self.open_battery_menu()
8995
9096 fn_brightness_menu = lambda: self.app.select_single("SliderMenuItem", objectName="brightness");
9197 # FIXME: this should go away when we switch to indicator-power