Merge lp:~om26er/messaging-app/use_fixture into lp:messaging-app
- use_fixture
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gustavo Pichorim Boiko | ||||
Approved revision: | 140 | ||||
Merged at revision: | 140 | ||||
Proposed branch: | lp:~om26er/messaging-app/use_fixture | ||||
Merge into: | lp:messaging-app | ||||
Diff against target: |
489 lines (+137/-188) 4 files modified
tests/autopilot/messaging_app/emulators.py (+20/-0) tests/autopilot/messaging_app/fixture_setup.py (+89/-0) tests/autopilot/messaging_app/helpers.py (+2/-1) tests/autopilot/messaging_app/tests/test_messaging.py (+26/-187) |
||||
To merge this branch: | bzr merge lp:~om26er/messaging-app/use_fixture | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Pichorim Boiko (community) | Approve | ||
Brendan Donegan (community) | Approve | ||
Leo Arias (community) | code review | Approve | |
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+225350@code.launchpad.net |
Commit message
pull out the functions in setUp() and tearDown() into a fixture, to be consumed by other projects, wrote send_message helper.
Description of the change
pull out the functions in setUp() and tearDown() into a fixture, to be consumed by other projects. Also created a reusable helper to send a message.
Are there any related MPs required for this MP to build/function as expected? Please list.
None.
Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes.
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Not needed.
Did you successfully run all tests found in your component's Test Plan on device or emulator?
tests are passing
If you changed the UI, was the change specified/approved by design?
None
If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
None
- 125. By Omer Akram
-
fix style
PS Jenkins bot (ps-jenkins) wrote : | # |
- 126. By Omer Akram
-
fix pep8 failure
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:126
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 127. By Omer Akram
-
small stuff
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:127
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 128. By Omer Akram
-
autopilot: port to python3
- 129. By Omer Akram
-
revert last commit, seems someone else already ported it in a different MR
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:129
http://
Executed test runs:
ABORTED: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
+class MessagingFixtur
This needs a more meaningful name. Probably it would be better to split the fixture in one to backup the history, one to use phonesym, and one to reset the services.
Then combine them in one that could be called MessagingTestEn
Leo Arias (elopio) wrote : | # |
Also, try to add the clean up one line before calling the set up. That will make sure that the clean up is run even if the set up fails in the middle. For that, you will have to make sure also that the clean up doesn't fail if the set up as not completed.
- 130. By Omer Akram
-
split fixture into subclasses
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:130
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 131. By Omer Akram
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:131
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 132. By Omer Akram
-
make flake8 happy
- 133. By Omer Akram
-
add helper to send a message
- 134. By Omer Akram
-
use newly written send_message and delete all the duplicate code
- 135. By Omer Akram
-
move _is_phonesim_
running to the right class - 136. By Omer Akram
-
fix merge conflict revert
- 137. By Omer Akram
-
wtf vim
Omer Akram (om26er) wrote : | # |
> +class MessagingFixtur
>
> This needs a more meaningful name. Probably it would be better to split the
> fixture in one to backup the history, one to use phonesym, and one to reset
> the services.
> Then combine them in one that could be called MessagingTestEn
Ok, I split this fixture into multiple fixtures and incorporated that into one.
Omer Akram (om26er) wrote : | # |
Leo: Also note the send_message method was added after your review comment on my UX test branch.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:132
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:137
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:137
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
Awesome! Thank you Omer.
21 + self.get_
In here, please call the count before the message is sent, like
original_
[...]
self.get_
That way it works even if you want to send more than one message.
43 +import fixtures
44 +import subprocess
45 +import os
These needs to be sorted alphabetically, and following the pep8 rule that first we have the list of internal python modules:
import os
import subprocess
import fixtures
The rest is just so cool. You removed the duplication and put it in a reusable component. Nice work.
- 138. By Omer Akram
-
fix send_message per suggestions
- 139. By Omer Akram
-
change import order
- 140. By Omer Akram
-
fix for py3
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:140
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Omer Akram (om26er) wrote : | # |
> Awesome! Thank you Omer.
>
> 21 + self.get_
>
> In here, please call the count before the message is sent, like
>
> original_
> [...]
> self.get_
> ages + 1)
>
> That way it works even if you want to send more than one message.
>
> 43 +import fixtures
> 44 +import subprocess
> 45 +import os
>
> These needs to be sorted alphabetically, and following the pep8 rule that
> first we have the list of internal python modules:
>
> import os
> import subprocess
>
> import fixtures
>
> The rest is just so cool. You removed the duplication and put it in a reusable
> component. Nice work.
DONE!
Leo Arias (elopio) : | # |
Gustavo Pichorim Boiko (boiko) wrote : | # |
The code looks good. Can you please just do the MP submission checklist before it gets the final approval?
https:/
Omer Akram (om26er) wrote : | # |
Are there any related MPs required for this MP to build/function as expected? Please list.
None.
Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes.
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Not needed.
Did you successfully run all tests found in your component's Test Plan on device or emulator?
tests are passing
If you changed the UI, was the change specified/approved by design?
None
If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
None
Gustavo Pichorim Boiko (boiko) wrote : | # |
Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes
Did CI run pass? If not, please explain why.
Yes
Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes
Code looks good and works as expected!
Preview Diff
1 | === modified file 'tests/autopilot/messaging_app/emulators.py' |
2 | --- tests/autopilot/messaging_app/emulators.py 2014-07-08 08:35:32 +0000 |
3 | +++ tests/autopilot/messaging_app/emulators.py 2014-07-11 10:28:53 +0000 |
4 | @@ -368,6 +368,26 @@ |
5 | message.swipe_to_delete() |
6 | message.confirm_removal() |
7 | |
8 | + @autopilot_logging.log_action(logger.info) |
9 | + def send_message(self, number, message): |
10 | + """Write a new message and send it. |
11 | + |
12 | + :param number: number of the contact to send message to. |
13 | + :param message: the message to be sent. |
14 | + |
15 | + """ |
16 | + self.start_new_message() |
17 | + self.type_contact_phone_num(number) |
18 | + self.type_message(message) |
19 | + old_message_count = self.get_multiple_selection_list_view().count |
20 | + self.click_send_button() |
21 | + |
22 | + self.get_multiple_selection_list_view().count.wait_for( |
23 | + old_message_count + 1) |
24 | + thread_bubble = self.get_message(message) |
25 | + |
26 | + return thread_bubble |
27 | + |
28 | |
29 | class PageWithBottomEdge(MainView): |
30 | """An emulator class that makes it easy to interact with the bottom edge |
31 | |
32 | === added file 'tests/autopilot/messaging_app/fixture_setup.py' |
33 | --- tests/autopilot/messaging_app/fixture_setup.py 1970-01-01 00:00:00 +0000 |
34 | +++ tests/autopilot/messaging_app/fixture_setup.py 2014-07-11 10:28:53 +0000 |
35 | @@ -0,0 +1,89 @@ |
36 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
37 | +# Copyright 2014 Canonical |
38 | +# |
39 | +# This file is part of messaging-app. |
40 | +# |
41 | +# messaging-app is free software: you can redistribute it and/or modify it |
42 | +# under the terms of the GNU General Public License version 3, as published |
43 | +# by the Free Software Foundation. |
44 | + |
45 | +import os |
46 | +import subprocess |
47 | + |
48 | +import fixtures |
49 | + |
50 | + |
51 | +class MessagingTestEnvironment(fixtures.Fixture): |
52 | + |
53 | + def setUp(self): |
54 | + super(MessagingTestEnvironment, self).setUp() |
55 | + self.useFixture(OfonoPhoneSIM()) |
56 | + self.useFixture(BackupHistory()) |
57 | + self.useFixture(RespawnService()) |
58 | + |
59 | + |
60 | +class BackupHistory(fixtures.Fixture): |
61 | + |
62 | + def setUp(self): |
63 | + super(BackupHistory, self).setUp() |
64 | + self.addCleanup(self._restore_history) |
65 | + self._backup_history() |
66 | + |
67 | + def _backup_history(self): |
68 | + self.history = os.path.expanduser( |
69 | + '~/.local/share/history-service/history.sqlite') |
70 | + if os.path.exists(self.history): |
71 | + os.rename(self.history, self.history + '.orig') |
72 | + |
73 | + def _restore_history(self): |
74 | + try: |
75 | + os.unlink(self.history) |
76 | + except OSError: |
77 | + pass |
78 | + if os.path.exists(self.history + '.orig'): |
79 | + os.rename(self.history + '.orig', self.history) |
80 | + |
81 | + |
82 | +class RespawnService(fixtures.Fixture): |
83 | + |
84 | + def setUp(self): |
85 | + super(RespawnService, self).setUp() |
86 | + self.addCleanup(self._kill_services_to_respawn) |
87 | + self._kill_services_to_respawn() |
88 | + |
89 | + def _kill_services_to_respawn(self): |
90 | + subprocess.call(['pkill', 'history-daemon']) |
91 | + subprocess.call(['pkill', '-f', 'telephony-service-handler']) |
92 | + |
93 | + |
94 | +class OfonoPhoneSIM(fixtures.Fixture): |
95 | + |
96 | + def setUp(self): |
97 | + super(OfonoPhoneSIM, self).setUp() |
98 | + if not self._is_phonesim_running(): |
99 | + raise RuntimeError('ofono-phonesim is not setup') |
100 | + self.addCleanup(self._restore_sim_connection) |
101 | + self._set_modem_on_phonesim() |
102 | + |
103 | + def _is_phonesim_running(self): |
104 | + try: |
105 | + out = subprocess.check_output( |
106 | + ['/usr/share/ofono/scripts/list-modems'], |
107 | + stderr=subprocess.PIPE, |
108 | + universal_newlines=True |
109 | + ) |
110 | + return out.startswith('[ /phonesim ]') |
111 | + except subprocess.CalledProcessError: |
112 | + return False |
113 | + |
114 | + def _set_modem_on_phonesim(self): |
115 | + subprocess.call( |
116 | + ['mc-tool', 'update', 'ofono/ofono/account0', |
117 | + 'string:modem-objpath=/phonesim']) |
118 | + subprocess.call(['mc-tool', 'reconnect', 'ofono/ofono/account0']) |
119 | + |
120 | + def _restore_sim_connection(self): |
121 | + subprocess.call( |
122 | + ['mc-tool', 'update', 'ofono/ofono/account0', |
123 | + 'string:modem-objpath=/ril_0']) |
124 | + subprocess.call(['mc-tool', 'reconnect', 'ofono/ofono/account0']) |
125 | |
126 | === modified file 'tests/autopilot/messaging_app/helpers.py' |
127 | --- tests/autopilot/messaging_app/helpers.py 2014-07-08 23:12:48 +0000 |
128 | +++ tests/autopilot/messaging_app/helpers.py 2014-07-11 10:28:53 +0000 |
129 | @@ -14,6 +14,7 @@ |
130 | import subprocess |
131 | import sys |
132 | import time |
133 | + |
134 | from dbus import exceptions |
135 | |
136 | |
137 | @@ -100,7 +101,7 @@ |
138 | mc_tool = subprocess.Popen( |
139 | [ |
140 | 'mc-tool', |
141 | - 'list', |
142 | + 'list' |
143 | ], stdout=subprocess.PIPE, universal_newlines=True) |
144 | mc_accounts = mc_tool.communicate()[0] |
145 | return 'ofono/ofono/account' in mc_accounts |
146 | |
147 | === modified file 'tests/autopilot/messaging_app/tests/test_messaging.py' |
148 | --- tests/autopilot/messaging_app/tests/test_messaging.py 2014-06-30 08:42:16 +0000 |
149 | +++ tests/autopilot/messaging_app/tests/test_messaging.py 2014-07-11 10:28:53 +0000 |
150 | @@ -11,50 +11,25 @@ |
151 | |
152 | from __future__ import absolute_import |
153 | |
154 | -import os |
155 | import subprocess |
156 | import time |
157 | |
158 | from autopilot.matchers import Eventually |
159 | from testtools.matchers import Equals, HasLength |
160 | -from testtools import skipIf, skip |
161 | +from testtools import skip |
162 | |
163 | from messaging_app import emulators |
164 | +from messaging_app import fixture_setup |
165 | from messaging_app import helpers |
166 | from messaging_app.tests import MessagingAppTestCase |
167 | |
168 | |
169 | -@skipIf(os.uname()[2].endswith('maguro'), |
170 | - 'tests cause Unity crashes on maguro') |
171 | class BaseMessagingTestCase(MessagingAppTestCase): |
172 | |
173 | def setUp(self): |
174 | - # determine whether we are running with phonesim |
175 | - try: |
176 | - out = subprocess.check_output( |
177 | - ['/usr/share/ofono/scripts/list-modems'], |
178 | - stderr=subprocess.PIPE, |
179 | - universal_newlines=True |
180 | - ) |
181 | - have_phonesim = out.startswith('[ /phonesim ]') |
182 | - except subprocess.CalledProcessError: |
183 | - have_phonesim = False |
184 | - |
185 | - self.assertTrue(have_phonesim) |
186 | - |
187 | - # provide clean history |
188 | - self.history = os.path.expanduser( |
189 | - '~/.local/share/history-service/history.sqlite') |
190 | - if os.path.exists(self.history): |
191 | - os.rename(self.history, self.history + '.orig') |
192 | - subprocess.call(['pkill', 'history-daemon']) |
193 | - subprocess.call(['pkill', '-f', 'telephony-service-handler']) |
194 | - |
195 | - # make sure the modem is running on phonesim |
196 | - subprocess.call( |
197 | - ['mc-tool', 'update', 'ofono/ofono/account0', |
198 | - 'string:modem-objpath=/phonesim']) |
199 | - subprocess.call(['mc-tool', 'reconnect', 'ofono/ofono/account0']) |
200 | + |
201 | + test_setup = fixture_setup.MessagingTestEnvironment() |
202 | + self.useFixture(test_setup) |
203 | |
204 | super(BaseMessagingTestCase, self).setUp() |
205 | |
206 | @@ -66,22 +41,6 @@ |
207 | def tearDown(self): |
208 | super(BaseMessagingTestCase, self).tearDown() |
209 | |
210 | - # restore history |
211 | - try: |
212 | - os.unlink(self.history) |
213 | - except OSError: |
214 | - pass |
215 | - if os.path.exists(self.history + '.orig'): |
216 | - os.rename(self.history + '.orig', self.history) |
217 | - subprocess.call(['pkill', 'history-daemon']) |
218 | - subprocess.call(['pkill', '-f', 'telephony-service-handler']) |
219 | - |
220 | - # restore the original connection |
221 | - subprocess.call( |
222 | - ['mc-tool', 'update', 'ofono/ofono/account0', |
223 | - 'string:modem-objpath=/ril_0']) |
224 | - subprocess.call(['mc-tool', 'reconnect', 'ofono/ofono/account0']) |
225 | - |
226 | # on desktop, notify-osd may generate persistent popups (like for "SMS |
227 | # received"), don't make that stay around for the tests |
228 | subprocess.call(['pkill', '-f', 'notify-osd']) |
229 | @@ -122,26 +81,9 @@ |
230 | |
231 | def test_write_new_message(self): |
232 | """Verify we can write and send a new text message""" |
233 | - self.main_view.start_new_message() |
234 | - # verify the thread list page is not visible |
235 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
236 | - |
237 | - # type contact/number |
238 | - phone_num = 123 |
239 | - self.main_view.type_contact_phone_num(phone_num) |
240 | - |
241 | - # type message |
242 | + phone_num = '123' |
243 | message = 'hello from Ubuntu' |
244 | - self.main_view.type_message(message) |
245 | - |
246 | - # send |
247 | - self.main_view.click_send_button() |
248 | - |
249 | - # verify that we get a bubble with our message |
250 | - list_view = self.main_view.get_multiple_selection_list_view() |
251 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
252 | - # verify label text |
253 | - self.main_view.get_message('hello from Ubuntu') |
254 | + self.main_view.send_message(phone_num, message) |
255 | |
256 | # switch back to main page with thread list |
257 | self.main_view.close_osk() |
258 | @@ -155,30 +97,16 @@ |
259 | self.assertThat(self.thread_list.count, Equals(1)) |
260 | # verify our number |
261 | thread = self.main_view.get_thread_from_number(phone_num) |
262 | - self.assertThat(thread.phoneNumber, Equals('123')) |
263 | + self.assertThat(thread.phoneNumber, Equals(phone_num)) |
264 | # verify our text |
265 | - thread.wait_select_single('Label', text='hello from Ubuntu') |
266 | + thread.wait_select_single('Label', text=message) |
267 | |
268 | @skip("long press is currently invoking a context menu") |
269 | def test_deleting_message_long_press(self): |
270 | """Verify we can delete a message with a long press on the message""" |
271 | - self.main_view.start_new_message() |
272 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
273 | - |
274 | - # type address number |
275 | phone_num = '555-555-4321' |
276 | - self.main_view.type_contact_phone_num(phone_num) |
277 | - # type message |
278 | message = 'delete me' |
279 | - self.main_view.type_message(message) |
280 | - |
281 | - # send |
282 | - self.main_view.click_send_button() |
283 | - |
284 | - # verify that we get a bubble with our message |
285 | - list_view = self.main_view.get_multiple_selection_list_view() |
286 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
287 | - bubble = self.main_view.get_message(message) |
288 | + bubble = self.main_view.send_message(phone_num, message) |
289 | |
290 | self.main_view.close_osk() |
291 | |
292 | @@ -194,24 +122,9 @@ |
293 | @skip("long press is currently invoking a context menu") |
294 | def test_cancel_deleting_message_long_press(self): |
295 | """Verify we can cancel deleting a message with a long press""" |
296 | - self.main_view.start__new_message_button() |
297 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
298 | - |
299 | - # type address number |
300 | phone_num = '5555551234' |
301 | - self.main_view.type_contact_phone_num(phone_num) |
302 | - |
303 | - # type message |
304 | message = 'do not delete' |
305 | - self.main_view.type_message(message) |
306 | - |
307 | - # send |
308 | - self.main_view.click_send_button() |
309 | - |
310 | - # verify that we get a bubble with our message |
311 | - list_view = self.main_view.get_multiple_selection_list_view() |
312 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
313 | - bubble = self.main_view.get_message(message) |
314 | + bubble = self.main_view.send_message(phone_num, message) |
315 | |
316 | self.main_view.close_osk() |
317 | |
318 | @@ -242,23 +155,9 @@ |
319 | |
320 | def test_header_delete_message(self): |
321 | """Verify we can use the toolbar to delete a message""" |
322 | - self.main_view.start_new_message() |
323 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
324 | - |
325 | - # type address number |
326 | phone_num = '555-555-4321' |
327 | - self.main_view.type_contact_phone_num(phone_num) |
328 | - # type message |
329 | message = 'delete me' |
330 | - self.main_view.type_message(message) |
331 | - |
332 | - # send |
333 | - self.main_view.click_send_button() |
334 | - |
335 | - # verify that we get a bubble with our message |
336 | - list_view = self.main_view.get_multiple_selection_list_view() |
337 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
338 | - bubble = self.main_view.get_message(message) |
339 | + bubble = self.main_view.send_message(phone_num, message) |
340 | |
341 | self.main_view.close_osk() |
342 | |
343 | @@ -271,23 +170,9 @@ |
344 | |
345 | def test_delete_message_without_selecting_a_message(self): |
346 | """Verify we only delete messages that have been selected""" |
347 | - self.main_view.start_new_message() |
348 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
349 | - |
350 | - # type address number |
351 | phone_num = '555-555-4321' |
352 | - self.main_view.type_contact_phone_num(phone_num) |
353 | - # type message |
354 | - message = 'dont delete me' |
355 | - self.main_view.type_message(message) |
356 | - |
357 | - # send |
358 | - self.main_view.click_send_button() |
359 | - |
360 | - # verify that we get a bubble with our message |
361 | - list_view = self.main_view.get_multiple_selection_list_view() |
362 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
363 | - self.main_view.get_message(message) |
364 | + message = 'delete me' |
365 | + self.main_view.send_message(phone_num, message) |
366 | |
367 | self.main_view.close_osk() |
368 | |
369 | @@ -299,6 +184,7 @@ |
370 | |
371 | # verify messsage is not gone |
372 | time.sleep(5) # wait 5 seconds, the emulator is slow |
373 | + list_view = self.main_view.get_multiple_selection_list_view() |
374 | list_view.select_single("Label", text=message) |
375 | |
376 | def test_receive_text_with_letters_in_phone_number(self): |
377 | @@ -324,26 +210,9 @@ |
378 | |
379 | def test_cancel_delete_thread_from_main_view(self): |
380 | """Verify we can cancel deleting a message thread""" |
381 | - self.main_view.start_new_message() |
382 | - # verify the thread list page is not visible |
383 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
384 | - |
385 | - # type contact/number |
386 | - phone_num = 123 |
387 | - self.main_view.type_contact_phone_num(phone_num) |
388 | - |
389 | - # type message |
390 | + phone_num = '123' |
391 | message = 'hello from Ubuntu' |
392 | - self.main_view.type_message(message) |
393 | - |
394 | - # send |
395 | - self.main_view.click_send_button() |
396 | - |
397 | - # verify that we get a bubble with our message |
398 | - list_view = self.main_view.get_multiple_selection_list_view() |
399 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
400 | - # verify label text |
401 | - self.main_view.get_message('hello from Ubuntu') |
402 | + self.main_view.send_message(phone_num, message) |
403 | |
404 | # switch back to main page with thread list |
405 | self.main_view.close_osk() |
406 | @@ -357,41 +226,24 @@ |
407 | self.assertThat(self.thread_list.count, Equals(1)) |
408 | # verify our number |
409 | thread = self.main_view.get_thread_from_number(phone_num) |
410 | - self.assertThat(thread.phoneNumber, Equals('123')) |
411 | + self.assertThat(thread.phoneNumber, Equals(phone_num)) |
412 | # verify our text |
413 | - thread.select_single('Label', text='hello from Ubuntu') |
414 | + thread.select_single('Label', text=message) |
415 | # use select button in toolbar |
416 | self.main_view.enable_threads_selection_mode() |
417 | # click cancel button |
418 | self.main_view.click_threads_header_cancel() |
419 | # verify our number was not deleted |
420 | thread = self.main_view.get_thread_from_number(phone_num) |
421 | - self.assertThat(thread.phoneNumber, Equals('123')) |
422 | + self.assertThat(thread.phoneNumber, Equals(phone_num)) |
423 | # verify our text was not deleted |
424 | - thread.select_single('Label', text='hello from Ubuntu') |
425 | + thread.select_single('Label', text=message) |
426 | |
427 | def test_delete_thread_from_main_view(self): |
428 | """Verify we can delete a message thread""" |
429 | - self.main_view.start_new_message() |
430 | - # verify the thread list page is not visible |
431 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
432 | - |
433 | - # type contact/number |
434 | - phone_num = 123 |
435 | - self.main_view.type_contact_phone_num(phone_num) |
436 | - |
437 | - # type message |
438 | + phone_num = '123' |
439 | message = 'hello from Ubuntu' |
440 | - self.main_view.type_message(message) |
441 | - |
442 | - # send |
443 | - self.main_view.click_send_button() |
444 | - |
445 | - # verify that we get a bubble with our message |
446 | - list_view = self.main_view.get_multiple_selection_list_view() |
447 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
448 | - # verify label text |
449 | - self.main_view.get_message('hello from Ubuntu') |
450 | + self.main_view.send_message(phone_num, message) |
451 | |
452 | # switch back to main page with thread list |
453 | self.main_view.close_osk() |
454 | @@ -406,7 +258,7 @@ |
455 | # verify our number |
456 | mess_thread = self.main_view.get_thread_from_number(phone_num) |
457 | # verify our text |
458 | - self.thread_list.select_single('Label', text='hello from Ubuntu') |
459 | + self.thread_list.select_single('Label', text=message) |
460 | # use select button in toolbar |
461 | self.main_view.enable_threads_selection_mode() |
462 | # click thread we want to delete |
463 | @@ -430,26 +282,13 @@ |
464 | |
465 | def test_delete_message_swipe_right(self): |
466 | """Verify we can delete a message by swiping right""" |
467 | - self.main_view.start_new_message() |
468 | - self.assertThat(self.thread_list.visible, Eventually(Equals(False))) |
469 | - |
470 | - # type address number |
471 | phone_num = '555-555-4321' |
472 | - self.main_view.type_contact_phone_num(phone_num) |
473 | - # type message |
474 | message = 'delete me okay' |
475 | - self.main_view.type_message(message) |
476 | - |
477 | - # send |
478 | - self.main_view.click_send_button() |
479 | - |
480 | - # verify that we get a bubble with our message |
481 | - list_view = self.main_view.get_multiple_selection_list_view() |
482 | - self.assertThat(list_view.count, Eventually(Equals(1))) |
483 | - self.main_view.get_message(message) |
484 | + self.main_view.send_message(phone_num, message) |
485 | |
486 | # delete message |
487 | self.main_view.delete_message(message) |
488 | + list_view = self.main_view.get_multiple_selection_list_view() |
489 | self.assertThat(list_view.count, Eventually(Equals(0))) |
490 | |
491 |
FAILED: Continuous integration, rev:125 jenkins. qa.ubuntu. com/job/ messaging- app-ci/ 254/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/1483/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 1277/console jenkins. qa.ubuntu. com/job/ messaging- app-utopic- amd64-ci/ 48/console jenkins. qa.ubuntu. com/job/ messaging- app-utopic- armhf-ci/ 48/console jenkins. qa.ubuntu. com/job/ messaging- app-utopic- i386-ci/ 48/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/2453/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/1425/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/messaging- app-ci/ 254/rebuild
http://