Ejemplo n.º 1
0
 def login(self, user):
     self.click_login()
     browser_id = BIDPOM(self.selenium, self.timeout)
     browser_id.sign_in(user['email'], user['password'])
     Wait(self.selenium, self.timeout).until(
         EC.visibility_of_element_located(self._logout_menu_item_locator))
     from pages.user.user_profile_edit import UserProfileEditPage
     return UserProfileEditPage(self.selenium,
                                self.base_url).wait_for_page_to_load()
Ejemplo n.º 2
0
 def login(self, email, password):
     from home_page import MozTrapHomePage
     from bidpom import BIDPOM
     self.selenium.find_element(*self._browserid_locator).click()
     browser_id = BIDPOM(self.selenium, timeout=self.timeout)
     browser_id.sign_in(email, password)
     WebDriverWait(
         self.selenium,
         self.timeout).until(lambda s: self.header.is_user_logged_in)
     return MozTrapHomePage(self.base_url, self.selenium)
Ejemplo n.º 3
0
        def login(self, email=None, password=None):
            '''
                Login using persona - if no email is specified a one time set of
                verified persona credentials, email and password, are generated
                and used.
                :param email: verified BrowserID email
                :param password: BrowserID password
            '''
            if email is None:
                credentials = self.get_new_persona_credentials()
                email = credentials['email']
                password = credentials['password']

            self.selenium.find_element(*self._browserid_login_locator).click()

            from bidpom import BIDPOM
            pop_up = BIDPOM(self.selenium, self.timeout)
            pop_up.sign_in(email, password)
            WebDriverWait(self.selenium, self.timeout).until(
                lambda s: self.is_logged_in,
                message='Could not log in within %s seconds.' % self.timeout)