Merge lp:~elopio/ubuntuone-testing/fix-1017525 into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/ubuntuone-testing/fix-1017525
Merge into: lp:ubuntuone-testing
Diff against target: 236 lines (+63/-58)
7 files modified
ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py (+1/-0)
ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py (+1/-0)
ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py (+1/-0)
ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py (+2/-5)
ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py (+2/-7)
ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py (+2/-7)
ubuntuone/web/tests/sst/shared/actions/services.py (+54/-39)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/fix-1017525
Reviewer Review Type Date Requested Status
Rick McBride Pending
Review via email: mp+111863@code.launchpad.net

This proposal has been superseded by a proposal from 2012-06-25.

Commit message

Added the actions for the Add Storage page. Fixes lp:1017525

Description of the change

Added the actions for the Add Storage page. Fixes lp:1017525.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py'
2--- ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2012-03-27 19:04:46 +0000
3+++ ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2012-06-25 14:42:24 +0000
4@@ -28,6 +28,7 @@
5 import actions.payment as payment_actions
6 import actions.payment_confirmed as payment_confirmed_actions
7
8+skip('This test must be updated for Ubuntu Pay.')
9 if ENVIRONMENT == 'production':
10 skip('Can\'t test payments on production.')
11 setup_actions.setup(new_user=True)
12
13=== modified file 'ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py'
14--- ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2012-03-27 19:04:46 +0000
15+++ ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2012-06-25 14:42:24 +0000
16@@ -27,6 +27,7 @@
17 import actions.payment as payment_actions
18 import actions.payment_confirmed as payment_confirmed_actions
19
20+skip('This test must be updated for Ubuntu Pay.')
21 setup_actions.setup(new_user=True)
22 services_actions.open()
23 services_actions.buy_extra_storage()
24
25=== modified file 'ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py'
26--- ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2012-03-27 19:04:46 +0000
27+++ ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2012-06-25 14:42:24 +0000
28@@ -27,6 +27,7 @@
29 import actions.payment as payment_actions
30 import actions.payment_confirmed as payment_confirmed_actions
31
32+skip('This test must be updated for Ubuntu Pay.')
33 if ENVIRONMENT == 'production':
34 skip('Can\'t test payments on production.')
35 setup_actions.setup()
36
37=== modified file 'ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py'
38--- ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py 2012-03-27 19:04:46 +0000
39+++ ubuntuone/web/tests/sst/services/u1webse004_choosestorageamount.py 2012-06-25 14:42:24 +0000
40@@ -1,10 +1,6 @@
41 # -*- coding: utf-8 -*-
42
43-# Authors:
44-# Rick McBride <rick.mcbride@canonical.com>
45-# Leo Arias <leo.arias@canonical.com>
46-#
47-# Copyright 2011 Canonical Ltd.
48+# Copyright 2011, 2012 Canonical Ltd.
49 #
50 # This program is free software: you can redistribute it and/or modify it
51 # under the terms of the GNU General Public License version 3, as published
52@@ -26,6 +22,7 @@
53
54 setup_actions.setup()
55 services_actions.open()
56+services_actions.click_add_extra_storage()
57 services_actions.assert_storage(1)
58 services_actions.increase_storage_quantity()
59 services_actions.assert_storage(2)
60
61=== modified file 'ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py'
62--- ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py 2012-03-27 19:04:46 +0000
63+++ ubuntuone/web/tests/sst/services/u1webse005_addmonthlystorage.py 2012-06-25 14:42:24 +0000
64@@ -1,10 +1,6 @@
65 # -*- coding: utf-8 -*-
66
67-# Authors:
68-# Rick McBride <rick.mcbride@canonical.com>
69-# Leo Arias <leo.arias@canonical.com>
70-#
71-# Copyright 2011 Canonical Ltd.
72+# Copyright 2011, 2012 Canonical Ltd.
73 #
74 # This program is free software: you can redistribute it and/or modify it
75 # under the terms of the GNU General Public License version 3, as published
76@@ -27,7 +23,6 @@
77
78 setup_actions.setup()
79 services_actions.open()
80-services_actions.set_storage_quantity(5)
81-services_actions.buy_extra_storage_monthly()
82+services_actions.buy_extra_storage_monthly(5)
83 payment_actions.assert_page_title()
84 payment_actions.assert_monthly_extra_storage_subscription(5)
85
86=== modified file 'ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py'
87--- ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py 2012-03-27 19:04:46 +0000
88+++ ubuntuone/web/tests/sst/services/u1webse006_addannuallystorage.py 2012-06-25 14:42:24 +0000
89@@ -1,10 +1,6 @@
90 # -*- coding: utf-8 -*-
91
92-# Authors:
93-# Rick McBride <rick.mcbride@canonical.com>
94-# Leo Arias <leo.arias@canonical.com>
95-#
96-# Copyright 2011 Canonical Ltd.
97+# Copyright 2011, 2012 Canonical Ltd.
98 #
99 # This program is free software: you can redistribute it and/or modify it
100 # under the terms of the GNU General Public License version 3, as published
101@@ -27,7 +23,6 @@
102
103 setup_actions.setup()
104 services_actions.open()
105-services_actions.set_storage_quantity(5)
106-services_actions.buy_extra_storage_yearly()
107+services_actions.buy_extra_storage_yearly(5)
108 payment_actions.assert_page_title()
109 payment_actions.assert_annually_extra_storage_subscription(5)
110
111=== modified file 'ubuntuone/web/tests/sst/shared/actions/services.py'
112--- ubuntuone/web/tests/sst/shared/actions/services.py 2012-06-01 16:09:57 +0000
113+++ ubuntuone/web/tests/sst/shared/actions/services.py 2012-06-25 14:42:24 +0000
114@@ -1,10 +1,6 @@
115 # -*- coding: utf-8 -*-
116
117-# Authors:
118-# Rick McBride <rick.mcbride@canonical.com>
119-# Leo Arias <leo.arias@canonical.com>
120-#
121-# Copyright 2011 Canonical Ltd.
122+# Copyright 2011, 2012 Canonical Ltd.
123 #
124 # This program is free software: you can redistribute it and/or modify it
125 # under the terms of the GNU General Public License version 3, as published
126@@ -72,29 +68,72 @@
127 get_element(tag='h2', text='Storage')
128 get_element(tag='li', text='20 GB')
129 get_element(tag='li', text='$2.99 / month')
130- get_element(tag='li', text='or $29.99 / year')
131+ get_element(tag='li', text='$29.99 / year')
132
133 def assert_discount_information():
134 """Assert that the yearly discount information is the expected."""
135- get_element(tag='h3', text='Discount')
136+ get_element(tag='h2', text='Discount')
137 get_element(tag='p', text='Two months free on Music Streaming and Storage '
138 'when you sign up for 12 months')
139
140 def buy_music_streaming_monthly():
141 """Buy the monthly music streaming service."""
142+ _click_add_music_streaming()
143+ _select_music_streaming_monthly()
144+ _click_next_checkout_button()
145+
146+def _click_add_music_streaming():
147+ add_music_streaming_link = get_element(text='Add Music Streaming')
148+ click_link(add_music_streaming_link)
149+
150+def _select_music_streaming_monthly():
151 set_radio_value('ms1')
152- click_button(get_elements(css_class='buy-now',
153- text='Buy now and go to checkout')[0])
154+
155+def _click_next_checkout_button():
156+ next_checkout_button = get_element(text='Next-checkout')
157+ click_button(next_checkout_button)
158
159 def buy_music_streaming_yearly():
160 """Buy the yearly music streaming service."""
161+ _click_add_music_streaming()
162+ _select_music_streaming_yearly()
163+ _click_next_checkout_button()
164+
165+def _select_music_streaming_yearly():
166 set_radio_value('ms2')
167- buy_music_streaming()
168-
169-def buy_music_streaming():
170- """Click the button to buy the music streaming service."""
171- click_button(get_elements(css_class='buy-now',
172- text='Buy now and go to checkout')[0])
173+
174+def buy_extra_storage_monthly(quantity):
175+ """Buy the monthly extra storage service."""
176+ click_add_extra_storage()
177+ set_storage_quantity(quantity)
178+ _select_extra_storage_montly()
179+ _click_next_checkout_button()
180+
181+def click_add_extra_storage():
182+ add_extra_storage_link = get_element(text='Add extra Storage')
183+ click_link(add_extra_storage_link)
184+
185+def set_storage_quantity(quantity):
186+ """Set the storage quantity to buy.
187+
188+ Keyword arguments:
189+ quantity -- The quantity to buy.
190+
191+ """
192+ write_textfield('qty', str(quantity))
193+
194+def _select_extra_storage_montly():
195+ set_radio_value('st1')
196+
197+def buy_extra_storage_yearly(quantity):
198+ """Buy the yearly extra storage service."""
199+ click_add_extra_storage()
200+ set_storage_quantity(quantity)
201+ _select_extra_storage_yearly()
202+ _click_next_checkout_button()
203+
204+def _select_extra_storage_yearly():
205+ set_radio_value('st2')
206
207 def assert_storage(quantity):
208 """Asert the storage quantity selected and its space and price.
209@@ -117,27 +156,3 @@
210 def decrease_storage_quantity():
211 """Click the button that decreases the storage quantity to buy."""
212 click_button('minus_qty')
213-
214-def set_storage_quantity(quantity):
215- """Set the storage quantity to buy.
216-
217- Keyword arguments:
218- quantity -- The quantity to buy.
219-
220- """
221- write_textfield('qty', str(quantity))
222-
223-def buy_extra_storage_monthly():
224- """Buy the monthly extra storage service."""
225- set_radio_value('st1')
226- buy_extra_storage()
227-
228-def buy_extra_storage_yearly():
229- """Buy the yearly extra storage service."""
230- set_radio_value('st2')
231- buy_extra_storage()
232-
233-def buy_extra_storage():
234- """Click the button to buy extra storage."""
235- click_button(get_elements(css_class='buy-now',
236- text='Buy now and go to checkout')[1])

Subscribers

People subscribed via source and target branches