@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3−# Unity - Indicators Autopilot Test Suite
3+# Unity Indicators Autopilot Test Suite
4# Copyright (C) 2013 Canonical
4# Copyright (C) 2013 Canonical
6# This program is free software: you can redistribute it and/or modify
6# This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@
20from __future__ import absolute_import
20from __future__ import absolute_import
22−from autopilot import platform
22+from autopilot.platform import model
24from unity8.indicators.emulators.widget import DefaultIndicatorWidget
24from unity8.indicators.emulators.widget import DefaultIndicatorWidget
25from unity8.process_helpers import unlock_unity
25from unity8.process_helpers import unlock_unity
@@ -39,7 +39,7 @@ class IndicatorTestCase(UnityTestCase):
41 def setUp(self):
41 def setUp(self):
42− if model() == "Desktop":
42+ if self.model() == "Desktop":
43 self.skipTest("Test cannot be run on the desktop.")
43 self.skipTest("Test cannot be run on the desktop.")
44 super(IndicatorTestCase, self).setUp()
44 super(IndicatorTestCase, self).setUp()
@@ -56,20 +56,20 @@ class IndicatorTestCase(UnityTestCase):
56class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
56class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
58 scenarios = [
58 scenarios = [
59− ('Bluetooth', dict(indicator_name='indicator-bluetooth',
59+ #('Bluetooth', dict(indicator_name='indicator-bluetooth',
60− title='Bluetooth')),
60+ # title='Bluetooth')),
61− ('Datetime', dict(indicator_name='indicator-datetime',
61+ #('Datetime', dict(indicator_name='indicator-datetime',
62− title='Upcoming')),
62+ # title='Upcoming')),
63− ('Location', dict(indicator_name='indicator-location',
63+ #('Location', dict(indicator_name='indicator-location',
64− title='Location')),
64+ # title='Location')),
65− ('Messaging', dict(indicator_name='indicator-messages',
65+ #('Messaging', dict(indicator_name='indicator-messages',
66− title='Incoming')),
66+ # title='Incoming')),
67− ('Network', dict(indicator_name='indicator-network',
67+ #('Network', dict(indicator_name='indicator-network',
68− title='Network')),
68+ # title='Network')),
69 ('Power', dict(indicator_name='indicator-power',
69 ('Power', dict(indicator_name='indicator-power',
70 title='Battery')),
70 title='Battery')),
71− ('Sound', dict(indicator_name='indicator-sound',
71+ #('Sound', dict(indicator_name='indicator-sound',
72− title='Sound')),
72+ # title='Sound')),
75 def setUp(self):
75 def setUp(self):
@@ -85,12 +85,8 @@ class IndicatorPageTitleMatchesWidgetTestCase(UnityTestCase):
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(
89− self.main_window.get_indicator_widget(
88+ widget = self.main_window.get_indicator_widget(self.indicator_name)
93 self.assertIsNotNone(widget)
89 self.assertIsNotNone(widget)
94− self.swipe_to_open_indicator(widget, window)
90+ widget.swipe_to_open_indicator(window)
95 title = window.wait_select_single("IndicatorPage",
91 title = window.wait_select_single("IndicatorPage",
96 title=self.title)
92 title=self.title)