Exemplo n.º 1
0
    def test_reset_password(self, selenium, timeout, new_user):
        # sign in as a new user
        from bidpom.pages.sign_in import SignIn
        signin = SignIn(selenium, timeout)
        signin.sign_in_new_user(new_user['email'], new_user['password'])
        mail = restmail.get_mail(new_user['email'])
        selenium.get(re.search(BIDPOM.VERIFY_URL_REGEX, mail[0]['text']).group(0))
        from bidpom.pages.complete_registration import CompleteRegistration
        complete_registration = CompleteRegistration(selenium, timeout)
        assert new_user['email'] in complete_registration.user_loggedin
        self.log_out(selenium, timeout)

        # forgot password
        selenium.find_element(*self._persona_login_button_locator).click()
        from bidpom.pages.sign_in import SignIn
        signin = SignIn(selenium, timeout)
        signin.click_this_is_not_me()
        signin.email = new_user['email']
        signin.click_next()
        signin.click_forgot_password()
        signin.switch_to_main_window()
        mail = restmail.get_mail(new_user['email'], message_count=2)
        assert 'Click to reset your password' in mail[1]['text']

        # reset password
        new_user['password'] = '******'.format(new_user)
        selenium.get(re.search(BIDPOM.RESET_URL_REGEX, mail[1]['text']).group(0))
        from bidpom.pages.reset_password import ResetPassword
        reset_password = ResetPassword(selenium, timeout).wait_for_page_to_load()
        reset_password.new_password = new_user['password']
        reset_password.verify_password = new_user['password']
        reset_password.click_finish()
        assert '{0[email]} has been verified!'.format(new_user) in reset_password.thank_you
Exemplo n.º 2
0
 def test_sign_in(self, selenium, timeout, verified_user):
     from bidpom.pages.sign_in import SignIn
     signin = SignIn(selenium, timeout)
     signin.email = verified_user['email']
     assert signin.email == verified_user['email']
     signin.click_next(expect='password')
     signin.login_password = verified_user['password']
     assert signin.login_password == verified_user['password']
     signin.click_sign_in()
     WebDriverWait(selenium, timeout).until(lambda s: s.find_element(
         *self._persona_logged_in_indicator_locator).is_displayed())
Exemplo n.º 3
0
    def test_sign_in_new_user(self, new_user, selenium, timeout):
        from bidpom.pages.sign_in import SignIn
        signin = SignIn(selenium, timeout)
        signin.email = new_user['email']
        signin.click_next(expect='verify')
        signin.register_password = new_user['password']
        signin.verify_password = new_user['password']
        assert signin.verify_password == new_user['password'], 'verify password getter failed'
        signin.click_verify_email()
        assert signin.check_email_at_address == new_user['email']

        signin.close_window()
        signin.switch_to_main_window()
        mail = restmail.get_mail(new_user['email'])

        # Check that the email appears to be valid
        self.email_appears_valid(mail[0]['text'])