Esempio n. 1
0
    def hit_login_button(self):
        """
		1. Click on Log In button
		2. Wait until URL changes
		3. Returns OverviewPageModel object on success
		4. Return TimeOut exception on failure
		:return:
		"""
        element = Element(self.driver, self.explicit_wait_time,
                          BasePageLocator.CUSTOMER_LOGIN_BUTTON)
        current_url = self.url()
        element.click_on()
        WebDriverWait(self.driver, self.explicit_wait_time).until(
            EC.url_changes(current_url))

        if self.url(
        ) == self.config.base_url + AccountsOverviewPageContent.URL:
            from page_object_models.accounts_overview_page_model import AccountsOverviewPageModel
            return AccountsOverviewPageModel(config=self.config,
                                             driver=self.driver,
                                             implicit_wait_time=5,
                                             explicit_wait_time=10)

        if self.url() == self.config.base_url + LoginPageContent.URL:
            from page_object_models.login_page_model import LoginPageModel
            return LoginPageModel(config=self.config,
                                  driver=self.driver,
                                  implicit_wait_time=5,
                                  explicit_wait_time=10)

        raise Exception("Unknown URL: {} > Flow is not implemented".format(
            self.driver.current_url))
Esempio n. 2
0
    def hit_log_out_button(self):
        '''
		1. Click on "Log Out"
		2. Wait until URL changes
		3. Returns HomePageModel on success
		4. Return TimeoutException on failure

		An expectation for checking the current url.
        url is the expected url, which must not be an exact match
        returns True if the url is different, false otherwise.

        Source: https://seleniumhq.github.io/selenium/docs/api/py/_modules/selenium/webdriver/support/expected_conditions.html#url_changes
		:return:
		'''

        current_url = self.driver.current_url
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.LOG_OUT)
        element.click_on()
        WebDriverWait(self.driver, self.explicit_wait_time).until(
            EC.url_changes(current_url))
        from page_object_models.home_page_model import HomePageModel
        return HomePageModel(config=self.config,
                             driver=self.driver,
                             implicit_wait_time=5,
                             explicit_wait_time=10)
Esempio n. 3
0
    def open_new_account(self):
        '''
		Click on "Open New Account"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.OPEN_NEW_ACCOUNT)
        element.click_on()
        return None
    def hit_clean_button(self):
        '''
		Hit Clean button
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AdminPageLocator.CLEAN_BUTTON)
        element.click_on()
        return None
Esempio n. 5
0
    def enter_password(self, password):
        '''
		Type password into Password input field
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          BasePageLocator.LOGIN_PASSWORD_INPUT)
        element.write(password)
        return None
Esempio n. 6
0
    def enter_username(self, username):
        '''
		Type username into Username input field
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          BasePageLocator.LOGIN_USERNAME_INPUT)
        element.write(username)
        return None
Esempio n. 7
0
    def request_loan(self):
        '''
		Click on "Request Loan"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.REQUEST_LOAN)
        element.click_on()
        return None
Esempio n. 8
0
    def find_transactions(self):
        '''
		Click on "Find Transactions"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.FIND_TRANSACTIONS)
        element.click_on()
        return None
Esempio n. 9
0
    def update_contact_info(self):
        '''
		Click on "Update Contact Info"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.UPDATE_CONTACT_INFO)
        element.click_on()
        return None
Esempio n. 10
0
    def bill_pay(self):
        '''
		Click on "Bill Pay"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.BILL_PAY)
        element.click_on()
        return None
Esempio n. 11
0
    def transfer_funds(self):
        '''
		Click on "Transfer Funds"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.TRANSFER_FUNDS)
        element.click_on()
        return None
Esempio n. 12
0
    def accounts_overview(self):
        '''
		Click on "Account Overview"
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AccountServicesMenuLocator.ACCOUNTS_OVERVIEW)
        element.click_on()
        return None
    def hit_initialize_button(self):
        '''
		Hit Initialize button
		:return:
		'''
        element = Element(self.driver, self.explicit_wait_time,
                          AdminPageLocator.INITIALIZE_BUTTON)
        element.click_on()
        return None
	def type_confirm(self, password: str):
		'''
		Write text into confirm input field
		:param password:
		:return:
		'''

		element = Element(self.driver, self.explicit_wait_time, RegisterPageLocator.CONFIRM_INPUT)
		element.write(password)
		return None
Esempio n. 15
0
    def click_send_btn(self):
        """
		Click on "FIND MY LOGIN INFO" button
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          ContactPageLocator.SEND_BUTTON)
        element.click_on()
        return None
	def type_username(self, username: str):
		'''
		Write text into username input field
		:param username:
		:return:
		'''

		element = Element(self.driver, self.explicit_wait_time, RegisterPageLocator.USERNAME_INPUT)
		element.write(username)
		return None
	def type_password(self, password: str):
		'''
		Write text into password input field
		:param password:
		:return:
		'''

		element = Element(self.driver, self.explicit_wait_time, RegisterPageLocator.PASSWORD_INPUT)
		element.write(password)
		return None
Esempio n. 18
0
    def type_email(self, value: str):
        """
		Type Email value
		Returns None.
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          ContactPageLocator.EMAIL_INPUT)
        element.write(value)
        return None
Esempio n. 19
0
    def type_message(self, value: str):
        """
		Type Message value
		Returns None.
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          ContactPageLocator.MESSAGE_INPUT)
        element.write(value)
        return None
Esempio n. 20
0
    def type_city(self, city: str):
        """
		Write text into city input field
		:param city:
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.CITY_INPUT)
        element.write(city)
        return None
Esempio n. 21
0
    def type_zip_code(self, zip_code: str):
        '''
		Write text into zip_code input field
		:param zip_code:
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.ZIP_CODE_INPUT)
        element.write(zip_code)
        return None
Esempio n. 22
0
    def type_first_name(self, first_name: str):
        '''
		Write text into first name input field
		:param first_name:
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.FIRST_NAME_INPUT)
        element.write(first_name)
        return None
Esempio n. 23
0
    def type_ssn(self, ssn: str):
        '''
		Write text into ssn input field
		:param ssn:
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.SSN_INPUT)
        element.write(ssn)
        return None
Esempio n. 24
0
    def type_phone(self, phone_number: str):
        '''
		Write text into phone input field
		:param phone_number:
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.PHONE_INPUT)
        element.write(phone_number)
        return None
Esempio n. 25
0
    def type_name(self, value: str):
        """
		Type Name value
		Returns None.
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          ContactPageLocator.NAME_INPUT)
        element.write(value)
        return None
Esempio n. 26
0
    def type_address(self, address: str):
        '''
		Write text into address input field
		:param address:
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.ADDRESS_INPUT)
        element.write(address)
        return None
Esempio n. 27
0
    def type_state(self, state: str):
        """
		Write text into state input field
		:param state:
		:return:
		"""

        element = Element(self.driver, self.explicit_wait_time,
                          BasePersonalInfoPageLocator.STATE_INPUT)
        element.write(state)
        return None
    def hit_send_payment_button(self):
        """
		Click on "Send Payment" button
		Raise NoSuchElementException on failure
		:param:
		:return:
		"""
        element = Element(driver=self.driver,
                          explicit_wait_time=self.explicit_wait_time,
                          locator=BillPayPageLocator.SEND_PAYMENT_BUTTON)
        element.click_on()
        return None
	def hit_register_btn(self):
		'''
		Click on register button
		:return:
		'''

		element = Element(self.driver, self.explicit_wait_time, RegisterPageLocator.REGISTER_BUTTON)
		element.click_on()
		return RegisterPageModel(config=self._config,
		                         driver=self.driver,
		                         implicit_wait_time=5,
		                         explicit_wait_time=10)
    def hit_find_info_btn(self):
        '''
		Click on "FIND MY LOGIN INFO" button
		:return:
		'''

        element = Element(self.driver, self.explicit_wait_time,
                          ForgotLoginInfoPageLocator.FIND_MY_LOGIN_INFO_BUTTON)
        element.click_on()
        return ForgotLoginInfoPageModel(config=self._config,
                                        driver=self.driver,
                                        implicit_wait_time=5,
                                        explicit_wait_time=5)