def test_add_email(self, base_url, selenium, timeout, verified_user, new_email): bidpom = BIDPOM(selenium, timeout) bidpom.sign_in(verified_user['email'], verified_user['password']) WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed()) self.log_out(selenium, timeout) selenium.find_element(*self._persona_login_button_locator).click() from bidpom.pages.sign_in import SignIn signin = SignIn(selenium, timeout) signin.click_add_another_email_address() signin.new_email = new_email assert signin.new_email == new_email, 'new email getter failed' signin.click_add_new_email() signin.close_window() signin.switch_to_main_window() mail = restmail.get_mail(new_email) # Check that the email appears to be valid self.email_appears_valid(mail[0]['text']) selenium.get(re.search(BIDPOM.CONFIRM_URL_REGEX, mail[0]['text']).group(0)) from bidpom.pages.complete_registration import CompleteRegistration complete_registration = CompleteRegistration(selenium, timeout) assert new_email in complete_registration.user_loggedin selenium.get(base_url) self.log_out(selenium, timeout) selenium.find_element(*self._persona_login_button_locator).click() signin = SignIn(selenium, timeout) assert new_email in signin.emails assert new_email == signin.selected_email
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()
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)
def test_sign_in_helper_with_returning_user_immediately(self, selenium, timeout, verified_user): bidpom = BIDPOM(selenium, timeout) bidpom.sign_in(verified_user['email'], verified_user['password']) WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed()) self.log_out(selenium, timeout) selenium.find_element(*self._persona_login_button_locator).click() bidpom.sign_in() WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed())
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)
def test_sign_in_is_this_your_computer_immediately(self, selenium, timeout, verified_user): bidpom = BIDPOM(selenium, timeout) bidpom.sign_in(verified_user['email'], verified_user['password']) WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed()) self.log_out(selenium, timeout) selenium.find_element(*self._persona_login_button_locator).click() from bidpom.pages.sign_in import SignIn signin = SignIn(selenium, timeout) signin.click_sign_in_returning_user() WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed())
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.find_element(*self._browserid_login_locator).click() from bidpom import BIDPOM pop_up = BIDPOM(self.selenium, self.timeout) pop_up.sign_in(email, password) self.wait.until(lambda s: self.is_logged_in, message='Could not log in within %s seconds.' % self.timeout)
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)
def login(self, email, password): self.click_login() browser_id = BIDPOM(self.selenium, self.timeout) browser_id.sign_in(email, password) self.wait.until(EC.visibility_of_element_located(self._logout_icon_locator))
def test_sign_in_helper(self, selenium, timeout, verified_user): bidpom = BIDPOM(selenium, timeout) bidpom.sign_in(verified_user['email'], verified_user['password']) WebDriverWait(selenium, timeout).until(lambda s: s.find_element( *self._persona_logged_in_indicator_locator).is_displayed())