Merge lp:~om26er/ubuntu-weather-app/port_autopilot_1.3 into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Omer Akram
Status: Merged
Approved by: Martin Borho
Approved revision: 27
Merged at revision: 27
Proposed branch: lp:~om26er/ubuntu-weather-app/port_autopilot_1.3
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 83 lines (+25/-16)
2 files modified
tests/autopilot/ubuntu_weather_app/tests/__init__.py (+23/-14)
tests/autopilot/ubuntu_weather_app/tests/test_mainview.py (+2/-2)
To merge this branch: bzr merge lp:~om26er/ubuntu-weather-app/port_autopilot_1.3
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Martin Borho Approve
Review via email: mp+166792@code.launchpad.net

Commit message

Port autopilot tests to 1.3

Description of the change

Port autopilot tests to 1.3

To post a comment you must log in.
Revision history for this message
Martin Borho (martin-borho) :
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py'
--- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-04-22 13:20:27 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-05-31 13:26:50 +0000
@@ -10,24 +10,32 @@
10import os.path10import os.path
11import glob11import glob
1212
13from autopilot.introspection.qt import QtIntrospectionTestMixin13from autopilot.input import Mouse, Touch, Pointer
14from autopilot.platform import model
14from autopilot.testcase import AutopilotTestCase15from autopilot.testcase import AutopilotTestCase
1516
16from ubuntu_weather_app.emulators.main_window import MainWindow17from ubuntu_weather_app.emulators.main_window import MainWindow
1718
1819
19class WeatherTestCase(AutopilotTestCase, QtIntrospectionTestMixin):20class WeatherTestCase(AutopilotTestCase):
2021
21 """A common test case class that provides several useful methods for22 """A common test case class that provides several useful methods for
22 weather app tests."""23 weather app tests."""
2324
25 if model() == 'Desktop':
26 scenarios = [('with mouse', dict(input_device_class=Mouse))]
27 else:
28 scenarios = [('with touch', dict(input_device_class=Touch))]
29
30 local_location = "../../ubuntu-weather-app.qml"
31
24 def setUp(self):32 def setUp(self):
33 self.pointing_device = Pointer(self.input_device_class.create())
25 super(WeatherTestCase, self).setUp()34 super(WeatherTestCase, self).setUp()
26 # Lets assume we are installed system wide if this file is in /usr35 if os.path.exists(self.local_location):
27 if os.path.realpath(__file__).startswith("/usr/"):36 self.launch_test_local()
37 else:
28 self.launch_test_installed()38 self.launch_test_installed()
29 else:
30 self.launch_test_local()
3139
32 """Workaround to find the qmlscene binary via shell globbing.40 """Workaround to find the qmlscene binary via shell globbing.
33 This is needed since we can't rely on qt5-default being installed on41 This is needed since we can't rely on qt5-default being installed on
@@ -36,16 +44,17 @@
36 return glob.glob("/usr/lib/*/qt5/bin/qmlscene")[0]44 return glob.glob("/usr/lib/*/qt5/bin/qmlscene")[0]
3745
38 def launch_test_local(self):46 def launch_test_local(self):
39 self.app = self.launch_test_application(self.qmlscene(),47 self.app = self.launch_test_application(
40 "../../ubuntu-weather-app.qml")48 self.qmlscene(),
49 self.local_location,
50 app_type='qt')
4151
42 def launch_test_installed(self):52 def launch_test_installed(self):
43 main_qml = "/usr/share/ubuntu-weather-app/ubutnu-weather-app.qml"53 self.app = self.launch_test_application(
44 self.app = self.launch_test_application(self.qmlscene(), main_qml)54 self.qmlscene(),
4555 "/usr/share/ubuntu-weather-app/ubuntu-weather-app.qml",
46 @staticmethod56 "--desktop_file_hint=/usr/share/applications/ubuntu-weather-app.desktop",
47 def running_on_device():57 app_type='qt')
48 return os.path.isfile('/system/usr/idc/autopilot-finger.idc')
4958
50 @property59 @property
51 def main_window(self):60 def main_window(self):
5261
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_mainview.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-04-22 13:20:27 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-05-31 13:26:50 +0000
@@ -22,8 +22,8 @@
22 In the testfarm, the application may take some time to show up."""22 In the testfarm, the application may take some time to show up."""
23 def setUp(self):23 def setUp(self):
24 super(TestMainView, self).setUp()24 super(TestMainView, self).setUp()
25 self.assertThat(self.main_window.get_qml_view().visible,25 self.assertThat(
26 Eventually(Equals(True)))26 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
2727
28 def tearDown(self):28 def tearDown(self):
29 super(TestMainView, self).tearDown()29 super(TestMainView, self).tearDown()

Subscribers

People subscribed via source and target branches