Merge lp:~om26er/phone-app/port_autopilot_1.3 into lp:phone-app

Proposed by Omer Akram
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 647
Merged at revision: 646
Proposed branch: lp:~om26er/phone-app/port_autopilot_1.3
Merge into: lp:phone-app
Diff against target: 124 lines (+35/-15)
4 files modified
tests/autopilot/phone_app/tests/__init__.py (+32/-12)
tests/autopilot/phone_app/tests/test_call_panel.py (+1/-1)
tests/autopilot/phone_app/tests/test_communication_panel.py (+1/-1)
tests/autopilot/phone_app/tests/test_contacts_panel.py (+1/-1)
To merge this branch: bzr merge lp:~om26er/phone-app/port_autopilot_1.3
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+161888@code.launchpad.net

Commit message

port the phone-app autopilot tests to 1.3

Description of the change

port the phone-app autopilot tests to 1.3

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/phone_app/tests/__init__.py'
2--- tests/autopilot/phone_app/tests/__init__.py 2013-04-05 20:01:45 +0000
3+++ tests/autopilot/phone_app/tests/__init__.py 2013-05-03 18:28:28 +0000
4@@ -9,16 +9,16 @@
5
6 """Phone App autopilot tests."""
7
8-from autopilot.introspection.qt import QtIntrospectionTestMixin
9+from autopilot.input import Mouse, Touch, Pointer
10+from autopilot.matchers import Eventually
11+from autopilot.platform import model
12 from autopilot.testcase import AutopilotTestCase
13+from testtools.matchers import Equals
14
15 from phone_app.emulators.call_panel import CallPanel
16 from phone_app.emulators.communication_panel import CommunicationPanel
17 from phone_app.emulators.contacts_panel import ContactsPanel
18
19-from testtools.matchers import Equals
20-from autopilot.matchers import Eventually
21-
22 import os
23
24 import logging
25@@ -26,30 +26,50 @@
26 logger = logging.getLogger(__name__)
27
28
29-class PhoneAppTestCase(AutopilotTestCase, QtIntrospectionTestMixin):
30+class PhoneAppTestCase(AutopilotTestCase):
31 """A common test case class that provides several useful methods for
32 Phone App tests.
33
34 """
35+
36+ if model() == 'Desktop':
37+ scenarios = [
38+ ('with mouse', dict(input_device_class=Mouse)),
39+ ]
40+ else:
41+ scenarios = [
42+ ('with touch', dict(input_device_class=Touch)),
43+ ]
44+
45+ local_location = "../../src/phone-app"
46+
47 def setUp(self):
48+ self.pointing_device = Pointer(self.input_device_class.create())
49 super(PhoneAppTestCase, self).setUp()
50
51- # Lets assume we are installed system wide if this file is somewhere in /usr
52- if os.path.realpath(__file__).startswith("/usr/"):
53+ if os.path.exists(self.local_location):
54+ self.launch_test_local()
55+ else:
56 self.launch_test_installed()
57- else:
58- self.launch_test_local()
59
60 main_view = self.get_main_view()
61 self.assertThat(main_view.visible, Eventually(Equals(True)))
62
63 def launch_test_local(self):
64 self.app = self.launch_test_application(
65- "../../src/phone-app", "--test-contacts")
66+ self.local_location, "--test-contacts", app_type='qt')
67
68 def launch_test_installed(self):
69- self.app = self.launch_test_application(
70- "phone-app", "--test-contacts")
71+ if model() == 'Desktop':
72+ self.app = self.launch_test_application(
73+ "phone-app",
74+ "--test-contacts")
75+ else:
76+ self.app = self.launch_test_application(
77+ "phone-app",
78+ "--test-contacts",
79+ "--desktop_file_hint=/usr/share/applications/phone-app.desktop",
80+ app_type='qt')
81
82 def get_main_view(self):
83 return self.app.select_single("QQuickView")
84
85=== modified file 'tests/autopilot/phone_app/tests/test_call_panel.py'
86--- tests/autopilot/phone_app/tests/test_call_panel.py 2013-03-12 20:48:18 +0000
87+++ tests/autopilot/phone_app/tests/test_call_panel.py 2013-05-03 18:28:28 +0000
88@@ -11,8 +11,8 @@
89
90 from __future__ import absolute_import
91
92+from autopilot.matchers import Eventually
93 from testtools.matchers import Equals
94-from autopilot.matchers import Eventually
95
96 from phone_app.tests import PhoneAppTestCase
97
98
99=== modified file 'tests/autopilot/phone_app/tests/test_communication_panel.py'
100--- tests/autopilot/phone_app/tests/test_communication_panel.py 2013-03-22 18:57:54 +0000
101+++ tests/autopilot/phone_app/tests/test_communication_panel.py 2013-05-03 18:28:28 +0000
102@@ -11,8 +11,8 @@
103
104 from __future__ import absolute_import
105
106+from autopilot.matchers import Eventually
107 from testtools.matchers import Equals
108-from autopilot.matchers import Eventually
109
110 from phone_app.tests import PhoneAppTestCase
111
112
113=== modified file 'tests/autopilot/phone_app/tests/test_contacts_panel.py'
114--- tests/autopilot/phone_app/tests/test_contacts_panel.py 2013-03-12 20:48:18 +0000
115+++ tests/autopilot/phone_app/tests/test_contacts_panel.py 2013-05-03 18:28:28 +0000
116@@ -11,8 +11,8 @@
117
118 from __future__ import absolute_import
119
120+from autopilot.matchers import Eventually
121 from testtools.matchers import Equals, GreaterThan
122-from autopilot.matchers import Eventually
123
124 from phone_app.tests import PhoneAppTestCase
125

Subscribers

People subscribed via source and target branches