Merge lp:~elopio/ubuntuone-testing/teardown into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Merged
Approved by: Rick McBride
Approved revision: 92
Merged at revision: 86
Proposed branch: lp:~elopio/ubuntuone-testing/teardown
Merge into: lp:ubuntuone-testing
Prerequisite: lp:~elopio/ubuntuone-testing/fix-payadditionalstorage
Diff against target: 951 lines (+148/-123)
34 files modified
.bzrignore (+1/-0)
ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py (+10/-2)
ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py (+4/-4)
ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py (+4/-4)
ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py (+4/-4)
ubuntuone/web/tests/sst/files/u1webf001_uploadfile.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf002_publishfile.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf003_stoppublishingfile.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf004_downloadfile.py (+8/-9)
ubuntuone/web/tests/sst/files/u1webf005_deletefile.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf006_createfolder.py (+3/-5)
ubuntuone/web/tests/sst/files/u1webf007_sharefolder.py (+3/-5)
ubuntuone/web/tests/sst/files/u1webf008_stopsharingfolder.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf009_deletefolder.py (+3/-4)
ubuntuone/web/tests/sst/files/u1webf010_foldernavigation.py (+3/-4)
ubuntuone/web/tests/sst/music/u1webm001_playsong.py (+3/-1)
ubuntuone/web/tests/sst/music/u1webm002_selectartist.py (+3/-1)
ubuntuone/web/tests/sst/music/u1webm003_selectalbum.py (+3/-1)
ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py (+3/-1)
ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py (+3/-5)
ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py (+2/-4)
ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse001_information.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse002_musicstreamingmonthly.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse003_musicstreamingannually.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py (+3/-5)
ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py (+3/-5)
ubuntuone/web/tests/sst/session/u1webs002_login.py (+3/-1)
ubuntuone/web/tests/sst/shared/actions/header.py (+3/-0)
ubuntuone/web/tests/sst/shared/actions/teardown.py (+37/-0)
ubuntuone/web/tests/sst/smoketest/contactspage.py (+3/-4)
ubuntuone/web/tests/sst/smoketest/filespage.py (+3/-4)
ubuntuone/web/tests/sst/smoketest/services.py (+3/-5)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/teardown
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+98774@code.launchpad.net

Commit message

Added tear down actions for tests.

Description of the change

Unlike firefox, Internet Explorer doesn't use a fresh profile for every test. Thus, it keeps the cache information and if a test leaves a user logged, the next one will start with an open session.
This branch adds tear down actions to clean after every test and leave the session just as when it started. It has a lot of duplication because SST doesn't handle set up and tear down for tests and suites, but this is good enough for us until bug #819427 is fixed. For the same reason, the tear down will not be executed if a test fails, and we will have a cascade of failures on IE. Even though, that's better than what we currently have.

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) wrote :

Cool. Yay IE for not acting like the rest of the kids.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-11-24 05:05:49 +0000
3+++ .bzrignore 2012-03-22 03:01:18 +0000
4@@ -9,6 +9,7 @@
5 passwords.py
6 reports/*
7 _passwords.py
8+_musicpasswords.py
9 _localconfig.py
10 sourcecode
11 results
12
13=== modified file 'ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py'
14--- ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py 2011-12-09 18:19:11 +0000
15+++ ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py 2012-03-22 03:01:18 +0000
16@@ -1,6 +1,6 @@
17 # -*- coding: utf-8 -*-
18
19-# Copyright 2011 Canonical Ltd.
20+# Copyright 2011-2012 Canonical Ltd.
21 #
22 # This program is free software: you can redistribute it and/or modify it
23 # under the terms of the GNU General Public License version 3, as published
24@@ -21,11 +21,19 @@
25
26 from sst.actions import *
27 import actions.setup as setup_actions
28+import actions.teardown as teardown_actions
29 import actions.account as account_actions
30 from _passwords import full_name, email
31+from config import ENVIRONMENT
32
33 setup_actions.setup()
34 account_actions.open()
35 account_actions.assert_account_details(full_name, email)
36 account_actions.click_edit_account_details()
37-assert_url('https://login.ubuntu.com/')
38+url = None
39+if ENVIRONMENT == 'staging':
40+ url = 'https://login.staging.ubuntu.com'
41+else:
42+ url = 'https://login.ubuntu.com/'
43+assert_url(url)
44+teardown_actions.tear_down()
45
46=== modified file 'ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py'
47--- ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py 2011-10-19 06:52:00 +0000
48+++ ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py 2012-03-22 03:01:18 +0000
49@@ -1,6 +1,6 @@
50 # -*- coding: utf-8 -*-
51
52-# Copyright 2011 Canonical Ltd.
53+# Copyright 2011-2012 Canonical Ltd.
54 #
55 # This program is free software: you can redistribute it and/or modify it
56 # under the terms of the GNU General Public License version 3, as published
57@@ -22,10 +22,9 @@
58 import uuid
59 from sst.actions import *
60 import actions.setup as setup_actions
61+import actions.teardown as teardown_actions
62 import actions.contacts as contacts_actions
63-from data.contact import Contact
64-from data.contact import Name
65-from data.contact import Email
66+from data.contact import Contact, Name, Email
67
68 setup_actions.setup()
69 contacts_actions.open()
70@@ -36,3 +35,4 @@
71 contact = Contact(name, (email,))
72 contacts_actions.add_contact(contact)
73 contacts_actions.assert_contact_information(contact)
74+teardown_actions.tear_down()
75
76=== modified file 'ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py'
77--- ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py 2011-10-19 06:52:00 +0000
78+++ ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py 2012-03-22 03:01:18 +0000
79@@ -1,6 +1,6 @@
80 # -*- coding: utf-8 -*-
81
82-# Copyright 2011 Canonical Ltd.
83+# Copyright 2011-2012 Canonical Ltd.
84 #
85 # This program is free software: you can redistribute it and/or modify it
86 # under the terms of the GNU General Public License version 3, as published
87@@ -22,10 +22,9 @@
88 import uuid
89 from sst.actions import *
90 import actions.setup as setup_actions
91+import actions.teardown as teardown_actions
92 import actions.contacts as contacts_actions
93-from data.contact import Contact
94-from data.contact import Name
95-from data.contact import Email
96+from data.contact import Contact, Name, Email
97
98 setup_actions.setup()
99 contacts_actions.open()
100@@ -44,3 +43,4 @@
101 # If it were, test will fail because two elements with the same id were found.
102 contacts_actions.edit_contact(edited_contact)
103 contacts_actions.assert_contact_information(edited_contact)
104+teardown_actions.tear_down()
105
106=== modified file 'ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py'
107--- ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py 2011-10-19 06:52:00 +0000
108+++ ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py 2012-03-22 03:01:18 +0000
109@@ -1,6 +1,6 @@
110 # -*- coding: utf-8 -*-
111
112-# Copyright 2011 Canonical Ltd.
113+# Copyright 2011-2012 Canonical Ltd.
114 #
115 # This program is free software: you can redistribute it and/or modify it
116 # under the terms of the GNU General Public License version 3, as published
117@@ -22,10 +22,9 @@
118 import uuid
119 from sst.actions import *
120 import actions.setup as setup_actions
121+import actions.teardown as teardown_actions
122 import actions.contacts as contacts_actions
123-from data.contact import Contact
124-from data.contact import Name
125-from data.contact import Email
126+from data.contact import Contact, Name, Email
127
128 setup_actions.setup()
129 contacts_actions.open()
130@@ -40,3 +39,4 @@
131 contacts_actions.assert_contact_exists(contact_identifier)
132 contacts_actions.delete_contact()
133 fails(contacts_actions.assert_contact_exists, contact_identifier)
134+teardown_actions.tear_down()
135
136=== modified file 'ubuntuone/web/tests/sst/files/u1webf001_uploadfile.py'
137--- ubuntuone/web/tests/sst/files/u1webf001_uploadfile.py 2012-02-01 23:50:20 +0000
138+++ ubuntuone/web/tests/sst/files/u1webf001_uploadfile.py 2012-03-22 03:01:18 +0000
139@@ -1,9 +1,6 @@
140 # -*- coding: utf-8 -*-
141
142-# Authors:
143-# Leo Arias <leo.arias@canonical.com>
144-#
145-# Copyright 2011 Canonical Ltd.
146+# Copyright 2011-2012 Canonical Ltd.
147 #
148 # This program is free software: you can redistribute it and/or modify it
149 # under the terms of the GNU General Public License version 3, as published
150@@ -24,6 +21,7 @@
151
152 from sst.actions import *
153 import actions.setup as setup_actions
154+import actions.teardown as teardown_actions
155 import actions.files as files_actions
156 from os import path, remove
157 import tempfile
158@@ -47,3 +45,4 @@
159 assert files_actions.get_file_size(file_name) == '54 bytes'
160 files_actions.assert_file_information_is_shown(file_name)
161 files_actions.assert_file_type(file_name, 'text/plain')
162+teardown_actions.tear_down()
163
164=== modified file 'ubuntuone/web/tests/sst/files/u1webf002_publishfile.py'
165--- ubuntuone/web/tests/sst/files/u1webf002_publishfile.py 2012-02-01 23:50:20 +0000
166+++ ubuntuone/web/tests/sst/files/u1webf002_publishfile.py 2012-03-22 03:01:18 +0000
167@@ -1,9 +1,6 @@
168 # -*- coding: utf-8 -*-
169
170-# Authors:
171-# Leo Arias <leo.arias@canonical.com>
172-#
173-# Copyright 2011 Canonical Ltd.
174+# Copyright 2011-2012 Canonical Ltd.
175 #
176 # This program is free software: you can redistribute it and/or modify it
177 # under the terms of the GNU General Public License version 3, as published
178@@ -24,6 +21,7 @@
179
180 from sst.actions import *
181 import actions.setup as setup_actions
182+import actions.teardown as teardown_actions
183 import actions.files as files_actions
184 from os import path, remove
185 import tempfile
186@@ -47,3 +45,4 @@
187 files_actions.assert_file_published(file_name)
188 file_url = files_actions.go_to_public_url(file_name)
189 assert_text(get_element(tag='body'), file_contents)
190+teardown_actions.tear_down()
191
192=== modified file 'ubuntuone/web/tests/sst/files/u1webf003_stoppublishingfile.py'
193--- ubuntuone/web/tests/sst/files/u1webf003_stoppublishingfile.py 2012-02-01 23:50:20 +0000
194+++ ubuntuone/web/tests/sst/files/u1webf003_stoppublishingfile.py 2012-03-22 03:01:18 +0000
195@@ -1,9 +1,6 @@
196 # -*- coding: utf-8 -*-
197
198-# Authors:
199-# Leo Arias <leo.arias@canonical.com>
200-#
201-# Copyright 2011 Canonical Ltd.
202+# Copyright 2011-2012 Canonical Ltd.
203 #
204 # This program is free software: you can redistribute it and/or modify it
205 # under the terms of the GNU General Public License version 3, as published
206@@ -24,6 +21,7 @@
207
208 from sst.actions import *
209 import actions.setup as setup_actions
210+import actions.teardown as teardown_actions
211 import actions.files as files_actions
212 from os import path, remove
213 import tempfile
214@@ -51,3 +49,4 @@
215 set_base_url(base_url)
216 go_to(path)
217 assert_text(get_element(tag='body'), 'Could not locate object')
218+teardown_actions.tear_down()
219
220=== modified file 'ubuntuone/web/tests/sst/files/u1webf004_downloadfile.py'
221--- ubuntuone/web/tests/sst/files/u1webf004_downloadfile.py 2012-02-01 23:50:20 +0000
222+++ ubuntuone/web/tests/sst/files/u1webf004_downloadfile.py 2012-03-22 03:01:18 +0000
223@@ -1,9 +1,6 @@
224 # -*- coding: utf-8 -*-
225
226-# Authors:
227-# Leo Arias <leo.arias@canonical.com>
228-#
229-# Copyright 2011 Canonical Ltd.
230+# Copyright 2011-2012 Canonical Ltd.
231 #
232 # This program is free software: you can redistribute it and/or modify it
233 # under the terms of the GNU General Public License version 3, as published
234@@ -24,12 +21,18 @@
235
236 from sst.actions import *
237 import actions.setup as setup_actions
238+import actions.teardown as teardown_actions
239 import actions.files as files_actions
240 from os import path, remove
241 import tempfile
242 import uuid
243 import urlparse
244
245+skip('Selenium has no way to download the file. The file has to be ' \
246+ 'downloaded with something like urllib, but then we required to do ' \
247+ 'the authentication again. An alternative would be to use a Firefox ' \
248+ 'profile with autosave to a predefined location, but SST has no easy ' \
249+ 'way to set a profile, and that will only work for Firefox')
250 setup_actions.setup()
251 files_actions.open()
252 file_uuid = str(uuid.uuid1())
253@@ -46,8 +49,4 @@
254 remove(upload.name)
255 file_url = files_actions.get_download_url(file_name)
256 # TODO verify the downloaded file.
257-skip('Selenium has no way to download the file. The file has to be ' \
258- 'downloaded with something like urllib, but then we required to do ' \
259- 'the authentication again. An alternative would be to use a Firefox ' \
260- 'profile with autosave to a predefined location, but SST has no easy ' \
261- 'way to set a profile, and that will only work for Firefox')
262+teardown_actions.tear_down()
263
264=== modified file 'ubuntuone/web/tests/sst/files/u1webf005_deletefile.py'
265--- ubuntuone/web/tests/sst/files/u1webf005_deletefile.py 2012-02-01 23:50:20 +0000
266+++ ubuntuone/web/tests/sst/files/u1webf005_deletefile.py 2012-03-22 03:01:18 +0000
267@@ -1,9 +1,6 @@
268 # -*- coding: utf-8 -*-
269
270-# Authors:
271-# Leo Arias <leo.arias@canonical.com>
272-#
273-# Copyright 2011 Canonical Ltd.
274+# Copyright 2011-2012 Canonical Ltd.
275 #
276 # This program is free software: you can redistribute it and/or modify it
277 # under the terms of the GNU General Public License version 3, as published
278@@ -24,6 +21,7 @@
279
280 from sst.actions import *
281 import actions.setup as setup_actions
282+import actions.teardown as teardown_actions
283 import actions.files as files_actions
284 import os.path
285 import tempfile
286@@ -45,3 +43,4 @@
287 files_actions.assert_file_exists(file_name)
288 files_actions.delete_file(file_name)
289 fails(files_actions.assert_file_exists, file_name)
290+teardown_actions.tear_down()
291
292=== modified file 'ubuntuone/web/tests/sst/files/u1webf006_createfolder.py'
293--- ubuntuone/web/tests/sst/files/u1webf006_createfolder.py 2012-02-01 23:45:02 +0000
294+++ ubuntuone/web/tests/sst/files/u1webf006_createfolder.py 2012-03-22 03:01:18 +0000
295@@ -1,9 +1,6 @@
296 # -*- coding: utf-8 -*-
297
298-# Authors:
299-# Leo Arias <leo.arias@canonical.com>
300-#
301-# Copyright 2011 Canonical Ltd.
302+# Copyright 2011-2012 Canonical Ltd.
303 #
304 # This program is free software: you can redistribute it and/or modify it
305 # under the terms of the GNU General Public License version 3, as published
306@@ -24,6 +21,7 @@
307
308 from sst.actions import *
309 import actions.setup as setup_actions
310+import actions.teardown as teardown_actions
311 import actions.files as files_actions
312 import uuid
313
314@@ -38,4 +36,4 @@
315 files_actions.assert_folder_information_is_shown(folder_name)
316 files_actions.open_folder(folder_name)
317 files_actions.assert_breadcrumb(folder_name)
318-# TODO should it show the gallery link?
319+teardown_actions.tear_down()
320
321=== modified file 'ubuntuone/web/tests/sst/files/u1webf007_sharefolder.py'
322--- ubuntuone/web/tests/sst/files/u1webf007_sharefolder.py 2012-02-02 00:14:57 +0000
323+++ ubuntuone/web/tests/sst/files/u1webf007_sharefolder.py 2012-03-22 03:01:18 +0000
324@@ -1,9 +1,6 @@
325 # -*- coding: utf-8 -*-
326
327-# Authors:
328-# Leo Arias <leo.arias@canonical.com>
329-#
330-# Copyright 2011 Canonical Ltd.
331+# Copyright 2011-2012 Canonical Ltd.
332 #
333 # This program is free software: you can redistribute it and/or modify it
334 # under the terms of the GNU General Public License version 3, as published
335@@ -24,6 +21,7 @@
336
337 from sst.actions import *
338 import actions.setup as setup_actions
339+import actions.teardown as teardown_actions
340 import actions.files as files_actions
341 import uuid
342 from datetime import datetime
343@@ -39,4 +37,4 @@
344 files_actions.assert_folder_information_is_shown(folder_name)
345 files_actions.assert_folder_shared(folder_name, email_address,
346 date=datetime.utcnow())
347-
348+teardown_actions.tear_down()
349
350=== modified file 'ubuntuone/web/tests/sst/files/u1webf008_stopsharingfolder.py'
351--- ubuntuone/web/tests/sst/files/u1webf008_stopsharingfolder.py 2012-02-02 00:14:57 +0000
352+++ ubuntuone/web/tests/sst/files/u1webf008_stopsharingfolder.py 2012-03-22 03:01:18 +0000
353@@ -1,9 +1,6 @@
354 # -*- coding: utf-8 -*-
355
356-# Authors:
357-# Leo Arias <leo.arias@canonical.com>
358-#
359-# Copyright 2011 Canonical Ltd.
360+# Copyright 2011-2012 Canonical Ltd.
361 #
362 # This program is free software: you can redistribute it and/or modify it
363 # under the terms of the GNU General Public License version 3, as published
364@@ -25,6 +22,7 @@
365
366 from sst.actions import *
367 import actions.setup as setup_actions
368+import actions.teardown as teardown_actions
369 import actions.files as files_actions
370 import uuid
371 from datetime import datetime
372@@ -40,3 +38,4 @@
373 today = datetime.utcnow()
374 files_actions.stop_sharing_folder(folder_name, email_address, today)
375 fails(files_actions.assert_folder_shared, folder_name, email_address, today)
376+teardown_actions.tear_down()
377
378=== modified file 'ubuntuone/web/tests/sst/files/u1webf009_deletefolder.py'
379--- ubuntuone/web/tests/sst/files/u1webf009_deletefolder.py 2012-02-02 00:14:57 +0000
380+++ ubuntuone/web/tests/sst/files/u1webf009_deletefolder.py 2012-03-22 03:01:18 +0000
381@@ -1,9 +1,6 @@
382 # -*- coding: utf-8 -*-
383
384-# Authors:
385-# Leo Arias <leo.arias@canonical.com>
386-#
387-# Copyright 2011 Canonical Ltd.
388+# Copyright 2011-2012 Canonical Ltd.
389 #
390 # This program is free software: you can redistribute it and/or modify it
391 # under the terms of the GNU General Public License version 3, as published
392@@ -24,6 +21,7 @@
393
394 from sst.actions import *
395 import actions.setup as setup_actions
396+import actions.teardown as teardown_actions
397 import actions.files as files_actions
398 import uuid
399
400@@ -35,3 +33,4 @@
401 files_actions.assert_file_exists(folder_name)
402 files_actions.delete_file(folder_name)
403 fails(files_actions.assert_file_exists, folder_name)
404+teardown_actions.tear_down()
405
406=== modified file 'ubuntuone/web/tests/sst/files/u1webf010_foldernavigation.py'
407--- ubuntuone/web/tests/sst/files/u1webf010_foldernavigation.py 2011-10-03 08:50:46 +0000
408+++ ubuntuone/web/tests/sst/files/u1webf010_foldernavigation.py 2012-03-22 03:01:18 +0000
409@@ -1,9 +1,6 @@
410 # -*- coding: utf-8 -*-
411
412-# Authors:
413-# Leo Arias <leo.arias@canonical.com>
414-#
415-# Copyright 2011 Canonical Ltd.
416+# Copyright 2011-2012 Canonical Ltd.
417 #
418 # This program is free software: you can redistribute it and/or modify it
419 # under the terms of the GNU General Public License version 3, as published
420@@ -25,6 +22,7 @@
421
422 from sst.actions import *
423 import actions.setup as setup_actions
424+import actions.teardown as teardown_actions
425 import actions.files as files_actions
426 from random import random
427 from datetime import date
428@@ -52,3 +50,4 @@
429 files_actions.assert_breadcrumb(parent_folder_name, sibling_folder_name)
430 files_actions.go_to_breadcrumb()
431 files_actions.assert_breadcrumb()
432+teardown_actions.tear_down()
433
434=== modified file 'ubuntuone/web/tests/sst/music/u1webm001_playsong.py'
435--- ubuntuone/web/tests/sst/music/u1webm001_playsong.py 2011-12-18 05:00:51 +0000
436+++ ubuntuone/web/tests/sst/music/u1webm001_playsong.py 2012-03-22 03:01:18 +0000
437@@ -1,6 +1,6 @@
438 # -*- coding: utf-8 -*-
439
440-# Copyright 2011 Canonical Ltd.
441+# Copyright 2011-2012 Canonical Ltd.
442 #
443 # This program is free software: you can redistribute it and/or modify it
444 # under the terms of the GNU General Public License version 3, as published
445@@ -21,6 +21,7 @@
446
447 from sst.actions import *
448 import actions.setup as setup_actions
449+import actions.teardown as teardown_actions
450 import actions.music as music_actions
451 from data.song import Song
452 from data.user import User
453@@ -39,3 +40,4 @@
454 music_actions.assert_current_song(song)
455 music_actions.assert_player_playing()
456 music_actions.assert_player_title(1, 1)
457+teardown_actions.tear_down()
458
459=== modified file 'ubuntuone/web/tests/sst/music/u1webm002_selectartist.py'
460--- ubuntuone/web/tests/sst/music/u1webm002_selectartist.py 2011-12-18 14:03:06 +0000
461+++ ubuntuone/web/tests/sst/music/u1webm002_selectartist.py 2012-03-22 03:01:18 +0000
462@@ -1,6 +1,6 @@
463 # -*- coding: utf-8 -*-
464
465-# Copyright 2011 Canonical Ltd.
466+# Copyright 2011-2012 Canonical Ltd.
467 #
468 # This program is free software: you can redistribute it and/or modify it
469 # under the terms of the GNU General Public License version 3, as published
470@@ -21,6 +21,7 @@
471
472 from sst.actions import *
473 import actions.setup as setup_actions
474+import actions.teardown as teardown_actions
475 import actions.music as music_actions
476 from data.song import Song
477 from data.user import User
478@@ -37,3 +38,4 @@
479 album = 'Free Film Music (cameronmusic.co.uk)'
480 music_actions.select_artist(artist)
481 music_actions.assert_artist_albums(artist, [album])
482+teardown_actions.tear_down()
483
484=== modified file 'ubuntuone/web/tests/sst/music/u1webm003_selectalbum.py'
485--- ubuntuone/web/tests/sst/music/u1webm003_selectalbum.py 2011-12-18 14:03:06 +0000
486+++ ubuntuone/web/tests/sst/music/u1webm003_selectalbum.py 2012-03-22 03:01:18 +0000
487@@ -1,6 +1,6 @@
488 # -*- coding: utf-8 -*-
489
490-# Copyright 2011 Canonical Ltd.
491+# Copyright 2011-2012 Canonical Ltd.
492 #
493 # This program is free software: you can redistribute it and/or modify it
494 # under the terms of the GNU General Public License version 3, as published
495@@ -21,6 +21,7 @@
496
497 from sst.actions import *
498 import actions.setup as setup_actions
499+import actions.teardown as teardown_actions
500 import actions.music as music_actions
501 from data.song import Song
502 from data.user import User
503@@ -36,3 +37,4 @@
504 song = Song('gentle marimba', 'Alastair Cameron', 'Free Film Music (cameronmusic.co.uk)')
505 music_actions.select_album(song.album)
506 music_actions.assert_album_songs(song.artist, song.album, [song.title])
507+teardown_actions.tear_down()
508
509=== modified file 'ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py'
510--- ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 2012-03-15 22:46:55 +0000
511+++ ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 2012-03-22 03:01:18 +0000
512@@ -1,6 +1,6 @@
513 # -*- coding: utf-8 -*-
514
515-# Copyright 2011 Canonical Ltd.
516+# Copyright 2011-2012 Canonical Ltd.
517 #
518 # This program is free software: you can redistribute it and/or modify it
519 # under the terms of the GNU General Public License version 3, as published
520@@ -21,6 +21,7 @@
521
522 from sst.actions import *
523 import actions.setup as setup_actions
524+import actions.teardown as teardown_actions
525 import actions.dashboard as dashboard_actions
526 import actions.files as files_actions
527 import actions.contacts as contacts_actions
528@@ -30,3 +31,4 @@
529 files_actions.open()
530 contacts_actions.open()
531 dashboard_actions.open()
532+teardown_actions.tear_down()
533
534=== modified file 'ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py'
535--- ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2011-12-09 18:18:25 +0000
536+++ ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2012-03-22 03:01:18 +0000
537@@ -1,10 +1,6 @@
538 # -*- coding: utf-8 -*-
539
540-# Authors:
541-# Rick McBride <rick.mcbride@canonical.com>
542-# Leo Arias <leo.arias@canonical.com>
543-#
544-# Copyright 2011 Canonical Ltd.
545+# Copyright 2011-2012 Canonical Ltd.
546 #
547 # This program is free software: you can redistribute it and/or modify it
548 # under the terms of the GNU General Public License version 3, as published
549@@ -24,6 +20,7 @@
550 from config import ENVIRONMENT
551 from datetime import date
552 import actions.setup as setup_actions
553+import actions.teardown as teardown_actions
554 import actions.services as services_actions
555 import actions.payment as payment_actions
556 import actions.payment_confirmed as payment_confirmed_actions
557@@ -44,3 +41,4 @@
558 get_element(tag='p', text='You are subscribed yearly')
559 get_element(tag='span', text='See my subscription')
560 get_element(tag='span', text='20GB with Music Streaming')
561+teardown_actions.tear_down()
562
563=== modified file 'ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py'
564--- ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2012-03-22 03:01:18 +0000
565+++ ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2012-03-22 03:01:18 +0000
566@@ -1,9 +1,5 @@
567 # -*- coding: utf-8 -*-
568
569-# Authors:
570-# Rick McBride <rick.mcbride@canonical.com>
571-# Leo Arias <leo.arias@canonical.com>
572-#
573 # Copyright 2011-2012 Canonical Ltd.
574 #
575 # This program is free software: you can redistribute it and/or modify it
576@@ -23,6 +19,7 @@
577 from sst.actions import *
578 from config import ENVIRONMENT
579 import actions.setup as setup_actions
580+import actions.teardown as teardown_actions
581 import actions.services as services_actions
582 import actions.payment as payment_actions
583 import actions.payment_confirmed as payment_confirmed_actions
584@@ -38,3 +35,4 @@
585 # TODO move this to the module account actions.
586 get_element(tag='span', text='5GB with Ubuntu One Free')
587 get_element(tag='span', text='20GB from storage add-on')
588+teardown_actions.tear_down()
589
590=== modified file 'ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py'
591--- ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2011-12-09 18:18:25 +0000
592+++ ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2012-03-22 03:01:18 +0000
593@@ -1,10 +1,6 @@
594 # -*- coding: utf-8 -*-
595
596-# Authors:
597-# Rick McBride <rick.mcbride@canonical.com>
598-# Leo Arias <leo.arias@canonical.com>
599-#
600-# Copyright 2011 Canonical Ltd.
601+# Copyright 2011-2012 Canonical Ltd.
602 #
603 # This program is free software: you can redistribute it and/or modify it
604 # under the terms of the GNU General Public License version 3, as published
605@@ -23,6 +19,7 @@
606 from sst.actions import *
607 from config import ENVIRONMENT
608 import actions.setup as setup_actions
609+import actions.teardown as teardown_actions
610 import actions.services as services_actions
611 import actions.payment as payment_actions
612 import actions.payment_confirmed as payment_confirmed_actions
613@@ -37,3 +34,4 @@
614 payment_actions.confirm_payment_details()
615 payment_confirmed_actions.assert_page_title()
616 payment_confirmed_actions.assert_failed_payment()
617+teardown_actions.tear_down()
618
619=== modified file 'ubuntuone/web/tests/sst/services/u1webse001_information.py'
620--- ubuntuone/web/tests/sst/services/u1webse001_information.py 2011-09-22 06:27:21 +0000
621+++ ubuntuone/web/tests/sst/services/u1webse001_information.py 2012-03-22 03:01:18 +0000
622@@ -1,10 +1,6 @@
623 # -*- coding: utf-8 -*-
624
625-# Authors:
626-# Rick McBride <rick.mcbride@canonical.com>
627-# Leo Arias <leo.arias@canonical.com>
628-#
629-# Copyright 2011 Canonical Ltd.
630+# Copyright 2011-2012 Canonical Ltd.
631 #
632 # This program is free software: you can redistribute it and/or modify it
633 # under the terms of the GNU General Public License version 3, as published
634@@ -22,8 +18,10 @@
635
636 from sst.actions import *
637 import actions.setup as setup_actions
638+import actions.teardown as teardown_actions
639 import actions.services as services_actions
640
641 setup_actions.setup()
642 services_actions.open()
643 services_actions.assert_services_information()
644+teardown_actions.tear_down()
645
646=== modified file 'ubuntuone/web/tests/sst/services/u1webse002_musicstreamingmonthly.py'
647--- ubuntuone/web/tests/sst/services/u1webse002_musicstreamingmonthly.py 2011-12-09 18:18:25 +0000
648+++ ubuntuone/web/tests/sst/services/u1webse002_musicstreamingmonthly.py 2012-03-22 03:01:18 +0000
649@@ -1,10 +1,6 @@
650 # -*- coding: utf-8 -*-
651
652-# Authors:
653-# Rick McBride <rick.mcbride@canonical.com>
654-# Leo Arias <leo.arias@canonical.com>
655-#
656-# Copyright 2011 Canonical Ltd.
657+# Copyright 2011-2012 Canonical Ltd.
658 #
659 # This program is free software: you can redistribute it and/or modify it
660 # under the terms of the GNU General Public License version 3, as published
661@@ -22,6 +18,7 @@
662
663 from sst.actions import *
664 import actions.setup as setup_actions
665+import actions.teardown as teardown_actions
666 import actions.services as services_actions
667 import actions.payment as payment_actions
668
669@@ -30,3 +27,4 @@
670 services_actions.buy_music_streaming_monthly()
671 payment_actions.assert_page_title()
672 payment_actions.assert_monthly_music_streaming_subscription()
673+teardown_actions.tear_down()
674
675=== modified file 'ubuntuone/web/tests/sst/services/u1webse003_musicstreamingannually.py'
676--- ubuntuone/web/tests/sst/services/u1webse003_musicstreamingannually.py 2011-12-09 18:18:25 +0000
677+++ ubuntuone/web/tests/sst/services/u1webse003_musicstreamingannually.py 2012-03-22 03:01:18 +0000
678@@ -1,10 +1,6 @@
679 # -*- coding: utf-8 -*-
680
681-# Authors:
682-# Rick McBride <rick.mcbride@canonical.com>
683-# Leo Arias <leo.arias@canonical.com>
684-#
685-# Copyright 2011 Canonical Ltd.
686+# Copyright 2011-2012 Canonical Ltd.
687 #
688 # This program is free software: you can redistribute it and/or modify it
689 # under the terms of the GNU General Public License version 3, as published
690@@ -22,6 +18,7 @@
691
692 from sst.actions import *
693 import actions.setup as setup_actions
694+import actions.teardown as teardown_actions
695 import actions.services as services_actions
696 import actions.payment as payment_actions
697
698@@ -30,3 +27,4 @@
699 services_actions.buy_music_streaming_yearly()
700 payment_actions.assert_page_title()
701 payment_actions.assert_annually_music_streaming_subscription()
702+teardown_actions.tear_down()
703
704=== modified file 'ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py'
705--- ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py 2011-12-09 18:19:11 +0000
706+++ ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py 2012-03-22 03:01:18 +0000
707@@ -1,10 +1,6 @@
708 # -*- coding: utf-8 -*-
709
710-# Authors:
711-# Rick McBride <rick.mcbride@canonical.com>
712-# Leo Arias <leo.arias@canonical.com>
713-#
714-# Copyright 2011 Canonical Ltd.
715+# Copyright 2012 Canonical Ltd.
716 #
717 # This program is free software: you can redistribute it and/or modify it
718 # under the terms of the GNU General Public License version 3, as published
719@@ -22,6 +18,7 @@
720
721 from sst.actions import *
722 import actions.setup as setup_actions
723+import actions.teardown as teardown_actions
724 import actions.services as services_actions
725
726 setup_actions.setup()
727@@ -41,3 +38,4 @@
728 click_element('storage-gb')
729 sleep(1)
730 services_actions.assert_storage(25)
731+teardown_actions.tear_down()
732
733=== modified file 'ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py'
734--- ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py 2011-12-09 18:18:25 +0000
735+++ ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py 2012-03-22 03:01:18 +0000
736@@ -1,10 +1,6 @@
737 # -*- coding: utf-8 -*-
738
739-# Authors:
740-# Rick McBride <rick.mcbride@canonical.com>
741-# Leo Arias <leo.arias@canonical.com>
742-#
743-# Copyright 2011 Canonical Ltd.
744+# Copyright 2011-2012 Canonical Ltd.
745 #
746 # This program is free software: you can redistribute it and/or modify it
747 # under the terms of the GNU General Public License version 3, as published
748@@ -22,6 +18,7 @@
749
750 from sst.actions import *
751 import actions.setup as setup_actions
752+import actions.teardown as teardown_actions
753 import actions.services as services_actions
754 import actions.payment as payment_actions
755
756@@ -31,3 +28,4 @@
757 services_actions.buy_extra_storage_monthly()
758 payment_actions.assert_page_title()
759 payment_actions.assert_monthly_extra_storage_subscription(5)
760+teardown_actions.tear_down()
761
762=== modified file 'ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py'
763--- ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py 2011-12-09 18:18:25 +0000
764+++ ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py 2012-03-22 03:01:18 +0000
765@@ -1,10 +1,6 @@
766 # -*- coding: utf-8 -*-
767
768-# Authors:
769-# Rick McBride <rick.mcbride@canonical.com>
770-# Leo Arias <leo.arias@canonical.com>
771-#
772-# Copyright 2011 Canonical Ltd.
773+# Copyright 2011-2012 Canonical Ltd.
774 #
775 # This program is free software: you can redistribute it and/or modify it
776 # under the terms of the GNU General Public License version 3, as published
777@@ -22,6 +18,7 @@
778
779 from sst.actions import *
780 import actions.setup as setup_actions
781+import actions.teardown as teardown_actions
782 import actions.services as services_actions
783 import actions.payment as payment_actions
784
785@@ -31,3 +28,4 @@
786 services_actions.buy_extra_storage_yearly()
787 payment_actions.assert_page_title()
788 payment_actions.assert_annually_extra_storage_subscription(5)
789+teardown_actions.tear_down()
790
791=== modified file 'ubuntuone/web/tests/sst/session/u1webs002_login.py'
792--- ubuntuone/web/tests/sst/session/u1webs002_login.py 2011-12-09 18:18:25 +0000
793+++ ubuntuone/web/tests/sst/session/u1webs002_login.py 2012-03-22 03:01:18 +0000
794@@ -1,6 +1,6 @@
795 # -*- coding: utf-8 -*-
796
797-# Copyright 2011 Canonical Ltd.
798+# Copyright 2011-2012 Canonical Ltd.
799 #
800 # This program is free software: you can redistribute it and/or modify it
801 # under the terms of the GNU General Public License version 3, as published
802@@ -21,6 +21,7 @@
803
804 from sst.actions import *
805 import actions.setup as setup_actions
806+import actions.teardown as teardown_actions
807 import actions.dashboard as dashboard_actions
808 import actions.header as header_actions
809 from _passwords import full_name
810@@ -29,3 +30,4 @@
811 dashboard_actions.assert_page_title()
812 header_actions.assert_login(full_name)
813 dashboard_actions.assert_welcome_message(full_name)
814+teardown_actions.tear_down()
815
816=== modified file 'ubuntuone/web/tests/sst/shared/actions/header.py'
817--- ubuntuone/web/tests/sst/shared/actions/header.py 2011-12-19 15:35:59 +0000
818+++ ubuntuone/web/tests/sst/shared/actions/header.py 2012-03-22 03:01:18 +0000
819@@ -24,6 +24,9 @@
820 def _get_login_or_sign_up_link():
821 return get_element(text='Log in or Sign up')
822
823+def is_logged_in():
824+ return exists_element(tag='a', text='logout')
825+
826 def assert_login(full_name):
827 _assert_full_name(full_name)
828 _get_my_account_link()
829
830=== added file 'ubuntuone/web/tests/sst/shared/actions/teardown.py'
831--- ubuntuone/web/tests/sst/shared/actions/teardown.py 1970-01-01 00:00:00 +0000
832+++ ubuntuone/web/tests/sst/shared/actions/teardown.py 2012-03-22 03:01:18 +0000
833@@ -0,0 +1,37 @@
834+# -*- coding: utf-8 -*-
835+
836+# Copyright 2012 Canonical Ltd.
837+#
838+# This program is free software: you can redistribute it and/or modify it
839+# under the terms of the GNU General Public License version 3, as published
840+# by the Free Software Foundation.
841+#
842+# This program is distributed in the hope that it will be useful, but
843+# WITHOUT ANY WARRANTY; without even the implied warranties of
844+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
845+# PURPOSE. See the GNU General Public License for more details.
846+#
847+# You should have received a copy of the GNU General Public License along
848+# with this program. If not, see <http://www.gnu.org/licenses/>.
849+
850+"""Tear down actions for Ubuntu One sst tests."""
851+
852+from sst.actions import *
853+from sst.actions import browser
854+
855+import actions.header as header_actions
856+import actions.sso as sso_actions
857+
858+def tear_down():
859+ go_to()
860+ if header_actions.is_logged_in():
861+ _prevent_unsaved_data_confirmation()
862+ header_actions.logout()
863+ sso_actions.assert_logout()
864+
865+def _prevent_unsaved_data_confirmation():
866+ """The browser might have unsaved data and ask for a confirmation before
867+ logging out. This will prevent that dialog to appear.
868+
869+ """
870+ browser.execute_script("window.onbeforeunload = function(e){};")
871
872=== modified file 'ubuntuone/web/tests/sst/smoketest/contactspage.py'
873--- ubuntuone/web/tests/sst/smoketest/contactspage.py 2011-12-09 18:19:11 +0000
874+++ ubuntuone/web/tests/sst/smoketest/contactspage.py 2012-03-22 03:01:18 +0000
875@@ -1,9 +1,6 @@
876 # -*- coding: utf-8 -*-
877
878-# Authors:
879-# Rick McBride <rick.mcbride@canonical.com>
880-#
881-# Copyright 2011 Canonical Ltd.
882+# Copyright 2011-2012 Canonical Ltd.
883 #
884 # This program is free software: you can redistribute it and/or modify it
885 # under the terms of the GNU General Public License version 3, as published
886@@ -20,6 +17,7 @@
887 '''Check existence of Contacts Page.'''
888 from sst.actions import *
889 import actions.setup as setup_actions
890+import actions.teardown as teardown_actions
891
892 setup_actions.setup(new_user=False)
893 go_to('/contacts/')
894@@ -27,3 +25,4 @@
895 get_element(css_class='add-button', text='Add contact')
896 # possibly add tests for Desktop, Facebook and Ubuntu One Mobile here or
897 # in seperate tests
898+teardown_actions.tear_down()
899
900=== modified file 'ubuntuone/web/tests/sst/smoketest/filespage.py'
901--- ubuntuone/web/tests/sst/smoketest/filespage.py 2011-12-09 18:19:11 +0000
902+++ ubuntuone/web/tests/sst/smoketest/filespage.py 2012-03-22 03:01:18 +0000
903@@ -1,9 +1,6 @@
904 # -*- coding: utf-8 -*-
905
906-# Authors:
907-# Rick McBride <rick.mcbride@canonical.com>
908-#
909-# Copyright 2011 Canonical Ltd.
910+# Copyright 2011-2012 Canonical Ltd.
911 #
912 # This program is free software: you can redistribute it and/or modify it
913 # under the terms of the GNU General Public License version 3, as published
914@@ -20,9 +17,11 @@
915 '''Check existence of Files Page.'''
916 from sst.actions import *
917 import actions.setup as setup_actions
918+import actions.teardown as teardown_actions
919
920 setup_actions.setup(new_user=False)
921 assert_title(u'Ubuntu One : Dashboard')
922 go_to('/files/')
923 assert_title(u'Ubuntu One : My Storage')
924 get_element(css_class='add-button', text='Share this folder')
925+teardown_actions.tear_down()
926
927=== modified file 'ubuntuone/web/tests/sst/smoketest/services.py'
928--- ubuntuone/web/tests/sst/smoketest/services.py 2011-12-09 18:19:11 +0000
929+++ ubuntuone/web/tests/sst/smoketest/services.py 2012-03-22 03:01:18 +0000
930@@ -1,10 +1,6 @@
931 # -*- coding: utf-8 -*-
932
933-# Authors:
934-# Rick McBride <rick.mcbride@canonical.com>
935-# Leo Arias <leo.arias@canonical.com>
936-#
937-# Copyright 2011 Canonical Ltd.
938+# Copyright 2011-2012 Canonical Ltd.
939 #
940 # This program is free software: you can redistribute it and/or modify it
941 # under the terms of the GNU General Public License version 3, as published
942@@ -19,7 +15,9 @@
943 # with this program. If not, see <http://www.gnu.org/licenses/>.
944 from sst.actions import *
945 import actions.setup as setup_actions
946+import actions.teardown as teardown_actions
947
948 setup_actions.setup(new_user=False)
949 go_to('/services/')
950 assert_title(u'Ubuntu One : Services')
951+teardown_actions.tear_down()

Subscribers

People subscribed via source and target branches