@@ -0,0 +1,54 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+# Copyright 2013 Canonical
3+#
4+# This program is free software: you can redistribute it and/or modify it
5+# under the terms of the GNU General Public License version 3, as published
6+# by the Free Software Foundation.
7+
8+"""qml-phone-shell autopilot tests."""
9+
10+import os.path
11+
12+from autopilot.testcase import AutopilotTestCase
13+from autopilot.matchers import Eventually
14+from autopilot.platform import model
15+from testtools.matchers import Equals
16+
17+from indicators_client.emulators.main_window import MainWindow
18+
19+class FormFactors(object):
20+ Phone, Tablet, Desktop = range(3)
21+
22+class IndicatorsTestCase(AutopilotTestCase):
23+
24+ """A common test case class that provides several useful methods for shell tests."""
25+
26+ def setUp(self, geometry, grid_size):
27+ super(ShellTestCase, self).setUp()
28+ self.launch_test_local(geometry)
29+
30+ def launch_test_local(self, geometry):
31+ os.environ['LD_LIBRARY_PATH'] = "../../../unity_build/build/lib"
32+ os.environ['QML2_IMPORT_PATH'] = "../../builddir/plugins:../../builddir/tests/mocks"
33+ self.app = self.launch_test_application(
34+ "../../builddir/plugins/IndicatorsClient/client/indicators-client")
35+
36+ def skipWrapper(*args, **kwargs):
37+ pass
38+
39+ def form_factor(self):
40+ return FormFactors.Desktop
41+
42+ def __getattribute__(self, attr_name):
43+ attr = object.__getattribute__(self, attr_name);
44+ if attr_name.startswith("test_"):
45+ try:
46+ if self.form_factor() in attr.blacklist:
47+ return self.skipWrapper
48+ except:
49+ pass
50+ return attr
51+
52+ @property
53+ def main_window(self):
54+ return MainWindow(self.app)