def enter(self, address): """ Enter the login page For web platform, this means loading the login page URL For mobile platforms, this means selecting the login option on the main activity """ entry_button = BaseElement(self.driver, locators.LOGIN_ENTRY_BUTTON) entry_button.wait_until_displayed() entry_button.click()
def get_pwif_amount(self): """ Return users current PWIF amount """ BaseElement(self.driver, locators.FEE_SETTINGS_TAB).click() fee_amount_text = BaseElement(self.driver, locators.FEE_AMOUNT) fee_amount_text.wait_until_displayed() pwif_amount = utils.decimal_from_string(fee_amount_text.get_text()) return pwif_amount
def wait_until_debit_card_tracker_displayed(self): """ Wait until the Debit Card Tracker is displayed """ self.wait_until_dashboard_displayed() tracker = BaseElement(self.driver, locators.DEBIT_CARD_TRACKER) # Sometimes the tracker doesn't display right away, added a refresh to cover this case if tracker.not_displayed(): self.driver.refresh() tracker.wait_until_displayed()
def prepare_transfer(self, transfer_amount, from_account, to_account): """ Prepare a funds transfer with the specified details and advance to the scheduling step """ BaseElement(self.driver, locators.TRANSFER_MONEY_BUTTON).click() from_account_dropdown = BaseElement(self.driver, locators.FROM_ACCOUNT_DROP_DOWN) to_account_dropdown = BaseElement(self.driver, locators.TO_ACCOUNT_DROP_DOWN) from_account_dropdown.wait_until_displayed() to_account_dropdown.wait_until_displayed() from_account_dropdown.select_dropdown_value(from_account) to_account_dropdown.select_dropdown_value(to_account) TextElement(self.driver, locators.AMOUNT_INPUT).set_text(str(transfer_amount))
def get_modal_summary_details(self): """ get summary details from receipt modal """ bank = BaseElement(self.driver, locators.INVESTMENT_ORDER_RECEIPT_MODAL_DESCRIPTION) bank.wait_until_displayed() modal_details = { "bank": bank.get_text(), "amount": BaseElement( self.driver, locators.INVESTMENT_ORDER_RECEIPT_MODAL_AMOUNT).get_text() } return modal_details
def return_to_dashboard(self): """ Navigate back to the customer dashboard """ location = BaseElement(self.driver, locators.LOCATION_TEXT) # Begin navigation if we are not already at the dashboard if location.get_text() != 'Account Summary': drawer_button = BaseElement(self.driver, locators.DRAWER_BUTTON) if drawer_button.not_displayed(): # If the drawer button isn't displayed, then we need to click the back-button to make it appear back_button = BaseElement(self.driver, locators.NAVIGATE_UP_BUTTON) if back_button.displayed(5): back_button.click() drawer_button.click() BaseElement(self.driver, locators.SUMMARY_BUTTON).click() location.wait_until_displayed()