Merge lp:~matiasb/canonical-identity-provider/adding-2fa-acceptance-tests into lp:canonical-identity-provider/release

Proposed by Matias Bordese
Status: Merged
Approved by: Natalia Bidart
Approved revision: no longer in the source branch.
Merged at revision: 529
Proposed branch: lp:~matiasb/canonical-identity-provider/adding-2fa-acceptance-tests
Merge into: lp:canonical-identity-provider/release
Diff against target: 91 lines (+74/-0)
3 files modified
identityprovider/tests/acceptance/shared/actions/subheader.py (+47/-0)
identityprovider/tests/acceptance/shared/actions/two_factor.py (+5/-0)
identityprovider/tests/acceptance/two_factor/check_username_display.py (+22/-0)
To merge this branch: bzr merge lp:~matiasb/canonical-identity-provider/adding-2fa-acceptance-tests
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Leo Arias (community) code review Approve
Review via email: mp+132619@code.launchpad.net

Commit message

Added acceptance tests for two factor page.

Description of the change

Added acceptance tests for two factor page (username display, logout option).
Started work on acceptance actions framework/refactoring.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

we are trying to get rid of this:
59 +from sst.actions import *
so you can either import sst.actions and then call sst.actions.go_to
or from sst.actions import go_to.

thank you.

review: Approve (code review)
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

It looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'identityprovider/tests/acceptance/shared/actions'
=== added file 'identityprovider/tests/acceptance/shared/actions/__init__.py'
=== added file 'identityprovider/tests/acceptance/shared/actions/subheader.py'
--- identityprovider/tests/acceptance/shared/actions/subheader.py 1970-01-01 00:00:00 +0000
+++ identityprovider/tests/acceptance/shared/actions/subheader.py 2012-11-01 21:04:21 +0000
@@ -0,0 +1,47 @@
1import sst.actions
2
3
4def _assert_full_name_in_account_link(full_name):
5 sst.actions.assert_text(_get_my_account_link(), full_name[:40])
6
7
8def _get_my_account_link():
9 return sst.actions.get_element(id='account-link')
10
11
12def _get_devices_link():
13 return sst.actions.get_element(id='devices-link')
14
15
16def _get_applications_link():
17 return sst.actions.get_element(id='applications-link')
18
19
20def _get_log_out_link():
21 return sst.actions.get_element(id='logout-link')
22
23
24def assert_log_in(full_name):
25 _assert_full_name_in_account_link(full_name)
26 _get_log_out_link()
27
28
29def assert_log_out():
30 sst.actions.fails(_get_my_account_link)
31 sst.actions.fails(_get_log_out_link)
32
33
34def go_to_account():
35 sst.actions.click_link(_get_my_account_link())
36
37
38def go_to_devices():
39 sst.actions.click_link(_get_devices_link())
40
41
42def go_to_applications():
43 sst.actions.click_link(_get_applications_link())
44
45
46def log_out():
47 sst.actions.click_link(_get_log_out_link())
048
=== added file 'identityprovider/tests/acceptance/shared/actions/two_factor.py'
--- identityprovider/tests/acceptance/shared/actions/two_factor.py 1970-01-01 00:00:00 +0000
+++ identityprovider/tests/acceptance/shared/actions/two_factor.py 2012-11-01 21:04:21 +0000
@@ -0,0 +1,5 @@
1import sst.actions
2
3
4def open_page():
5 sst.actions.go_to('/two_factor_auth')
06
=== added directory 'identityprovider/tests/acceptance/two_factor'
=== added file 'identityprovider/tests/acceptance/two_factor/check_username_display.py'
--- identityprovider/tests/acceptance/two_factor/check_username_display.py 1970-01-01 00:00:00 +0000
+++ identityprovider/tests/acceptance/two_factor/check_username_display.py 2012-11-01 21:04:21 +0000
@@ -0,0 +1,22 @@
1# Check two factor page displays the username, account and logout options.
2
3from u1testutils.sst import config
4
5import helpers
6
7from actions import (
8 subheader,
9 two_factor,
10)
11
12
13config.set_base_url_from_env()
14
15display_name = "Fred Jones"
16# Create an account and login.
17helpers.register_account(displayname=display_name)
18
19# Go to two factor auth page
20two_factor.open_page()
21# check subheader navbar displays user info
22subheader.assert_log_in(display_name)