19 from __future__
import absolute_import
21 from testscenarios
import multiply_scenarios
23 from autopilot
import platform
28 class IndicatorExistsTestCase(tests.IndicatorTestCase):
30 indicator_scenarios = [
31 (
'Bluetooth', dict(indicator_name=
'indicator-bluetooth')),
32 (
'Datetime', dict(indicator_name=
'indicator-datetime')),
33 (
'Location', dict(indicator_name=
'indicator-location')),
34 (
'Messaging', dict(indicator_name=
'indicator-messages')),
35 (
'Network', dict(indicator_name=
'indicator-network')),
36 (
'Power', dict(indicator_name=
'indicator-power')),
37 (
'Sound', dict(indicator_name=
'indicator-sound')),
39 scenarios = multiply_scenarios(
41 tests.IndicatorTestCase.device_emulation_scenarios
45 super(IndicatorExistsTestCase, self).
setUp()
46 if (platform.model() ==
'Nexus 10' and
47 self.indicator_name ==
'indicator-bluetooth'):
48 self.skipTest(
'Nexus 10 does not have bluetooth at the moment.')
50 def test_indicator_exists(self):
51 self.main_window._get_indicator_panel_item(
56 class IndicatorPageTitleMatchesWidgetTestCase(tests.IndicatorTestCase):
58 indicator_scenarios = [
59 (
'Bluetooth', dict(indicator_name=
'indicator-bluetooth',
61 (
'Datetime', dict(indicator_name=
'indicator-datetime',
62 title=
'Time & Date')),
63 (
'Location', dict(indicator_name=
'indicator-location',
65 (
'Messaging', dict(indicator_name=
'indicator-messages',
66 title=
'Notifications')),
67 (
'Network', dict(indicator_name=
'indicator-network',
69 (
'Power', dict(indicator_name=
'indicator-power',
71 (
'Sound', dict(indicator_name=
'indicator-sound',
74 scenarios = multiply_scenarios(
76 tests.IndicatorTestCase.device_emulation_scenarios
80 super(IndicatorPageTitleMatchesWidgetTestCase, self).
setUp()
81 if (platform.model() ==
'Nexus 10' and
82 self.indicator_name ==
'indicator-bluetooth'):
83 self.skipTest(
'Nexus 10 does not have bluetooth at the moment.')
85 def test_indicator_page_title_matches_widget(self):
86 """Swiping open an indicator must show its correct title.
88 See https://bugs.launchpad.net/ubuntu-ux/+bug/1253804 .
90 indicator_page = self.main_window.open_indicator_page(
92 self.assertTrue(indicator_page.visible)
93 self.assertEqual(indicator_page.title, self.title)