@@ -20,13 +20,13 @@
20from __future__ import absolute_import
20from __future__ import absolute_import
22from autopilot import platform
22from autopilot import platform
23−from testtools import skipIf
24+from unity8.indicators.emulators.widget import DefaultIndicatorWidget
25from unity8.process_helpers import unlock_unity
25from unity8.process_helpers import unlock_unity
26−from unity8.indicators.tests import IndicatorBaseTestCase
26+from unity8.shell.tests import UnityTestCase
29−class IndicatorTestCase(IndicatorBaseTestCase):
29+class IndicatorTestCase(UnityTestCase):
31 scenarios = [
31 scenarios = [
32 ('Bluetooth', dict(indicator_name='indicator-bluetooth')),
32 ('Bluetooth', dict(indicator_name='indicator-bluetooth')),
@@ -38,9 +38,9 @@ class IndicatorTestCase(IndicatorBaseTestCase):
38 ('Sound', dict(indicator_name='indicator-sound')),
38 ('Sound', dict(indicator_name='indicator-sound')),
41− @skipIf(platform.image_codename() == 'Desktop',
42− "Unity8/phablet-only test!")
43 def setUp(self):
41 def setUp(self):
42+ if model() == "Desktop":
43+ self.skipTest("Test cannot be run on the desktop.")
44 super(IndicatorTestCase, self).setUp()
44 super(IndicatorTestCase, self).setUp()
46 def test_indicator_exists(self):
46 def test_indicator_exists(self):
@@ -53,7 +53,7 @@ class IndicatorTestCase(IndicatorBaseTestCase):
53 self.assertIsNotNone(widget)
53 self.assertIsNotNone(widget)
56−class IndicatorPageTitleMatchesWidgetTestCase(IndicatorBaseTestCase):
56+class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
58 scenarios = [
58 scenarios = [
59 ('Bluetooth', dict(indicator_name='indicator-bluetooth',
59 ('Bluetooth', dict(indicator_name='indicator-bluetooth',
@@ -72,24 +72,25 @@ class IndicatorPageTitleMatchesWidgetTestCase(IndicatorBaseTestCase):
72 title='Sound')),
72 title='Sound')),
75− @skipIf(platform.image_codename() == 'Desktop',
76− "Unity8/phablet-only test!")
77 def setUp(self):
75 def setUp(self):
76+ if model() == "Desktop":
77+ self.skipTest("Test cannot be run on the desktop.")
78 super(IndicatorPageTitleMatchesWidgetTestCase, self).setUp()
78 super(IndicatorPageTitleMatchesWidgetTestCase, self).setUp()
80 def test_indicator_page_title_matches_widget(self):
80 def test_indicator_page_title_matches_widget(self):
81− """When I swipe open an indicator, I should see its correct title.
81+ """Swiping open an indicator must show its correct title.
83 See https://bugs.launchpad.net/ubuntu-ux/+bug/1253804 .
83 See https://bugs.launchpad.net/ubuntu-ux/+bug/1253804 .
85 unity_proxy = self.launch_unity()
85 unity_proxy = self.launch_unity()
86 unlock_unity(unity_proxy)
86 unlock_unity(unity_proxy)
87 window = self.main_window.get_qml_view()
87 window = self.main_window.get_qml_view()
88+ widget = DefaultIndicatorWidget(
88− widget = self.main_window.get_indicator_widget(
89+ self.main_window.get_indicator_widget(
89− self.indicator_name
90+ self.indicator_name
91 self.assertIsNotNone(widget)
93 self.assertIsNotNone(widget)
92 self.swipe_to_open_indicator(widget, window)
94 self.swipe_to_open_indicator(widget, window)
93 title = window.wait_select_single("IndicatorPage",
95 title = window.wait_select_single("IndicatorPage",
94 title=self.title)
96 title=self.title)
95− self.assertIsNotNone(title)