21 from testscenarios
import multiply_scenarios
23 import autopilot.platform
28 class IndicatorExistsTestCase(tests.DeviceIndicatorTestCase):
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
44 def test_indicator_exists(self):
45 self.main_window._get_indicator_panel_item(
50 class IndicatorPageTitleMatchesWidgetTestCase(tests.DeviceIndicatorTestCase):
52 indicator_scenarios = [
53 (
'Bluetooth', dict(indicator_name=
'indicator-bluetooth',
55 (
'Datetime', dict(indicator_name=
'indicator-datetime',
56 title=
'Time & Date')),
57 (
'Location', dict(indicator_name=
'indicator-location',
59 (
'Messaging', dict(indicator_name=
'indicator-messages',
60 title=
'Notifications')),
61 (
'Network', dict(indicator_name=
'indicator-network',
63 (
'Power', dict(indicator_name=
'indicator-power',
65 (
'Sound', dict(indicator_name=
'indicator-sound',
68 scenarios = multiply_scenarios(
70 tests.IndicatorTestCase.device_emulation_scenarios
73 def test_indicator_page_title_matches_widget(self):
74 """Swiping open an indicator must show its correct title.
76 See https://bugs.launchpad.net/ubuntu-ux/+bug/1253804 .
78 indicator_page = self.main_window.open_indicator_page(
80 if self.indicator_name ==
'indicator-bluetooth':
81 if autopilot.platform.model() ==
'Nexus 10':
82 self.expectFailure(
'Nexus 10 does not have bluetooth at the moment.',
83 self.assertTrue, indicator_page.visible)
84 if platform.linux_distribution()[2] ==
'wily':
85 self.expectFailure(
'Bluetooth doesn\'t work on wily at the moment.',
86 self.assertTrue, indicator_page.visible)
87 self.assertTrue(indicator_page.visible)
88 self.assertEqual(indicator_page.title, self.title)