on xenial help sign in
Add stubs for indicators autopilot tests.

Approved by PS Jenkins bot, Leo Arias, Michał Sawicz, Nick Dedekind, Christopher Lee.

commit1663e5cd43531c524a0535ed02577017590fd7ce authorAllan LeSage <allan.lesage@canonical.com> dateFri 10 Jan 2014, 13:48 (13 years ago) parenteb43f0ed4de49d
6 files changed+64
qml/Panel/IndicatorItem.qml+7 qml/Panel/IndicatorRow.qml+1 tests/autopilot/unity8/indicators/__init__.py tests/autopilot/unity8/indicators/tests/__init__.py tests/autopilot/unity8/indicators/tests/test_indicators.py+50 tests/autopilot/unity8/shell/emulators/main_window.py+6
qml/Panel/IndicatorItem.qml+7
@@ -26,6 +26,7 @@ Item {
2626 property bool dimmed: false
2727 property var indicatorProperties: undefined
2828 property bool indicatorVisible: loader.item ? loader.item.enabled : false
29+ property string identifier
2930
3031 opacity: dimmed ? 0.4 : 1
3132 Behavior on opacity { StandardAnimation {} }
@@ -44,5 +45,11 @@ Item {
4445 }
4546 }
4647 }
48+
49+ Binding {
50+ target: loader.item
51+ property: "objectName"
52+ value: identifier + "-widget"
53+ }
4754 }
4855}
qml/Panel/IndicatorRow.qml+1
@@ -95,6 +95,7 @@ Item {
9595
9696 IndicatorItem {
9797 id: indicatorItem
98+ identifier: model.identifier
9899 height: parent.height
99100
100101 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):
9191 def get_pinentryField(self):
9292 return self.app.select_single(objectName="pinentryField")
9393
94+ def get_indicator(self, indicator_name):
95+ return self.app.select_single(
96+ 'DefaultIndicatorWidget',
97+ objectName=indicator_name+'-widget'
98+ )
99+
94100 def get_shell_background(self):
95101 return self.app.select_single("CrossFadeImage", objectName="backgroundImage")