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

Proposed by Leo Arias
Status: Merged
Approved by: Rick McBride
Approved revision: 61
Merged at revision: 54
Proposed branch: lp:~elopio/ubuntuone-testing/missingsmokes
Merge into: lp:ubuntuone-testing
Diff against target: 420 lines (+290/-16)
13 files modified
ubuntuone/web/tests/sst/README.txt (+3/-2)
ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py (+31/-0)
ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py (+34/-0)
ubuntuone/web/tests/sst/session/u1webs002_login.py (+31/-0)
ubuntuone/web/tests/sst/session/u1webs003_logout.py (+31/-0)
ubuntuone/web/tests/sst/shared/actions/account.py (+51/-0)
ubuntuone/web/tests/sst/shared/actions/contacts.py (+4/-1)
ubuntuone/web/tests/sst/shared/actions/dashboard.py (+35/-0)
ubuntuone/web/tests/sst/shared/actions/files.py (+4/-1)
ubuntuone/web/tests/sst/shared/actions/header.py (+49/-0)
ubuntuone/web/tests/sst/shared/actions/setup.py (+8/-11)
ubuntuone/web/tests/sst/shared/actions/sso.py (+8/-0)
ubuntuone/web/tests/sst/smoketest/contactspage.py (+1/-1)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/missingsmokes
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+82289@code.launchpad.net

Commit message

Added the parameter full_name as a requisite for running the tests.
Added the test u1webs002 Log in.
Added the test u1webs 003 Log out.
Added the test u1webn 001 Main Tabs navigation.
Added the test u1weba001 account details.
Moved the services smoke test to the smoke folder.

Description of the change

Added the missing smoke tests and did a little refactoring on the way.

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

Nicely done.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/web/tests/sst/README.txt'
2--- ubuntuone/web/tests/sst/README.txt 2011-10-19 19:02:08 +0000
3+++ ubuntuone/web/tests/sst/README.txt 2011-11-15 15:29:27 +0000
4@@ -1,8 +1,9 @@
5-The tests involving login require a username (email) and
6+The tests involving login require the user's full name, email and
7 password to login to SSO. Create a file ``_passwords.py`` in the ``shared``
8 directory, with the following contents::
9
10- username = 'my.username@canonical.com'
11+ full_name = My Full Name
12+ email = 'my.username@canonical.com'
13 password = 'mypassword'
14
15 (``_passwords.py`` is ignored by bazaar so you can't accidentally check it
16
17=== added directory 'ubuntuone/web/tests/sst/account'
18=== added file 'ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py'
19--- ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py 1970-01-01 00:00:00 +0000
20+++ ubuntuone/web/tests/sst/account/u1weba001_accountdetails.py 2011-11-15 15:29:27 +0000
21@@ -0,0 +1,31 @@
22+# -*- coding: utf-8 -*-
23+
24+# Copyright 2011 Canonical Ltd.
25+#
26+# This program is free software: you can redistribute it and/or modify it
27+# under the terms of the GNU General Public License version 3, as published
28+# by the Free Software Foundation.
29+#
30+# This program is distributed in the hope that it will be useful, but
31+# WITHOUT ANY WARRANTY; without even the implied warranties of
32+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
33+# PURPOSE. See the GNU General Public License for more details.
34+#
35+# You should have received a copy of the GNU General Public License along
36+# with this program. If not, see <http://www.gnu.org/licenses/>.
37+
38+"""Test case u1weba-001 Account details.
39+Verify the account information.
40+
41+"""
42+
43+from sst.actions import *
44+import actions.setup as setup_actions
45+import actions.account as account_actions
46+from _passwords import full_name, email
47+
48+setup_actions.setup()
49+account_actions.open()
50+account_actions.assert_account_details(full_name, email)
51+account_actions.click_edit_account_details()
52+url_is('https://login.ubuntu.com/')
53
54=== added directory 'ubuntuone/web/tests/sst/navigation'
55=== added file 'ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py'
56--- ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 1970-01-01 00:00:00 +0000
57+++ ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 2011-11-15 15:29:27 +0000
58@@ -0,0 +1,34 @@
59+# -*- coding: utf-8 -*-
60+
61+# Copyright 2011 Canonical Ltd.
62+#
63+# This program is free software: you can redistribute it and/or modify it
64+# under the terms of the GNU General Public License version 3, as published
65+# by the Free Software Foundation.
66+#
67+# This program is distributed in the hope that it will be useful, but
68+# WITHOUT ANY WARRANTY; without even the implied warranties of
69+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
70+# PURPOSE. See the GNU General Public License for more details.
71+#
72+# You should have received a copy of the GNU General Public License along
73+# with this program. If not, see <http://www.gnu.org/licenses/>.
74+
75+"""Test case u1webn-001 Main tabs.
76+Navigate the main tabs of the website.
77+
78+"""
79+
80+from sst.actions import *
81+import actions.setup as setup_actions
82+import actions.dashboard as dashboard_actions
83+import actions.files as files_actions
84+import actions.contacts as contacts_actions
85+
86+setup_actions.setup()
87+dashboard_actions.assert_title()
88+files_actions.open()
89+# TODO waiting for Rick's branch.
90+#notes_actions.open()
91+contacts_actions.open()
92+dashboard_actions.open()
93
94=== added directory 'ubuntuone/web/tests/sst/session'
95=== added file 'ubuntuone/web/tests/sst/session/u1webs002_login.py'
96--- ubuntuone/web/tests/sst/session/u1webs002_login.py 1970-01-01 00:00:00 +0000
97+++ ubuntuone/web/tests/sst/session/u1webs002_login.py 2011-11-15 15:29:27 +0000
98@@ -0,0 +1,31 @@
99+# -*- coding: utf-8 -*-
100+
101+# Copyright 2011 Canonical Ltd.
102+#
103+# This program is free software: you can redistribute it and/or modify it
104+# under the terms of the GNU General Public License version 3, as published
105+# by the Free Software Foundation.
106+#
107+# This program is distributed in the hope that it will be useful, but
108+# WITHOUT ANY WARRANTY; without even the implied warranties of
109+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
110+# PURPOSE. See the GNU General Public License for more details.
111+#
112+# You should have received a copy of the GNU General Public License along
113+# with this program. If not, see <http://www.gnu.org/licenses/>.
114+
115+"""Test case u1webs-002 Log in.
116+Log in to the website with an existing account.
117+
118+"""
119+
120+from sst.actions import *
121+import actions.setup as setup_actions
122+import actions.dashboard as dashboard_actions
123+import actions.header as header_actions
124+from _passwords import full_name
125+
126+setup_actions.setup(new_user=False)
127+dashboard_actions.assert_title()
128+header_actions.assert_login(full_name)
129+dashboard_actions.assert_welcome_message(full_name)
130
131=== added file 'ubuntuone/web/tests/sst/session/u1webs003_logout.py'
132--- ubuntuone/web/tests/sst/session/u1webs003_logout.py 1970-01-01 00:00:00 +0000
133+++ ubuntuone/web/tests/sst/session/u1webs003_logout.py 2011-11-15 15:29:27 +0000
134@@ -0,0 +1,31 @@
135+# -*- coding: utf-8 -*-
136+
137+# Copyright 2011 Canonical Ltd.
138+#
139+# This program is free software: you can redistribute it and/or modify it
140+# under the terms of the GNU General Public License version 3, as published
141+# by the Free Software Foundation.
142+#
143+# This program is distributed in the hope that it will be useful, but
144+# WITHOUT ANY WARRANTY; without even the implied warranties of
145+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
146+# PURPOSE. See the GNU General Public License for more details.
147+#
148+# You should have received a copy of the GNU General Public License along
149+# with this program. If not, see <http://www.gnu.org/licenses/>.
150+
151+"""Test case u1webs-003 Log out.
152+Log out from the website.
153+
154+"""
155+
156+from sst.actions import *
157+import actions.setup as setup_actions
158+import actions.header as header_actions
159+import actions.sso as sso_actions
160+
161+setup_actions.setup()
162+header_actions.logout()
163+sso_actions.assert_logout()
164+sso_actions.return_to_site()
165+header_actions.assert_logout()
166
167=== added file 'ubuntuone/web/tests/sst/shared/actions/account.py'
168--- ubuntuone/web/tests/sst/shared/actions/account.py 1970-01-01 00:00:00 +0000
169+++ ubuntuone/web/tests/sst/shared/actions/account.py 2011-11-15 15:29:27 +0000
170@@ -0,0 +1,51 @@
171+# -*- coding: utf-8 -*-
172+
173+# Copyright 2011 Canonical Ltd.
174+#
175+# This program is free software: you can redistribute it and/or modify it
176+# under the terms of the GNU General Public License version 3, as published
177+# by the Free Software Foundation.
178+#
179+# This program is distributed in the hope that it will be useful, but
180+# WITHOUT ANY WARRANTY; without even the implied warranties of
181+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
182+# PURPOSE. See the GNU General Public License for more details.
183+#
184+# You should have received a copy of the GNU General Public License along
185+# with this program. If not, see <http://www.gnu.org/licenses/>.
186+
187+"""Actions for the Account page of the Ubuntu One website."""
188+
189+from sst.actions import *
190+import actions.header as header_actions
191+
192+def open():
193+ header_actions.open_my_account()
194+ assert_title(), 'My account should be opened'
195+
196+def assert_title():
197+ title_is(u'Ubuntu One : Your Account')
198+
199+def assert_account_details(full_name, email):
200+ _assert_name(full_name)
201+ _assert_email(email)
202+ _assert_password('********')
203+
204+def _assert_name(full_name):
205+ name_element = _get_user_details_data_elements()[0]
206+ text_is(name_element, full_name)
207+
208+def _assert_email(email):
209+ email_element = _get_user_details_data_elements()[1]
210+ text_is(email_element, email)
211+
212+def _assert_password(password):
213+ password_element = _get_user_details_data_elements()[2]
214+ text_is(password_element, password)
215+
216+def _get_user_details_data_elements():
217+ return get_elements_by_css('.user-details dd')
218+
219+def click_edit_account_details():
220+ link_click(get_element(text='Edit your account details in Ubuntu Single '
221+ 'Sign On'))
222
223=== modified file 'ubuntuone/web/tests/sst/shared/actions/contacts.py'
224--- ubuntuone/web/tests/sst/shared/actions/contacts.py 2011-10-19 06:52:00 +0000
225+++ ubuntuone/web/tests/sst/shared/actions/contacts.py 2011-11-15 15:29:27 +0000
226@@ -22,9 +22,12 @@
227
228 def open():
229 """Open the Contacts page and assert it's title."""
230- goto('/contacts/')
231+ link_click(_get_contacts_link())
232 assert_title()
233
234+def _get_contacts_link():
235+ return get_element_by_css('#main-nav .contacts')
236+
237 def assert_title():
238 """Assert that the title of the page is the expected."""
239 title_is(u'Ubuntu One : Contacts')
240
241=== added file 'ubuntuone/web/tests/sst/shared/actions/dashboard.py'
242--- ubuntuone/web/tests/sst/shared/actions/dashboard.py 1970-01-01 00:00:00 +0000
243+++ ubuntuone/web/tests/sst/shared/actions/dashboard.py 2011-11-15 15:29:27 +0000
244@@ -0,0 +1,35 @@
245+# -*- coding: utf-8 -*-
246+
247+# Copyright 2011 Canonical Ltd.
248+#
249+# This program is free software: you can redistribute it and/or modify it
250+# under the terms of the GNU General Public License version 3, as published
251+# by the Free Software Foundation.
252+#
253+# This program is distributed in the hope that it will be useful, but
254+# WITHOUT ANY WARRANTY; without even the implied warranties of
255+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
256+# PURPOSE. See the GNU General Public License for more details.
257+#
258+# You should have received a copy of the GNU General Public License along
259+# with this program. If not, see <http://www.gnu.org/licenses/>.
260+
261+"""Actions for the Dashboard page of the Ubuntu One website."""
262+
263+from sst.actions import *
264+
265+def open():
266+ link_click(_get_dashboard_link())
267+ assert_title(), 'Dashboard should be opened'
268+
269+def _get_dashboard_link():
270+ return get_element_by_css('#main-nav .dashboard')
271+
272+def assert_title():
273+ title_is(u'Ubuntu One : Dashboard')
274+
275+def assert_welcome_message(user_full_name):
276+ text_is(_get_welcome_element(), 'Hi %s! Welcome Back' % user_full_name)
277+
278+def _get_welcome_element():
279+ return get_element_by_css('header > hgroup > h1')
280
281=== modified file 'ubuntuone/web/tests/sst/shared/actions/files.py'
282--- ubuntuone/web/tests/sst/shared/actions/files.py 2011-11-07 17:14:03 +0000
283+++ ubuntuone/web/tests/sst/shared/actions/files.py 2011-11-15 15:29:27 +0000
284@@ -26,9 +26,12 @@
285
286 def open():
287 """Open the files page and assert it's title."""
288- goto('/files/')
289+ link_click(_get_files_link())
290 assert_title()
291
292+def _get_files_link():
293+ return get_element_by_css('#main-nav .files')
294+
295 def assert_title():
296 """Assert that the title of the page is the expected."""
297 title_is(u'Ubuntu One : My Storage')
298
299=== added file 'ubuntuone/web/tests/sst/shared/actions/header.py'
300--- ubuntuone/web/tests/sst/shared/actions/header.py 1970-01-01 00:00:00 +0000
301+++ ubuntuone/web/tests/sst/shared/actions/header.py 2011-11-15 15:29:27 +0000
302@@ -0,0 +1,49 @@
303+# -*- coding: utf-8 -*-
304+
305+# Copyright 2011 Canonical Ltd.
306+#
307+# This program is free software: you can redistribute it and/or modify it
308+# under the terms of the GNU General Public License version 3, as published
309+# by the Free Software Foundation.
310+#
311+# This program is distributed in the hope that it will be useful, but
312+# WITHOUT ANY WARRANTY; without even the implied warranties of
313+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
314+# PURPOSE. See the GNU General Public License for more details.
315+#
316+# You should have received a copy of the GNU General Public License along
317+# with this program. If not, see <http://www.gnu.org/licenses/>.
318+
319+"""Actions for the Header of the Ubuntu One website."""
320+
321+from sst.actions import *
322+
323+def click_login_or_sign_up():
324+ link_click(_get_login_or_sign_up_link())
325+
326+def _get_login_or_sign_up_link():
327+ return get_element(text='Log in or Sign up')
328+
329+def assert_login(full_name):
330+ _assert_full_name(full_name)
331+ _get_my_account_link()
332+ _get_logout_link()
333+
334+def _assert_full_name(full_name):
335+ welcome_element = get_element_by_css('#ac-status > span')
336+ text_is(welcome_element, 'Welcome %s' % full_name)
337+
338+def _get_my_account_link():
339+ return get_element(tag='a', css_class='account', text='My Account')
340+
341+def _get_logout_link():
342+ return get_element(tag='a', text='logout')
343+
344+def open_my_account():
345+ link_click(_get_my_account_link())
346+
347+def logout():
348+ link_click(_get_logout_link())
349+
350+def assert_logout():
351+ _get_login_or_sign_up_link()
352
353=== modified file 'ubuntuone/web/tests/sst/shared/actions/setup.py'
354--- ubuntuone/web/tests/sst/shared/actions/setup.py 2011-11-04 20:25:03 +0000
355+++ ubuntuone/web/tests/sst/shared/actions/setup.py 2011-11-15 15:29:27 +0000
356@@ -23,10 +23,11 @@
357 from sst.actions import *
358 from config import *
359 try:
360- from _passwords import username, password
361+ from _passwords import full_name, email, password
362 except:
363- skip('try adding a _passwords.py file to the shared folder if you ' \
364- 'expect this to work ;)')
365+ skip('Try adding a _passwords.py file to the shared folder if you ' \
366+ 'expect this to work. Read the README.txt file ;)')
367+import actions.header as header_actions
368 import actions.sso as sso_actions
369
370
371@@ -43,14 +44,10 @@
372 set_base_url(base_url)
373 set_wait_timeout(DEFAULT_TIMEOUT)
374 goto()
375- wait_for_title_to_change('Ubuntu One : Home')
376- link_click(get_element(text='Log in or Sign up'))
377+ waitfor(title_is, 'Ubuntu One : Home')
378+ header_actions.click_login_or_sign_up()
379 if new_user:
380 skip('New user creation is not yet implemented.')
381 else:
382- sso_actions.login(username, password)
383- wait_for_title_to_change(u'Ubuntu One : Dashboard')
384-
385-
386-def wait_for_title_to_change(title):
387- waitfor(title_is, title)
388+ sso_actions.login(email, password)
389+ header_actions.assert_login(full_name)
390
391=== modified file 'ubuntuone/web/tests/sst/shared/actions/sso.py'
392--- ubuntuone/web/tests/sst/shared/actions/sso.py 2011-11-04 20:25:03 +0000
393+++ ubuntuone/web/tests/sst/shared/actions/sso.py 2011-11-15 15:29:27 +0000
394@@ -41,3 +41,11 @@
395 waitfor(title_is, 'Authenticate to %s' % base_url)
396 waitfor(get_element, tag='body')
397 button_click(get_element(css_class='btn', name='yes'))
398+
399+def assert_logout():
400+ title_is('You have been logged out')
401+ text_is(get_element(tag='h1', css_class='main'),
402+ 'You have been logged out')
403+
404+def return_to_site():
405+ link_click(get_element_by_css('.returnto a'))
406
407=== modified file 'ubuntuone/web/tests/sst/smoketest/contactspage.py'
408--- ubuntuone/web/tests/sst/smoketest/contactspage.py 2011-09-28 19:32:05 +0000
409+++ ubuntuone/web/tests/sst/smoketest/contactspage.py 2011-11-15 15:29:27 +0000
410@@ -23,7 +23,7 @@
411
412 setup_actions.setup(new_user=False)
413 goto('/contacts/')
414-setup_actions.wait_for_title_to_change('Ubuntu One : Contacts')
415+waitfor(title_is, 'Ubuntu One : Contacts')
416 get_element(css_class='add-button', text='Add contact')
417 # possibly add tests for Desktop, Facebook and Ubuntu One Mobile here or
418 # in seperate tests
419
420=== renamed file 'ubuntuone/web/tests/sst/services/u1webs-002.py' => 'ubuntuone/web/tests/sst/smoketest/services.py'

Subscribers

People subscribed via source and target branches