Permalink
Browse files

Added test_that_user_can_login_using_browserid.

  • Loading branch information...
1 parent 8cfcfb2 commit 743f468a6f1c50b4da720787a3743cac3f05bc88 @jgerigmeyer committed Mar 30, 2012
Showing with 40 additions and 1 deletion.
  1. +1 −0 credentials.yaml
  2. +18 −1 login_page.py
  3. +21 −0 test_homepage.py
View
@@ -33,5 +33,6 @@
default:
username: <value>
+ email: <value>
password: <value>
name: <value>
View
@@ -9,10 +9,11 @@
class CaseConductorLoginPage(CaseConductorBasePage):
- _page_title = 'Mozilla Case Conductor'
+ _page_title = 'Login | Mozilla Case Conductor'
_username_locator = 'id=id_username'
_password_locator = 'id=id_password'
+ _browserid_locator = 'id=browserid'
_submit_locator = 'css=#loginform .form-actions > button'
_register_locator = 'css=#loginform .form-actions > a'
@@ -26,6 +27,22 @@ def login(self, user='default'):
from home_page import CaseConductorHomePage
return CaseConductorHomePage(self.testsetup)
+ def login_using_browserid(self, user='default'):
+ from browserid import BrowserID
+ from home_page import CaseConductorHomePage
+
+ if type(user) is str:
+ user = self.testsetup.credentials[user]
+
+ browser_id = BrowserID(self.selenium)
+
+ self.click(self._browserid_locator)
+ self.selenium.wait_for_pop_up(windowID='null', timeout=self.timeout)
+ browser_id.sign_in(user['email'], user['password'])
+ self.selenium.wait_for_page_to_load(timeout=self.timeout)
+
+ return CaseConductorHomePage(self.testsetup)
+
@property
def is_register_visible(self):
return self.is_element_visible(self._register_locator)
View
@@ -27,6 +27,27 @@ def test_that_user_can_login_and_logout(self, mozwebqa_logged_in):
Assert.true(login_page.is_register_visible)
Assert.true(login_page.is_signin_visible)
+ def test_that_user_can_login_using_browserid(self, mozwebqa):
+ from login_page import CaseConductorLoginPage
+ login_pg = CaseConductorLoginPage(mozwebqa)
+ home_pg = CaseConductorHomePage(mozwebqa)
+
+ mozwebqa.selenium.open('/')
+
+ Assert.false(home_pg.is_user_logged_in)
+ Assert.true(login_pg.is_register_visible)
+ Assert.true(login_pg.is_signin_visible)
+
+ login_pg.login_using_browserid()
+
+ user = home_pg.testsetup.credentials['default']
+ users_name_text = user['name']
+
+ Assert.true(home_pg.is_user_logged_in)
+ Assert.equal(home_pg.users_name_text, users_name_text)
+
+ home_pg.logout()
+
def test_that_user_can_select_product(self, mozwebqa_logged_in):
home_pg = CaseConductorHomePage(mozwebqa_logged_in)

0 comments on commit 743f468

Please sign in to comment.