on xenial help sign in
Add stubs for indicators autopilot tests.
1663e5cAllan LeSage
qml/Panel/IndicatorItem.qml+7
@@ -26,6 +26,7 @@ Item {
26 property bool dimmed: false
26 property bool dimmed: false
27 property var indicatorProperties: undefined
27 property var indicatorProperties: undefined
28 property bool indicatorVisible: loader.item ? loader.item.enabled : false
28 property bool indicatorVisible: loader.item ? loader.item.enabled : false
29+ property string identifier
29
30
30 opacity: dimmed ? 0.4 : 1
31 opacity: dimmed ? 0.4 : 1
31 Behavior on opacity { StandardAnimation {} }
32 Behavior on opacity { StandardAnimation {} }
@@ -44,5 +45,11 @@ Item {
44 }
45 }
45 }
46 }
46 }
47 }
48+
49+ Binding {
50+ target: loader.item
51+ property: "objectName"
52+ value: identifier + "-widget"
53+ }
47 }
54 }
48}
55}
qml/Panel/IndicatorRow.qml+1
@@ -95,6 +95,7 @@ Item {
95
95
96 IndicatorItem {
96 IndicatorItem {
97 id: indicatorItem
97 id: indicatorItem
98+ identifier: model.identifier
98 height: parent.height
99 height: parent.height
99
100
100 dimmed: itemWrapper.dimmed
101 dimmed: itemWrapper.dimmed
tests/autopilot/unity8/indicators/__init__.pynew file

No changes to the content.

tests/autopilot/unity8/indicators/tests/__init__.pynew file

No changes to the content.

tests/autopilot/unity8/indicators/tests/test_indicators.pynew file+50
@@ -0,0 +1,50 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+#
3+# Unity - Indicators Autopilot Test Suite
4+# Copyright (C) 2013 Canonical
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License as published by
8+# the Free Software Foundation, either version 3 of the License, or
9+# (at your option) any later version.
10+#
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+#
19+
20+from __future__ import absolute_import
21+
22+from autopilot import platform
23+from testtools import skipIf
24+
25+from unity8.process_helpers import unlock_unity
26+from unity8.shell.tests import UnityTestCase
27+
28+
29+class IndicatorTestCase(UnityTestCase):
30+
31+ scenarios = [
32+ ('Bluetooth', dict(indicator_name='indicator-bluetooth')),
33+ ('Datetime', dict(indicator_name='indicator-datetime')),
34+ ('Location', dict(indicator_name='indicator-location')),
35+ ('Messaging', dict(indicator_name='indicator-messages')),
36+ ('Network', dict(indicator_name='indicator-network')),
37+ ('Power', dict(indicator_name='indicator-power')),
38+ ('Sound', dict(indicator_name='indicator-sound')),
39+ ]
40+
41+ @skipIf(platform.image_codename() == 'Desktop',
42+ "Unity8/phablet-only test!")
43+ def setUp(self):
44+ super(IndicatorTestCase, self).setUp()
45+
46+ def test_indicator_exists(self):
47+ unity_proxy = self.launch_unity()
48+ unlock_unity(unity_proxy)
49+ indicator = self.main_window.get_indicator(self.indicator_name)
50+ self.assertIsNotNone(indicator)
tests/autopilot/unity8/shell/emulators/main_window.py+6
@@ -91,5 +91,11 @@ class MainWindow(object):
91 def get_pinentryField(self):
91 def get_pinentryField(self):
92 return self.app.select_single(objectName="pinentryField")
92 return self.app.select_single(objectName="pinentryField")
93
93
94+ def get_indicator(self, indicator_name):
95+ return self.app.select_single(
96+ 'DefaultIndicatorWidget',
97+ objectName=indicator_name+'-widget'
98+ )
99+
94 def get_shell_background(self):
100 def get_shell_background(self):
95 return self.app.select_single("CrossFadeImage", objectName="backgroundImage")
101 return self.app.select_single("CrossFadeImage", objectName="backgroundImage")