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

Proposed by Leo Arias
Status: Merged
Approved by: Rick McBride
Approved revision: 59
Merged at revision: 58
Proposed branch: lp:~elopio/ubuntuone-testing/environments
Merge into: lp:ubuntuone-testing
Diff against target: 143 lines (+32/-5)
7 files modified
.bzrignore (+1/-0)
ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py (+3/-0)
ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py (+3/-0)
ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py (+3/-0)
ubuntuone/web/tests/sst/shared/actions/setup.py (+13/-2)
ubuntuone/web/tests/sst/shared/actions/sso.py (+2/-2)
ubuntuone/web/tests/sst/shared/config.py (+7/-1)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/environments
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+83244@code.launchpad.net

Commit message

Improved the environment handling.

Description of the change

With this changes, we do a better handling of the environment and we will have the chance to run tests on different environments, and filter tests by environment.

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

Excellent idea, and well done.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-10-06 19:43:51 +0000
+++ .bzrignore 2011-11-24 05:08:24 +0000
@@ -9,5 +9,6 @@
9passwords.py9passwords.py
10reports/*10reports/*
11_passwords.py11_passwords.py
12_localconfig.py
12sourcecode13sourcecode
13results14results
1415
=== modified file 'ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py'
--- ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2011-09-22 06:27:21 +0000
+++ ubuntuone/web/tests/sst/payments/u1webp001_paymusicstreaming.py 2011-11-24 05:08:24 +0000
@@ -21,12 +21,15 @@
21"""Pay for the music streaming service."""21"""Pay for the music streaming service."""
2222
23from sst.actions import *23from sst.actions import *
24from config import ENVIRONMENT
24from datetime import date25from datetime import date
25import actions.setup as setup_actions26import actions.setup as setup_actions
26import actions.services as services_actions27import actions.services as services_actions
27import actions.payment as payment_actions28import actions.payment as payment_actions
28import actions.payment_confirmed as payment_confirmed_actions29import actions.payment_confirmed as payment_confirmed_actions
2930
31if ENVIRONMENT == 'production':
32 skip('Can\'t test payments on production.')
30setup_actions.setup(new_user=True)33setup_actions.setup(new_user=True)
31services_actions.open()34services_actions.open()
32services_actions.buy_music_streaming_yearly()35services_actions.buy_music_streaming_yearly()
3336
=== modified file 'ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py'
--- ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2011-09-22 06:27:21 +0000
+++ ubuntuone/web/tests/sst/payments/u1webp002_payadditionalstorage.py 2011-11-24 05:08:24 +0000
@@ -21,11 +21,14 @@
21"""Pay for the additional sotrage service."""21"""Pay for the additional sotrage service."""
2222
23from sst.actions import *23from sst.actions import *
24from config import ENVIRONMENT
24import actions.setup as setup_actions25import actions.setup as setup_actions
25import actions.services as services_actions26import actions.services as services_actions
26import actions.payment as payment_actions27import actions.payment as payment_actions
27import actions.payment_confirmed as payment_confirmed_actions28import actions.payment_confirmed as payment_confirmed_actions
2829
30if ENVIRONMENT == 'production':
31 skip('Can\'t test payments on production.')
29setup_actions.setup(new_user=True)32setup_actions.setup(new_user=True)
30services_actions.open()33services_actions.open()
31services_actions.buy_extra_storage()34services_actions.buy_extra_storage()
3235
=== modified file 'ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py'
--- ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2011-09-22 06:27:21 +0000
+++ ubuntuone/web/tests/sst/payments/u1webp003_paywithrefusedcard.py 2011-11-24 05:08:24 +0000
@@ -21,11 +21,14 @@
21"""Pay for a service with a refused card."""21"""Pay for a service with a refused card."""
2222
23from sst.actions import *23from sst.actions import *
24from config import ENVIRONMENT
24import actions.setup as setup_actions25import actions.setup as setup_actions
25import actions.services as services_actions26import actions.services as services_actions
26import actions.payment as payment_actions27import actions.payment as payment_actions
27import actions.payment_confirmed as payment_confirmed_actions28import actions.payment_confirmed as payment_confirmed_actions
2829
30if ENVIRONMENT == 'production':
31 skip('Can\'t test payments on production.')
29setup_actions.setup()32setup_actions.setup()
30services_actions.open()33services_actions.open()
31services_actions.buy_music_streaming()34services_actions.buy_music_streaming()
3235
=== modified file 'ubuntuone/web/tests/sst/shared/actions/setup.py'
--- ubuntuone/web/tests/sst/shared/actions/setup.py 2011-11-15 06:38:57 +0000
+++ ubuntuone/web/tests/sst/shared/actions/setup.py 2011-11-24 05:08:24 +0000
@@ -30,7 +30,6 @@
30import actions.header as header_actions30import actions.header as header_actions
31import actions.sso as sso_actions31import actions.sso as sso_actions
3232
33
34def setup(new_user=False):33def setup(new_user=False):
35 """Create new user (optional) and log in to the Ubuntu One website.34 """Create new user (optional) and log in to the Ubuntu One website.
3635
@@ -41,7 +40,7 @@
41 new_user -- Indicates if a new user has to be created for the test.40 new_user -- Indicates if a new user has to be created for the test.
4241
43 """42 """
44 set_base_url(base_url)43 set_base_url(get_base_url())
45 set_wait_timeout(DEFAULT_TIMEOUT)44 set_wait_timeout(DEFAULT_TIMEOUT)
46 goto()45 goto()
47 waitfor(title_is, 'Ubuntu One : Home')46 waitfor(title_is, 'Ubuntu One : Home')
@@ -51,3 +50,15 @@
51 else:50 else:
52 sso_actions.login(email, password)51 sso_actions.login(email, password)
53 header_actions.assert_login(full_name)52 header_actions.assert_login(full_name)
53
54def get_base_url():
55 base_url = None
56 if ENVIRONMENT == 'staging':
57 base_url = 'https://staging.one.ubuntu.com'
58 elif ENVIRONMENT == 'edge':
59 base_url = 'https://edge.one.ubuntu.com'
60 elif ENVIRONMENT == 'production':
61 base_url = 'https://one.ubuntu.com'
62 else:
63 skip('Unknown environment: %s.' % ENVIRONMENT)
64 return base_url
5465
=== modified file 'ubuntuone/web/tests/sst/shared/actions/sso.py'
--- ubuntuone/web/tests/sst/shared/actions/sso.py 2011-11-15 06:38:57 +0000
+++ ubuntuone/web/tests/sst/shared/actions/sso.py 2011-11-24 05:08:24 +0000
@@ -21,7 +21,7 @@
21"""Single Sign On actions for Ubuntu One."""21"""Single Sign On actions for Ubuntu One."""
2222
23from sst.actions import *23from sst.actions import *
24from config import base_url24from setup import get_base_url
2525
26def login(email, password):26def login(email, password):
27 """Log in to Ubuntu One website.27 """Log in to Ubuntu One website.
@@ -38,7 +38,7 @@
38 textfield_write('id_email', email)38 textfield_write('id_email', email)
39 textfield_write('id_password', password)39 textfield_write('id_password', password)
40 button_click(get_element(css_class='btn', name='continue'), wait=False)40 button_click(get_element(css_class='btn', name='continue'), wait=False)
41 waitfor(title_is, 'Authenticate to %s' % base_url)41 waitfor(title_is, 'Authenticate to %s' % get_base_url())
42 waitfor(get_element, tag='body')42 waitfor(get_element, tag='body')
43 button_click(get_element(css_class='btn', name='yes'))43 button_click(get_element(css_class='btn', name='yes'))
4444
4545
=== modified file 'ubuntuone/web/tests/sst/shared/config.py'
--- ubuntuone/web/tests/sst/shared/config.py 2011-11-03 17:56:44 +0000
+++ ubuntuone/web/tests/sst/shared/config.py 2011-11-24 05:08:24 +0000
@@ -19,4 +19,10 @@
19DEFAULT_TIMEOUT = 4019DEFAULT_TIMEOUT = 40
2020
21# set below according to need (staging v production v test instance)21# set below according to need (staging v production v test instance)
22base_url = 'https://staging.one.ubuntu.com/'22ENVIRONMENT = 'staging'
23#ENVIRONMENT = 'edge'
24#ENVIRONMENT = 'production'
25
26# You can overwrite the default configuration setting the variables on
27# the file shared/_local_config.py.
28from _localconfig import *

Subscribers

People subscribed via source and target branches