def wait_until_transaction_page_displayed(self, account): """ Wait until requested transactions page is displayed """ BaseElement(self.driver, locators.AVAILABLE_BALANCE_TEXT).wait_until_displayed() transaction_line_item = BaseElement(self.driver, locators.FIRST_TRANSACTION_LINE_ITEM) transaction_no_activity_message = BaseElement(self.driver, locators.TRANSACTION_NO_ACTIVITY_MESSAGE) if not transaction_line_item.displayed() or not transaction_no_activity_message.displayed(): return None
def cancel_all_scheduled_transfers(self): """ Cancel all scheduled transfers """ self.show_scheduled_transfers() top_scheduled_row = BaseElement(self.driver, locators.FIRST_SCHEDULED_TRANSFER_LINK) while top_scheduled_row.displayed(3): self.open_next_scheduled_transfer() self.cancel_previewed_transfer()
def wait_until_dashboard_displayed(self): """ Wait until the dashboard is displayed """ BaseElement(self.driver, locators.WELCOME_MESSAGE).wait_until_displayed() takeover = BaseElement(self.driver, locators.MARKETING_TAKEOVER_BACKDROP) if takeover.displayed(): BaseElement(self.driver, locators.DISMISS_TAKEOVER_LINK).click() takeover.wait_until_gone()
def get_opening_deposit_amount(self): """ Return the amount of the Opening Deposit transfer""" transfer_amount = BaseElement(self.driver, locators.FIRST_HISTORY_TRANSFER_AMOUNT) if transfer_amount.displayed(5): opening_deposit = utils.decimal_from_string( transfer_amount.get_text()) else: return None return opening_deposit
def get_login_status(self): """ Return the status of Login page """ login_page_displayed = TextElement(self.driver, locators.EMAIL_INPUT).displayed(3) error_message = BaseElement(self.driver, locators.ERROR_MESSAGE) if not login_page_displayed: return LoginStatus.NOT_AT_LOGIN_PAGE elif error_message.displayed(3): return self.get_error_message_status() else: return LoginStatus.NO_MESSAGE_PROMPT
def get_most_recent_transaction_summary(self): """ Return summarized details of most recent transaction, or None if no transactions are displayed Data is returned as a 'Transaction' object """ transaction_description = BaseElement(self.driver, locators.FIRST_TRANSACTION_DESCRIPTION) transaction_amount = BaseElement(self.driver, locators.FIRST_TRANSACTION_AMOUNT) transaction_running_balance = BaseElement(self.driver, locators.FIRST_TRANSACTION_RUNNING_BALANCE) transaction_no_activity = BaseElement(self.driver, locators.TRANSACTION_NO_ACTIVITY_MESSAGE) if transaction_description.displayed(5): transaction_details = \ {'description': transaction_description.get_text(), 'amount': utils.remove_whitespace_from_string(transaction_amount.get_text()), 'balance': transaction_running_balance.get_text()} elif transaction_no_activity.displayed(5): transaction_details = \ {'description': transaction_no_activity.get_text(), 'amount': None, 'balance': None} else: return None return transaction_details
def next_scheduled_transfer_summary(self): """ Return summarized details of next scheduled transfer, or None if no transfer is scheduled """ # QA-329 To-Do : Update logic to handle 'no activity' message date_caption = BaseElement(self.driver, locators.FIRST_SCHEDULED_TRANSFER_DATE) if date_caption.displayed(5): transfer_details = {'date': date_caption.get_text()} else: return None # BANK-1683 todo: a method to identify the to, from, and amount fields # transfer_details['amount'] = utils.decimal_from_string(BaseElement(self.driver, # locators.FIRST_SCHEDULED_TRANSFER_AMOUNT).get_text()) # transfer_details['from'] = # transfer_details['to'] = return transfer_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()