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:
|
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
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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 | 1 | from sst.actions import * | ||
6 | 2 | from additional._actions import * | ||
7 | 3 | try: | ||
8 | 4 | from _passwords import username, password | ||
9 | 5 | except: | ||
10 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | ||
11 | 7 | from additional.config import base_url | ||
12 | 8 | from datetime import date | ||
13 | 9 | |||
14 | 10 | set_base_url(base_url) | ||
15 | 11 | login(username, password) | ||
16 | 12 | title_is(u'Ubuntu One : Dashboard') | ||
17 | 13 | goto('/services/') | ||
18 | 14 | title_is(u'Ubuntu One : Services') | ||
19 | 15 | radio_select('ms2') | ||
20 | 16 | button_click(get_elements(css_class='buy-now', | ||
21 | 17 | text='Buy now and go to checkout')[0]) | ||
22 | 18 | title_is(u'Ubuntu One : Checkout') | ||
23 | 19 | textfield_write('id_street', 'Test Street') | ||
24 | 20 | textfield_write('id_city', 'Test City') | ||
25 | 21 | textfield_write('id_state', 'Test Region') | ||
26 | 22 | textfield_write('id_postal', '12345') | ||
27 | 23 | set_select('id_country', 'United States') | ||
28 | 24 | set_select('id_card_type', 'Visa') | ||
29 | 25 | textfield_write('id_card_holder', 'Test name') | ||
30 | 26 | textfield_write('id_card_number', '4111111111111111') | ||
31 | 27 | textfield_write('id_card_ccv', '123') | ||
32 | 28 | set_select('id_card_expiration_0', '10') | ||
33 | 29 | set_select('id_card_expiration_1', '2015') | ||
34 | 30 | button_click(get_element(css_class='cta', value='Purchase')) | ||
35 | 31 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
36 | 32 | link_click(get_element(css_class='cta', href='confirmed')) | ||
37 | 33 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
38 | 34 | get_element(tag='h1', text='Payment Processed') | ||
39 | 35 | today = date.today() | ||
40 | 36 | next_month = today.replace(month = today.month + 1) | ||
41 | 37 | #get_element(tag='dt', css_class='purchase_details' | ||
42 | 38 | # text='Expires: %(next_month)s' | ||
43 | 39 | # % {'next_month': next_month.strftime('%B %-d, %Y')}) | ||
44 | 40 | get_element(tag='p', css_class='explanation', | ||
45 | 41 | text='Your card will automatically be billed $39.99 annually') | ||
46 | 42 | get_element(tag='dd', text='AUTHORISED') | ||
47 | 43 | link_click(get_element(tag='a', text='View your account')) | ||
48 | 44 | get_element(tag='span', text='29 trial days left') | ||
49 | 45 | get_element(tag='p', text='You are subscribed yearly') | ||
50 | 46 | get_element(tag='span', text='See my subscription') | ||
51 | 47 | get_element(tag='span', text='20GB with Music Streaming') | ||
52 | 0 | 48 | ||
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 | 1 | from sst.actions import * | ||
58 | 2 | from additional._actions import * | ||
59 | 3 | try: | ||
60 | 4 | from _passwords import username, password | ||
61 | 5 | except: | ||
62 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | ||
63 | 7 | from additional.config import base_url | ||
64 | 8 | from datetime import date | ||
65 | 9 | |||
66 | 10 | set_base_url(base_url) | ||
67 | 11 | login(username, password) | ||
68 | 12 | title_is(u'Ubuntu One : Dashboard') | ||
69 | 13 | goto('/services/') | ||
70 | 14 | title_is(u'Ubuntu One : Services') | ||
71 | 15 | textfield_write('qty', '5') | ||
72 | 16 | radio_select('st1') | ||
73 | 17 | button_click(get_elements(css_class='buy-now', | ||
74 | 18 | text='Buy now and go to checkout')[1]) | ||
75 | 19 | title_is(u'Ubuntu One : Checkout') | ||
76 | 20 | textfield_write('id_street', 'Test Street') | ||
77 | 21 | textfield_write('id_city', 'Test City') | ||
78 | 22 | textfield_write('id_state', 'Test Region') | ||
79 | 23 | textfield_write('id_postal', '12345') | ||
80 | 24 | set_select('id_country', 'United States') | ||
81 | 25 | set_select('id_card_type', 'American Express') | ||
82 | 26 | textfield_write('id_card_holder', 'Test name') | ||
83 | 27 | textfield_write('id_card_number', '343434343434343') | ||
84 | 28 | textfield_write('id_card_ccv', '123') | ||
85 | 29 | set_select('id_card_expiration_0', '10') | ||
86 | 30 | set_select('id_card_expiration_1', '2015') | ||
87 | 31 | button_click(get_element(css_class='cta', value='Purchase')) | ||
88 | 32 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
89 | 33 | link_click(get_element(css_class='cta', href='confirmed')) | ||
90 | 34 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
91 | 35 | get_element(tag='h1', text='Payment Processed') | ||
92 | 36 | today = date.today() | ||
93 | 37 | next_month = today.replace(month = today.month + 1) | ||
94 | 38 | #get_element(tag='dt', css_class='purchase_details' | ||
95 | 39 | # text='Expires: %(next_month)s' | ||
96 | 40 | # % {'next_month': next_month.strftime('%B %-d, %Y')}) | ||
97 | 41 | get_element(tag='p', css_class='explanation', | ||
98 | 42 | text='Your card will automatically be billed $14.95 monthly') | ||
99 | 43 | get_element(tag='dd', text='AUTHORISED') | ||
100 | 44 | link_click(get_element(tag='a', text='View your account')) | ||
101 | 45 | get_element(tag='span', text='5GB with Ubuntu One Free') | ||
102 | 46 | get_element(tag='span', text='100GB from storage add-on') | ||
103 | 0 | 47 | ||
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 | 1 | from sst.actions import * | ||
109 | 2 | from additional._actions import * | ||
110 | 3 | try: | ||
111 | 4 | from _passwords import username, password | ||
112 | 5 | except: | ||
113 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | ||
114 | 7 | from additional.config import base_url | ||
115 | 8 | |||
116 | 9 | set_base_url(base_url) | ||
117 | 10 | login(username, password) | ||
118 | 11 | title_is(u'Ubuntu One : Dashboard') | ||
119 | 12 | goto('/services/') | ||
120 | 13 | title_is(u'Ubuntu One : Services') | ||
121 | 14 | radio_select('ms2') | ||
122 | 15 | button_click(get_elements(css_class='buy-now', | ||
123 | 16 | text='Buy now and go to checkout')[0]) | ||
124 | 17 | title_is(u'Ubuntu One : Checkout') | ||
125 | 18 | textfield_write('id_street', 'Test Street') | ||
126 | 19 | textfield_write('id_city', 'Test City') | ||
127 | 20 | textfield_write('id_state', 'Test Region') | ||
128 | 21 | textfield_write('id_postal', '12345') | ||
129 | 22 | set_select('id_country', 'United States') | ||
130 | 23 | set_select('id_card_type', 'Visa') | ||
131 | 24 | textfield_write('id_card_holder', 'REFUSED') | ||
132 | 25 | textfield_write('id_card_number', '4111111111111111') | ||
133 | 26 | textfield_write('id_card_ccv', '123') | ||
134 | 27 | set_select('id_card_expiration_0', '10') | ||
135 | 28 | set_select('id_card_expiration_1', '2015') | ||
136 | 29 | button_click(get_element(css_class='cta', value='Purchase')) | ||
137 | 30 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
138 | 31 | link_click(get_element(css_class='cta', href='confirmed')) | ||
139 | 32 | title_is(u'Ubuntu One : Confirm Payment Details') | ||
140 | 33 | get_element(tag='h1', text='Your Payment Failed') | ||
141 | 34 | get_element(tag='a', text='fill out the details here', href='/payment/') | ||
142 | 0 | 35 | ||
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 | 8 | 8 | ||
148 | 9 | set_base_url(base_url) | 9 | set_base_url(base_url) |
149 | 10 | login(username, password) | 10 | login(username, password) |
150 | 11 | title_is(u'Ubuntu One : Dashboard') | ||
151 | 12 | goto('/services/') | ||
152 | 13 | get_element(tag='h1', text='Free') | ||
153 | 14 | get_element(tag='li', text='File sync across platforms') | ||
154 | 15 | get_element(tag='li', text='Share folders and files') | ||
155 | 16 | get_element(tag='li', text='Access on your mobile') | ||
156 | 17 | # TODO there are two Music Streaming elements. We should use xpath to be | ||
157 | 18 | # sure that we are on the right section. | ||
158 | 19 | #get_element(tag='h1', text='Music Streaming') | ||
159 | 20 | get_element(css_class='try-free', text='Try for FREE') | ||
160 | 21 | get_element(tag='li', text='Music streaming on your mobile') | ||
161 | 22 | get_element(tag='li', text='20 GB of Storage built in') | ||
162 | 23 | get_element(tag='li', text='Listen offline on Android') | ||
163 | 24 | get_element(tag='li', | ||
164 | 25 | text='$3.99 / month or $39.99 / year') | ||
165 | 26 | get_element(tag='h1', text='Storage') | ||
166 | 27 | get_element(tag='li', text='20 GB') | ||
167 | 28 | get_element(tag='li', text='$2.99 / month') | ||
168 | 29 | get_element(tag='li', text='or $29.99 / year') | ||
169 | 30 | get_element(tag='h1', text='Discount') | ||
170 | 31 | get_element(tag='p', text='Two months free on Music Streaming and Storage ' \ | ||
171 | 32 | 'when you sign up for 12 months') | ||
172 | 11 | 33 | ||
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 | 11 | title_is(u'Ubuntu One : Dashboard') | 11 | title_is(u'Ubuntu One : Dashboard') |
178 | 12 | goto('/services/') | 12 | goto('/services/') |
179 | 13 | title_is(u'Ubuntu One : Services') | 13 | title_is(u'Ubuntu One : Services') |
180 | 14 | radio_select('ms1') | ||
181 | 15 | button_click(get_elements(css_class='buy-now', | ||
182 | 16 | text='Buy now and go to checkout')[0]) | ||
183 | 17 | title_is(u'Ubuntu One : Checkout') | ||
184 | 18 | get_element(tag='h1', text='New Subscription') | ||
185 | 19 | get_element(css_class='price', text='$3.99') | ||
186 | 20 | get_element(tag='span', css_class='price', text='$3.99') | ||
187 | 21 | today = date.today() | ||
188 | 22 | next_month = today.replace(month = today.month + 1) | ||
189 | 23 | get_element(tag='p', text='This is a trial subscription which will expire ' \ | ||
190 | 24 | '%(next_month)s afterwhich your card ' \ | ||
191 | 25 | 'will automatically be billed $3.99 monthly' | ||
192 | 26 | % {'next_month': next_month.strftime('%B %-d, %Y')}) | ||
193 | 14 | 27 | ||
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 | 4 | from _passwords import username, password | 4 | from _passwords import username, password |
199 | 5 | except: | 5 | except: |
200 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | 6 | print "try adding a _passwords.py file if you expect this to work ;)" |
202 | 7 | from additional.config import base_url | 7 | from additional.config import base_url |
203 | 8 | from datetime import date | ||
204 | 8 | 9 | ||
205 | 9 | set_base_url(base_url) | 10 | set_base_url(base_url) |
206 | 10 | login(username, password) | 11 | login(username, password) |
207 | 11 | title_is(u'Ubuntu One : Dashboard') | 12 | title_is(u'Ubuntu One : Dashboard') |
208 | 12 | goto('/services/') | 13 | goto('/services/') |
209 | 13 | title_is(u'Ubuntu One : Services') | 14 | title_is(u'Ubuntu One : Services') |
210 | 15 | radio_select('ms2') | ||
211 | 16 | button_click(get_elements(css_class='buy-now', | ||
212 | 17 | text='Buy now and go to checkout')[0]) | ||
213 | 18 | title_is(u'Ubuntu One : Checkout') | ||
214 | 19 | get_element(tag='h1', text='New Subscription') | ||
215 | 20 | get_element(css_class='price', text='$39.99') | ||
216 | 21 | get_element(tag='span', css_class='price', text='$39.99') | ||
217 | 22 | today = date.today() | ||
218 | 23 | next_month = today.replace(month = today.month + 1) | ||
219 | 24 | get_element(tag='p', text='This is a trial subscription which will expire ' \ | ||
220 | 25 | '%(next_month)s afterwhich your card ' \ | ||
221 | 26 | 'will automatically be billed $39.99 annually' | ||
222 | 27 | % {'next_month': next_month.strftime('%B %-d, %Y')}) | ||
223 | 14 | 28 | ||
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 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | 6 | print "try adding a _passwords.py file if you expect this to work ;)" |
229 | 7 | from additional.config import base_url | 7 | from additional.config import base_url |
230 | 8 | 8 | ||
231 | 9 | def assert_storage(quantity): | ||
232 | 10 | """ | ||
233 | 11 | Asert the storage quantity selected and its space and price. | ||
234 | 12 | |||
235 | 13 | Keyword arguments: | ||
236 | 14 | quantity -- The expected storage quantity. | ||
237 | 15 | """ | ||
238 | 16 | text_is('qty', str(quantity)) | ||
239 | 17 | text_is('storage-gb', '%sGB' % (quantity * 20)) | ||
240 | 18 | monthly_price = quantity * 2.99 | ||
241 | 19 | text_is('storage-monthly-price', '$%s' % monthly_price) | ||
242 | 20 | annual_price = quantity * 29.99 | ||
243 | 21 | text_is('storage-annual-price', '$%s' % annual_price) | ||
244 | 22 | |||
245 | 23 | |||
246 | 9 | set_base_url(base_url) | 24 | set_base_url(base_url) |
247 | 10 | login(username, password) | 25 | login(username, password) |
248 | 11 | title_is(u'Ubuntu One : Dashboard') | 26 | title_is(u'Ubuntu One : Dashboard') |
249 | 12 | goto('/services/') | 27 | goto('/services/') |
250 | 13 | title_is(u'Ubuntu One : Services') | 28 | title_is(u'Ubuntu One : Services') |
251 | 29 | assert_storage(1) | ||
252 | 30 | button_click('plus_qty') | ||
253 | 31 | assert_storage(2) | ||
254 | 32 | button_click('minus_qty') | ||
255 | 33 | for quantity in range(2, 11): | ||
256 | 34 | button_click('plus_qty') | ||
257 | 35 | assert_storage(quantity) | ||
258 | 36 | for quantity in range(9, 4, -1): | ||
259 | 37 | button_click('minus_qty') | ||
260 | 38 | assert_storage(quantity) | ||
261 | 39 | textfield_write('qty', '25') | ||
262 | 40 | # Move the focus out of the textfield. | ||
263 | 41 | click('storage-gb') | ||
264 | 42 | assert_storage(25) | ||
265 | 14 | 43 | ||
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 | 4 | from _passwords import username, password | 4 | from _passwords import username, password |
271 | 5 | except: | 5 | except: |
272 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | 6 | print "try adding a _passwords.py file if you expect this to work ;)" |
274 | 7 | from additional.config import base_url | 7 | from additional.config import base_url |
275 | 8 | from datetime import date | ||
276 | 8 | 9 | ||
277 | 9 | set_base_url(base_url) | 10 | set_base_url(base_url) |
278 | 10 | login(username, password) | 11 | login(username, password) |
279 | 11 | title_is(u'Ubuntu One : Dashboard') | 12 | title_is(u'Ubuntu One : Dashboard') |
280 | 12 | goto('/services/') | 13 | goto('/services/') |
281 | 13 | title_is(u'Ubuntu One : Services') | 14 | title_is(u'Ubuntu One : Services') |
282 | 15 | textfield_write('qty', '5') | ||
283 | 16 | radio_select('st1') | ||
284 | 17 | button_click(get_elements(css_class='buy-now', | ||
285 | 18 | text='Buy now and go to checkout')[1]) | ||
286 | 19 | title_is(u'Ubuntu One : Checkout') | ||
287 | 20 | get_element(tag='h1', text='Subscription Change') | ||
288 | 21 | get_element(tag='p', text='5 x 20-Pack with 20 GB (monthly)') | ||
289 | 22 | get_element(tag='strong', text='Monthly') | ||
290 | 23 | get_element(css_class='price', text='$2.99') | ||
291 | 24 | get_element(tag='span', css_class='price', text='$14.95') | ||
292 | 25 | today = date.today() | ||
293 | 26 | next_month = today.replace(month = today.month + 1) | ||
294 | 27 | get_element(tag='p', text='This payment will cover the period from ' \ | ||
295 | 28 | '%(today)s to %(next_month)s afterwhich your card ' \ | ||
296 | 29 | 'will automatically be billed $14.95 monthly' | ||
297 | 30 | % {'today': today.strftime('%B %-d, %Y'), | ||
298 | 31 | 'next_month': next_month.strftime('%B %-d, %Y')}) | ||
299 | 14 | 32 | ||
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 | 5 | except: | 5 | except: |
305 | 6 | print "try adding a _passwords.py file if you expect this to work ;)" | 6 | print "try adding a _passwords.py file if you expect this to work ;)" |
306 | 7 | from additional.config import base_url | 7 | from additional.config import base_url |
307 | 8 | from datetime import date | ||
308 | 8 | 9 | ||
309 | 9 | set_base_url(base_url) | 10 | set_base_url(base_url) |
310 | 10 | login(username, password) | 11 | login(username, password) |
311 | 11 | title_is(u'Ubuntu One : Dashboard') | 12 | title_is(u'Ubuntu One : Dashboard') |
312 | 12 | goto('/services/') | 13 | goto('/services/') |
313 | 13 | title_is(u'Ubuntu One : Services') | 14 | title_is(u'Ubuntu One : Services') |
314 | 15 | |||
315 | 16 | textfield_write('qty', '5') | ||
316 | 17 | radio_select('st2') | ||
317 | 18 | button_click(get_elements(css_class='buy-now', | ||
318 | 19 | text='Buy now and go to checkout')[1]) | ||
319 | 20 | title_is(u'Ubuntu One : Checkout') | ||
320 | 21 | get_element(tag='h1', text='Subscription Change') | ||
321 | 22 | get_element(tag='p', text='5 x 20-Pack with 20 GB (yearly)') | ||
322 | 23 | get_element(tag='strong', text='Yearly') | ||
323 | 24 | get_element(css_class='price', text='$29.99') | ||
324 | 25 | get_element(tag='span', css_class='price', text='$149.95') | ||
325 | 26 | today = date.today() | ||
326 | 27 | next_year = today.replace(year = today.year + 1, day = today.day + 1) | ||
327 | 28 | get_element(tag='p', text='This payment will cover the period from ' \ | ||
328 | 29 | '%(today)s to %(next_year)s afterwhich your card ' \ | ||
329 | 30 | 'will automatically be billed $149.95 annually' \ | ||
330 | 31 | % {'today': today.strftime('%B %-d, %Y'), | ||
331 | 32 | 'next_year': next_year.strftime('%B %-d, %Y')}) |