Merge lp:~elopio/ubuntuone-testing/u1web into lp:~rmcbride/ubuntuone-testing/sst-services-page
- u1web
- Merge into sst-services-page
Proposed by
Leo Arias
Status: | Merged |
---|---|
Merged at revision: | 33 |
Proposed branch: | lp:~elopio/ubuntuone-testing/u1web |
Merge into: | lp:~rmcbride/ubuntuone-testing/sst-services-page |
Diff against target: |
331 lines (+244/-2) 9 files modified
qa/selenium/services/u1webp-001.py (+47/-0) qa/selenium/services/u1webp-002.py (+46/-0) qa/selenium/services/u1webp-003.py (+34/-0) qa/selenium/services/u1webse-001.py (+22/-0) qa/selenium/services/u1webse-002.py (+13/-0) qa/selenium/services/u1webse-003.py (+15/-1) qa/selenium/services/u1webse-004.py (+29/-0) qa/selenium/services/u1webse-005.py (+19/-1) qa/selenium/services/u1webse-006.py (+19/-0) |
To merge this branch: | bzr merge lp:~elopio/ubuntuone-testing/u1web |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rick McBride | Approve | ||
Review via email: mp+75300@code.launchpad.net |
Commit message
Added the actions for the Services tests: u1webse-001 to u1webse-006.
Added the actions for the Payments tests: u1webp-001 to u1webse-003.
Description of the change
Completed the actions for the services tests.
To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'qa/selenium/services/u1webp-001.py' |
2 | --- qa/selenium/services/u1webp-001.py 1970-01-01 00:00:00 +0000 |
3 | +++ qa/selenium/services/u1webp-001.py 2011-09-14 05:18:46 +0000 |
4 | @@ -0,0 +1,47 @@ |
5 | +from sst.actions import * |
6 | +from additional._actions import * |
7 | +try: |
8 | + from _passwords import username, password |
9 | +except: |
10 | + print "try adding a _passwords.py file if you expect this to work ;)" |
11 | +from additional.config import base_url |
12 | +from datetime import date |
13 | + |
14 | +set_base_url(base_url) |
15 | +login(username, password) |
16 | +title_is(u'Ubuntu One : Dashboard') |
17 | +goto('/services/') |
18 | +title_is(u'Ubuntu One : Services') |
19 | +radio_select('ms2') |
20 | +button_click(get_elements(css_class='buy-now', |
21 | + text='Buy now and go to checkout')[0]) |
22 | +title_is(u'Ubuntu One : Checkout') |
23 | +textfield_write('id_street', 'Test Street') |
24 | +textfield_write('id_city', 'Test City') |
25 | +textfield_write('id_state', 'Test Region') |
26 | +textfield_write('id_postal', '12345') |
27 | +set_select('id_country', 'United States') |
28 | +set_select('id_card_type', 'Visa') |
29 | +textfield_write('id_card_holder', 'Test name') |
30 | +textfield_write('id_card_number', '4111111111111111') |
31 | +textfield_write('id_card_ccv', '123') |
32 | +set_select('id_card_expiration_0', '10') |
33 | +set_select('id_card_expiration_1', '2015') |
34 | +button_click(get_element(css_class='cta', value='Purchase')) |
35 | +title_is(u'Ubuntu One : Confirm Payment Details') |
36 | +link_click(get_element(css_class='cta', href='confirmed')) |
37 | +title_is(u'Ubuntu One : Confirm Payment Details') |
38 | +get_element(tag='h1', text='Payment Processed') |
39 | +today = date.today() |
40 | +next_month = today.replace(month = today.month + 1) |
41 | +#get_element(tag='dt', css_class='purchase_details' |
42 | +# text='Expires: %(next_month)s' |
43 | +# % {'next_month': next_month.strftime('%B %-d, %Y')}) |
44 | +get_element(tag='p', css_class='explanation', |
45 | + text='Your card will automatically be billed $39.99 annually') |
46 | +get_element(tag='dd', text='AUTHORISED') |
47 | +link_click(get_element(tag='a', text='View your account')) |
48 | +get_element(tag='span', text='29 trial days left') |
49 | +get_element(tag='p', text='You are subscribed yearly') |
50 | +get_element(tag='span', text='See my subscription') |
51 | +get_element(tag='span', text='20GB with Music Streaming') |
52 | |
53 | === added file 'qa/selenium/services/u1webp-002.py' |
54 | --- qa/selenium/services/u1webp-002.py 1970-01-01 00:00:00 +0000 |
55 | +++ qa/selenium/services/u1webp-002.py 2011-09-14 05:18:46 +0000 |
56 | @@ -0,0 +1,46 @@ |
57 | +from sst.actions import * |
58 | +from additional._actions import * |
59 | +try: |
60 | + from _passwords import username, password |
61 | +except: |
62 | + print "try adding a _passwords.py file if you expect this to work ;)" |
63 | +from additional.config import base_url |
64 | +from datetime import date |
65 | + |
66 | +set_base_url(base_url) |
67 | +login(username, password) |
68 | +title_is(u'Ubuntu One : Dashboard') |
69 | +goto('/services/') |
70 | +title_is(u'Ubuntu One : Services') |
71 | +textfield_write('qty', '5') |
72 | +radio_select('st1') |
73 | +button_click(get_elements(css_class='buy-now', |
74 | + text='Buy now and go to checkout')[1]) |
75 | +title_is(u'Ubuntu One : Checkout') |
76 | +textfield_write('id_street', 'Test Street') |
77 | +textfield_write('id_city', 'Test City') |
78 | +textfield_write('id_state', 'Test Region') |
79 | +textfield_write('id_postal', '12345') |
80 | +set_select('id_country', 'United States') |
81 | +set_select('id_card_type', 'American Express') |
82 | +textfield_write('id_card_holder', 'Test name') |
83 | +textfield_write('id_card_number', '343434343434343') |
84 | +textfield_write('id_card_ccv', '123') |
85 | +set_select('id_card_expiration_0', '10') |
86 | +set_select('id_card_expiration_1', '2015') |
87 | +button_click(get_element(css_class='cta', value='Purchase')) |
88 | +title_is(u'Ubuntu One : Confirm Payment Details') |
89 | +link_click(get_element(css_class='cta', href='confirmed')) |
90 | +title_is(u'Ubuntu One : Confirm Payment Details') |
91 | +get_element(tag='h1', text='Payment Processed') |
92 | +today = date.today() |
93 | +next_month = today.replace(month = today.month + 1) |
94 | +#get_element(tag='dt', css_class='purchase_details' |
95 | +# text='Expires: %(next_month)s' |
96 | +# % {'next_month': next_month.strftime('%B %-d, %Y')}) |
97 | +get_element(tag='p', css_class='explanation', |
98 | + text='Your card will automatically be billed $14.95 monthly') |
99 | +get_element(tag='dd', text='AUTHORISED') |
100 | +link_click(get_element(tag='a', text='View your account')) |
101 | +get_element(tag='span', text='5GB with Ubuntu One Free') |
102 | +get_element(tag='span', text='100GB from storage add-on') |
103 | |
104 | === added file 'qa/selenium/services/u1webp-003.py' |
105 | --- qa/selenium/services/u1webp-003.py 1970-01-01 00:00:00 +0000 |
106 | +++ qa/selenium/services/u1webp-003.py 2011-09-14 05:18:46 +0000 |
107 | @@ -0,0 +1,34 @@ |
108 | +from sst.actions import * |
109 | +from additional._actions import * |
110 | +try: |
111 | + from _passwords import username, password |
112 | +except: |
113 | + print "try adding a _passwords.py file if you expect this to work ;)" |
114 | +from additional.config import base_url |
115 | + |
116 | +set_base_url(base_url) |
117 | +login(username, password) |
118 | +title_is(u'Ubuntu One : Dashboard') |
119 | +goto('/services/') |
120 | +title_is(u'Ubuntu One : Services') |
121 | +radio_select('ms2') |
122 | +button_click(get_elements(css_class='buy-now', |
123 | + text='Buy now and go to checkout')[0]) |
124 | +title_is(u'Ubuntu One : Checkout') |
125 | +textfield_write('id_street', 'Test Street') |
126 | +textfield_write('id_city', 'Test City') |
127 | +textfield_write('id_state', 'Test Region') |
128 | +textfield_write('id_postal', '12345') |
129 | +set_select('id_country', 'United States') |
130 | +set_select('id_card_type', 'Visa') |
131 | +textfield_write('id_card_holder', 'REFUSED') |
132 | +textfield_write('id_card_number', '4111111111111111') |
133 | +textfield_write('id_card_ccv', '123') |
134 | +set_select('id_card_expiration_0', '10') |
135 | +set_select('id_card_expiration_1', '2015') |
136 | +button_click(get_element(css_class='cta', value='Purchase')) |
137 | +title_is(u'Ubuntu One : Confirm Payment Details') |
138 | +link_click(get_element(css_class='cta', href='confirmed')) |
139 | +title_is(u'Ubuntu One : Confirm Payment Details') |
140 | +get_element(tag='h1', text='Your Payment Failed') |
141 | +get_element(tag='a', text='fill out the details here', href='/payment/') |
142 | |
143 | === modified file 'qa/selenium/services/u1webse-001.py' |
144 | --- qa/selenium/services/u1webse-001.py 2011-09-02 19:47:18 +0000 |
145 | +++ qa/selenium/services/u1webse-001.py 2011-09-14 05:18:46 +0000 |
146 | @@ -8,3 +8,25 @@ |
147 | |
148 | set_base_url(base_url) |
149 | login(username, password) |
150 | +title_is(u'Ubuntu One : Dashboard') |
151 | +goto('/services/') |
152 | +get_element(tag='h1', text='Free') |
153 | +get_element(tag='li', text='File sync across platforms') |
154 | +get_element(tag='li', text='Share folders and files') |
155 | +get_element(tag='li', text='Access on your mobile') |
156 | +# TODO there are two Music Streaming elements. We should use xpath to be |
157 | +# sure that we are on the right section. |
158 | +#get_element(tag='h1', text='Music Streaming') |
159 | +get_element(css_class='try-free', text='Try for FREE') |
160 | +get_element(tag='li', text='Music streaming on your mobile') |
161 | +get_element(tag='li', text='20 GB of Storage built in') |
162 | +get_element(tag='li', text='Listen offline on Android') |
163 | +get_element(tag='li', |
164 | + text='$3.99 / month or $39.99 / year') |
165 | +get_element(tag='h1', text='Storage') |
166 | +get_element(tag='li', text='20 GB') |
167 | +get_element(tag='li', text='$2.99 / month') |
168 | +get_element(tag='li', text='or $29.99 / year') |
169 | +get_element(tag='h1', text='Discount') |
170 | +get_element(tag='p', text='Two months free on Music Streaming and Storage ' \ |
171 | + 'when you sign up for 12 months') |
172 | |
173 | === modified file 'qa/selenium/services/u1webse-002.py' |
174 | --- qa/selenium/services/u1webse-002.py 2011-09-06 19:07:52 +0000 |
175 | +++ qa/selenium/services/u1webse-002.py 2011-09-14 05:18:46 +0000 |
176 | @@ -11,3 +11,16 @@ |
177 | title_is(u'Ubuntu One : Dashboard') |
178 | goto('/services/') |
179 | title_is(u'Ubuntu One : Services') |
180 | +radio_select('ms1') |
181 | +button_click(get_elements(css_class='buy-now', |
182 | + text='Buy now and go to checkout')[0]) |
183 | +title_is(u'Ubuntu One : Checkout') |
184 | +get_element(tag='h1', text='New Subscription') |
185 | +get_element(css_class='price', text='$3.99') |
186 | +get_element(tag='span', css_class='price', text='$3.99') |
187 | +today = date.today() |
188 | +next_month = today.replace(month = today.month + 1) |
189 | +get_element(tag='p', text='This is a trial subscription which will expire ' \ |
190 | + '%(next_month)s afterwhich your card ' \ |
191 | + 'will automatically be billed $3.99 monthly' |
192 | + % {'next_month': next_month.strftime('%B %-d, %Y')}) |
193 | |
194 | === modified file 'qa/selenium/services/u1webse-003.py' |
195 | --- qa/selenium/services/u1webse-003.py 2011-09-06 19:07:52 +0000 |
196 | +++ qa/selenium/services/u1webse-003.py 2011-09-14 05:18:46 +0000 |
197 | @@ -4,10 +4,24 @@ |
198 | from _passwords import username, password |
199 | except: |
200 | print "try adding a _passwords.py file if you expect this to work ;)" |
201 | -from additional.config import base_url |
202 | +from additional.config import base_url |
203 | +from datetime import date |
204 | |
205 | set_base_url(base_url) |
206 | login(username, password) |
207 | title_is(u'Ubuntu One : Dashboard') |
208 | goto('/services/') |
209 | title_is(u'Ubuntu One : Services') |
210 | +radio_select('ms2') |
211 | +button_click(get_elements(css_class='buy-now', |
212 | + text='Buy now and go to checkout')[0]) |
213 | +title_is(u'Ubuntu One : Checkout') |
214 | +get_element(tag='h1', text='New Subscription') |
215 | +get_element(css_class='price', text='$39.99') |
216 | +get_element(tag='span', css_class='price', text='$39.99') |
217 | +today = date.today() |
218 | +next_month = today.replace(month = today.month + 1) |
219 | +get_element(tag='p', text='This is a trial subscription which will expire ' \ |
220 | + '%(next_month)s afterwhich your card ' \ |
221 | + 'will automatically be billed $39.99 annually' |
222 | + % {'next_month': next_month.strftime('%B %-d, %Y')}) |
223 | |
224 | === modified file 'qa/selenium/services/u1webse-004.py' |
225 | --- qa/selenium/services/u1webse-004.py 2011-09-06 19:07:52 +0000 |
226 | +++ qa/selenium/services/u1webse-004.py 2011-09-14 05:18:46 +0000 |
227 | @@ -6,8 +6,37 @@ |
228 | print "try adding a _passwords.py file if you expect this to work ;)" |
229 | from additional.config import base_url |
230 | |
231 | +def assert_storage(quantity): |
232 | + """ |
233 | + Asert the storage quantity selected and its space and price. |
234 | + |
235 | + Keyword arguments: |
236 | + quantity -- The expected storage quantity. |
237 | + """ |
238 | + text_is('qty', str(quantity)) |
239 | + text_is('storage-gb', '%sGB' % (quantity * 20)) |
240 | + monthly_price = quantity * 2.99 |
241 | + text_is('storage-monthly-price', '$%s' % monthly_price) |
242 | + annual_price = quantity * 29.99 |
243 | + text_is('storage-annual-price', '$%s' % annual_price) |
244 | + |
245 | + |
246 | set_base_url(base_url) |
247 | login(username, password) |
248 | title_is(u'Ubuntu One : Dashboard') |
249 | goto('/services/') |
250 | title_is(u'Ubuntu One : Services') |
251 | +assert_storage(1) |
252 | +button_click('plus_qty') |
253 | +assert_storage(2) |
254 | +button_click('minus_qty') |
255 | +for quantity in range(2, 11): |
256 | + button_click('plus_qty') |
257 | + assert_storage(quantity) |
258 | +for quantity in range(9, 4, -1): |
259 | + button_click('minus_qty') |
260 | + assert_storage(quantity) |
261 | +textfield_write('qty', '25') |
262 | +# Move the focus out of the textfield. |
263 | +click('storage-gb') |
264 | +assert_storage(25) |
265 | |
266 | === modified file 'qa/selenium/services/u1webse-005.py' |
267 | --- qa/selenium/services/u1webse-005.py 2011-09-06 19:07:52 +0000 |
268 | +++ qa/selenium/services/u1webse-005.py 2011-09-14 05:18:46 +0000 |
269 | @@ -4,10 +4,28 @@ |
270 | from _passwords import username, password |
271 | except: |
272 | print "try adding a _passwords.py file if you expect this to work ;)" |
273 | -from additional.config import base_url |
274 | +from additional.config import base_url |
275 | +from datetime import date |
276 | |
277 | set_base_url(base_url) |
278 | login(username, password) |
279 | title_is(u'Ubuntu One : Dashboard') |
280 | goto('/services/') |
281 | title_is(u'Ubuntu One : Services') |
282 | +textfield_write('qty', '5') |
283 | +radio_select('st1') |
284 | +button_click(get_elements(css_class='buy-now', |
285 | + text='Buy now and go to checkout')[1]) |
286 | +title_is(u'Ubuntu One : Checkout') |
287 | +get_element(tag='h1', text='Subscription Change') |
288 | +get_element(tag='p', text='5 x 20-Pack with 20 GB (monthly)') |
289 | +get_element(tag='strong', text='Monthly') |
290 | +get_element(css_class='price', text='$2.99') |
291 | +get_element(tag='span', css_class='price', text='$14.95') |
292 | +today = date.today() |
293 | +next_month = today.replace(month = today.month + 1) |
294 | +get_element(tag='p', text='This payment will cover the period from ' \ |
295 | + '%(today)s to %(next_month)s afterwhich your card ' \ |
296 | + 'will automatically be billed $14.95 monthly' |
297 | + % {'today': today.strftime('%B %-d, %Y'), |
298 | + 'next_month': next_month.strftime('%B %-d, %Y')}) |
299 | |
300 | === modified file 'qa/selenium/services/u1webse-006.py' |
301 | --- qa/selenium/services/u1webse-006.py 2011-09-06 19:07:52 +0000 |
302 | +++ qa/selenium/services/u1webse-006.py 2011-09-14 05:18:46 +0000 |
303 | @@ -5,9 +5,28 @@ |
304 | except: |
305 | print "try adding a _passwords.py file if you expect this to work ;)" |
306 | from additional.config import base_url |
307 | +from datetime import date |
308 | |
309 | set_base_url(base_url) |
310 | login(username, password) |
311 | title_is(u'Ubuntu One : Dashboard') |
312 | goto('/services/') |
313 | title_is(u'Ubuntu One : Services') |
314 | + |
315 | +textfield_write('qty', '5') |
316 | +radio_select('st2') |
317 | +button_click(get_elements(css_class='buy-now', |
318 | + text='Buy now and go to checkout')[1]) |
319 | +title_is(u'Ubuntu One : Checkout') |
320 | +get_element(tag='h1', text='Subscription Change') |
321 | +get_element(tag='p', text='5 x 20-Pack with 20 GB (yearly)') |
322 | +get_element(tag='strong', text='Yearly') |
323 | +get_element(css_class='price', text='$29.99') |
324 | +get_element(tag='span', css_class='price', text='$149.95') |
325 | +today = date.today() |
326 | +next_year = today.replace(year = today.year + 1, day = today.day + 1) |
327 | +get_element(tag='p', text='This payment will cover the period from ' \ |
328 | + '%(today)s to %(next_year)s afterwhich your card ' \ |
329 | + 'will automatically be billed $149.95 annually' \ |
330 | + % {'today': today.strftime('%B %-d, %Y'), |
331 | + 'next_year': next_year.strftime('%B %-d, %Y')}) |