19 from __future__
import absolute_import
21 from testscenarios
import multiply_scenarios
23 from autopilot
import platform
29 class IndicatorTestCase(UnityTestCase):
31 device_emulation_scenarios = _get_device_emulation_scenarios()
34 if platform.model() ==
'Desktop':
35 self.skipTest(
'Test cannot be run on the desktop.')
36 super(IndicatorTestCase, self).setUp()
37 self.unity_proxy = self.launch_unity()
38 unlock_unity(self.unity_proxy)
41 class IndicatorExistsTestCase(IndicatorTestCase):
43 indicator_scenarios = [
44 (
'Bluetooth', dict(indicator_name=
'indicator-bluetooth')),
45 (
'Datetime', dict(indicator_name=
'indicator-datetime')),
46 (
'Location', dict(indicator_name=
'indicator-location')),
47 (
'Messaging', dict(indicator_name=
'indicator-messages')),
48 (
'Network', dict(indicator_name=
'indicator-network')),
49 (
'Power', dict(indicator_name=
'indicator-power')),
50 (
'Sound', dict(indicator_name=
'indicator-sound')),
52 scenarios = multiply_scenarios(
54 IndicatorTestCase.device_emulation_scenarios
58 super(IndicatorExistsTestCase, self).setUp()
59 if (platform.model() ==
'Nexus 10' and
60 self.indicator_name ==
'indicator-bluetooth'):
61 self.skipTest(
'Nexus 10 does not have bluetooth at the moment.')
63 def test_indicator_exists(self):
64 self.main_window._get_indicator_widget(
69 class IndicatorPageTitleMatchesWidgetTestCase(IndicatorTestCase):
71 indicator_scenarios = [
72 (
'Bluetooth', dict(indicator_name=
'indicator-bluetooth',
74 (
'Datetime', dict(indicator_name=
'indicator-datetime',
76 (
'Location', dict(indicator_name=
'indicator-location',
78 (
'Messaging', dict(indicator_name=
'indicator-messages',
79 title=
'Notification center')),
80 (
'Network', dict(indicator_name=
'indicator-network',
82 (
'Power', dict(indicator_name=
'indicator-power',
84 (
'Sound', dict(indicator_name=
'indicator-sound',
87 scenarios = multiply_scenarios(
89 IndicatorTestCase.device_emulation_scenarios
93 super(IndicatorPageTitleMatchesWidgetTestCase, self).setUp()
94 if (platform.model() ==
'Nexus 10' and
95 self.indicator_name ==
'indicator-bluetooth'):
96 self.skipTest(
'Nexus 10 does not have bluetooth at the moment.')
98 def test_indicator_page_title_matches_widget(self):
99 """Swiping open an indicator must show its correct title.
101 See https://bugs.launchpad.net/ubuntu-ux/+bug/1253804 .
103 indicator_page = self.main_window.open_indicator_page(
105 self.assertTrue(indicator_page.visible)
106 self.assertEqual(indicator_page.title, self.title)