Merge lp:~elopio/u1-test-utils/fix-site_not_recognized into lp:u1-test-utils

Proposed by Leo Arias
Status: Merged
Approved by: Natalia Bidart
Approved revision: 24
Merged at revision: 22
Proposed branch: lp:~elopio/u1-test-utils/fix-site_not_recognized
Merge into: lp:u1-test-utils
Diff against target: 51 lines (+19/-5)
1 file modified
u1testutils/sst/sso/pages.py (+19/-5)
To merge this branch: bzr merge lp:~elopio/u1-test-utils/fix-site_not_recognized
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+145422@code.launchpad.net

Commit message

Fixed the page open verification for site not recognized, a typo and the __init__ order.

Description of the change

Fixed the page open verification for site not recognized.

To post a comment you must log in.
23. By Leo Arias

Fixed a typo.

24. By Leo Arias

Inverted the order of the calls to set the right title before it is asserted.

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

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1testutils/sst/sso/pages.py'
2--- u1testutils/sst/sso/pages.py 2013-01-24 17:07:25 +0000
3+++ u1testutils/sst/sso/pages.py 2013-01-29 17:09:20 +0000
4@@ -186,7 +186,7 @@
5 return SiteNotRecognized()
6
7 def _confirm_email(self, confirmation_code):
8- self._enter_confirmaiton_code(confirmation_code)
9+ self._enter_confirmation_code(confirmation_code)
10 self._click_continue_button()
11
12 def _enter_confirmation_code(self, confirmation_code):
13@@ -204,13 +204,27 @@
14 class SiteNotRecognized(Page):
15 """Site not Recognized page of the Ubuntu Single Sign On website.
16
17- This is a subclass of the Page object. It adds methods for the actions
18- available in this page.
19+ This is a subclass of the Page object. It overrides the assert_page_is_open
20+ method to check only the first part of the title, and adds methods for the
21+ actions available in this page.
22
23 Instance variables:
24- title -- The title of the page.
25+ title -- The regular expression of the title of the page.
26
27 """
28+
29+ title = 'Authenticate to .+'
30+
31+ def assert_page_is_open(self):
32+ """Assert that the page is open.
33+
34+ We use a regular expression because the title has the URL of the site
35+ that requested the log in plus some tokens, and we don't need to check
36+ that.
37+
38+ """
39+ sst.actions.assert_title_contains(self.title, regex=True)
40+
41 def make_all_information_available_to_website(self):
42 """Select all the user available information.
43
44@@ -252,8 +266,8 @@
45 title = "{0}'s details"
46
47 def __init__(self, user_name):
48+ self.title = self.title.format(user_name)
49 super(YourAccount, self).__init__()
50- self.title = self.title.format(user_name)
51 self.sub_header = _UserSubHeader()
52
53

Subscribers

People subscribed via source and target branches

to all changes: