@@ -0,0 +1,54 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+# Copyright 2013 Canonical
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.
8+"""qml-phone-shell autopilot tests."""
12+from autopilot.testcase import AutopilotTestCase
13+from autopilot.matchers import Eventually
14+from autopilot.platform import model
15+from testtools.matchers import Equals
17+from indicators_client.emulators.main_window import MainWindow
19+class FormFactors(object):
20+ Phone, Tablet, Desktop = range(3)
22+class IndicatorsTestCase(AutopilotTestCase):
24+ """A common test case class that provides several useful methods for shell tests."""
26+ def setUp(self, geometry, grid_size):
27+ super(ShellTestCase, self).setUp()
28+ self.launch_test_local(geometry)
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")
36+ def skipWrapper(*args, **kwargs):
39+ def form_factor(self):
40+ return FormFactors.Desktop
42+ def __getattribute__(self, attr_name):
43+ attr = object.__getattribute__(self, attr_name);
44+ if attr_name.startswith("test_"):
46+ if self.form_factor() in attr.blacklist:
47+ return self.skipWrapper
53+ def main_window(self):
54+ return MainWindow(self.app)