Merge lp:~elopio/ubuntuone-testing/open-photos-tab into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 118
Merged at revision: 107
Proposed branch: lp:~elopio/ubuntuone-testing/open-photos-tab
Merge into: lp:ubuntuone-testing
Prerequisite: lp:~elopio/ubuntuone-testing/smoke-test
Diff against target: 98 lines (+42/-12)
3 files modified
ubuntuone/web/tests/sst/photos/u1webp12_openphotostab.py (+23/-0)
ubuntuone/web/tests/sst/shared/actions/photos.py (+18/-11)
ubuntuone/web/tests/sst/shared/actions/setup.py (+1/-1)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/open-photos-tab
Reviewer Review Type Date Requested Status
Philip Fibiger (community) Approve
Review via email: mp+115014@code.launchpad.net

Commit message

Added the test open photos tab.

Description of the change

Added the test open photos tab.

To post a comment you must log in.
Revision history for this message
Philip Fibiger (pfibiger) :
review: Approve
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=== added file 'ubuntuone/web/tests/sst/photos/u1webp12_openphotostab.py'
2--- ubuntuone/web/tests/sst/photos/u1webp12_openphotostab.py 1970-01-01 00:00:00 +0000
3+++ ubuntuone/web/tests/sst/photos/u1webp12_openphotostab.py 2012-07-15 05:33:18 +0000
4@@ -0,0 +1,23 @@
5+# -*- coding: utf-8 -*-
6+
7+# Copyright 2012 Canonical Ltd.
8+#
9+# This program is free software: you can redistribute it and/or modify it
10+# under the terms of the GNU General Public License version 3, as published
11+# by the Free Software Foundation.
12+#
13+# This program is distributed in the hope that it will be useful, but
14+# WITHOUT ANY WARRANTY; without even the implied warranties of
15+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
16+# PURPOSE. See the GNU General Public License for more details.
17+#
18+# You should have received a copy of the GNU General Public License along
19+# with this program. If not, see <http://www.gnu.org/licenses/>.
20+
21+from sst.actions import *
22+import actions.setup as setup_actions
23+import actions.photos as photos_actions
24+
25+setup_actions.setup(new_user=False)
26+photos_actions.click_photos_tab()
27+photos_actions.assert_page_title()
28
29=== modified file 'ubuntuone/web/tests/sst/shared/actions/photos.py'
30--- ubuntuone/web/tests/sst/shared/actions/photos.py 2012-06-19 20:48:33 +0000
31+++ ubuntuone/web/tests/sst/shared/actions/photos.py 2012-07-15 05:33:18 +0000
32@@ -26,12 +26,28 @@
33
34
35 def open():
36- """ Open the photos page and assert it's title. """
37- click_link(_get_photos_link())
38+ click_photos_tab()
39 switch_to_window()
40 assert_page_title()
41
42
43+def click_photos_tab():
44+ click_link(_get_photos_tab_link())
45+
46+
47+def _get_photos_tab_link():
48+ return get_element_by_css('#main-nav .photos')
49+
50+
51+def assert_page_title():
52+ assert_title(u'Ubuntu One : Photos')
53+
54+
55+def _assert_page_heading1(folder_name):
56+ heading1_element = get_element(tag='h1')
57+ assert_text(heading1_element, folder_name)
58+
59+
60 def _get_md5(filename):
61 """ get md5 checksum of file 'filename'. """
62 m = hashlib.md5()
63@@ -41,10 +57,6 @@
64 return m.digest()
65
66
67-def _get_photos_link():
68- return get_element_by_css('#main-nav .photos')
69-
70-
71 def _get_photo_folder(folder_name):
72 return get_element(title="~/Ubuntu One/%(name)s" %
73 {'name': folder_name})
74@@ -117,11 +129,6 @@
75 return folders
76
77
78-def assert_page_title():
79- """Assert that the title of the page is the expected."""
80- assert_title(u'Ubuntu One : Photos')
81-
82-
83 def assert_photo_is_displayed_on_gallery(photo_name):
84 """ Assert that the photo appears in the gallery. """
85 _get_photo_in_gallery(photo_name)
86
87=== modified file 'ubuntuone/web/tests/sst/shared/actions/setup.py'
88--- ubuntuone/web/tests/sst/shared/actions/setup.py 2012-07-15 05:33:18 +0000
89+++ ubuntuone/web/tests/sst/shared/actions/setup.py 2012-07-15 05:33:18 +0000
90@@ -78,7 +78,7 @@
91
92 def _get_user_and_login_or_sign_up(new_user, user):
93 if user is None:
94- user = _get_user_from_configuration(new_user)
95+ user = _get_user(new_user)
96 _login_or_sign_up(new_user, user)
97 dashboard_actions.wait_for_page_to_load()
98 header_actions.assert_login(user.full_name)

Subscribers

People subscribed via source and target branches