示例#1
0
    def click_sign_in_to_register(self, expect='new'):
        self.selenium.find_element(*self._sign_in_locator).click()

        from browserid.pages.sign_in import SignIn
        return SignIn(self.selenium, self.timeout, expect=expect)
        WebDriverWait(self.selenium, self.timeout).until(lambda s:
                                                         self.is_element_visible(self._create_new_profile_button))
示例#2
0
    def click_login_register(self, expect='new'):
        """Click the 'Log in/Register' button.

        Keyword arguments:
        expect -- the expected resulting page
        'new' for user that is not currently signed in (default)
        'returning' for users already signed in or recently verified
        """
        self.selenium.find_element(*self._login_locator).click()
        from browserid.pages.sign_in import SignIn
        return SignIn(self.selenium, self.timeout, expect=expect)
示例#3
0
    def click_sign_in_to_register(self, expect='new'):
        hover_element = self.selenium.find_element(*self._sign_in_with_locator)
        ActionChains(self.selenium).\
            move_to_element(hover_element).\
            perform()
        WebDriverWait(self.selenium, self.timeout).until(
            EC.element_to_be_clickable(self._persona_login_locator))
        self.selenium.find_element(*self._persona_login_locator).click()

        from browserid.pages.sign_in import SignIn
        return SignIn(self.selenium, self.timeout, expect=expect)
示例#4
0
 def login_with_user_from_other_pages(self, user="******"):
     from browserid.pages.sign_in import SignIn
     bid_login = SignIn(self.selenium, self.timeout)
     self.selenium.execute_script('localStorage.clear()')
     credentials = self.testsetup.credentials[user]
     bid_login.sign_in(credentials['email'], credentials['password'])