def get_ready_condition(self): return ec_in_frame( "mainFrame", ec_and( EC.presence_of_element_located(self.MeterProfilesLink), EC.element_to_be_clickable(self.IntervalDownloadLink), ), )
def get_ready_condition(self): return ec_in_frame( "mainFrame", ec_and( EC.presence_of_element_located(self.HeaderLocator), EC.presence_of_element_located(self.BillTableLocator), ), )
def get_ready_condition(self): return ec_in_frame( "mainFrame", ec_and( EC.presence_of_element_located(self.ProfileTableLocator), EC.presence_of_element_located(self.HeaderLocator), EC.element_to_be_clickable(self.ReportPageLink), ), )
def get_ready_condition(self): return ec_in_frame( "mainFrame", ec_and( EC.presence_of_element_located(self.HeaderLocator), EC.presence_of_element_located(self.NextButtonLocator), EC.presence_of_element_located(self.MeterSelectLocator), EC.presence_of_element_located(self.TimeButtonSelector), ), )
def get_ready_condition(self): log.info("interval download page ready condition") return ec_in_frame( "mainFrame", ec_and( EC.presence_of_element_located(self.HeaderLocator), EC.presence_of_element_located(self.StartDateLocator), EC.presence_of_element_located(self.StopDateLocator), EC.element_to_be_clickable(self.FifteenMinuteOptionLocator), EC.element_to_be_clickable(self.DemandDatatypeLocator), EC.presence_of_element_located(self.MeterSelectLocator), ), )
def select_account(self, account_id: str): """Select account from dropdown. self.account_id does not have dashes (805555003) but option does (805-555-003) In case account_id is in wrong format, strip for digits, and re-format """ account_id = "".join(c for c in account_id if c.isdigit()) account_id = "{}-{}-{}".format(account_id[:3], account_id[3:6], account_id[6:9]) WebDriverWait(self.driver, 10).until( EC.presence_of_element_located(self.AccountDropdownButtonLocator)) account_dropdown_button = self.driver.find_element( *self.AccountDropdownButtonLocator) account_dropdown_button.click() WebDriverWait(self.driver, 10).until( ec_and( EC.presence_of_element_located(self.AccountOptionLocator), EC.presence_of_element_located( self.AccountActiveOptionLocator), )) account_options = self.driver.find_elements(*self.AccountOptionLocator) account_options.append( self.driver.find_element(*self.AccountActiveOptionLocator)) found = False try: for option in account_options: log.debug("account_id=%s option=%s", account_id, option.text) if account_id in option.text: log.debug("clicking %s", option.text) option.click() found = True time.sleep(5) break except StaleElementReferenceException: pass if not found: raise saltriver_errors.MeterNotFoundError.for_account(account_id) WebDriverWait(self.driver, 10).until( EC.presence_of_element_located(self.MyBillButtonLocator)) my_bill_button = self.driver.find_element(*self.MyBillButtonLocator) self.driver.execute_script("arguments[0].click()", my_bill_button)
def get_ready_condition(self): return ec_and( EC.title_contains("Sign In to Your Account"), EC.presence_of_element_located(self.LoginErrorLocator), )
def get_ready_condition(self): return ec_and( EC.element_to_be_clickable(self.UsernameInputLocator), EC.element_to_be_clickable(self.PasswordInputLocator), EC.presence_of_element_located(self.SubmitButtonLocator), )
def get_ready_condition(self): return ec_and( EC.presence_of_element_located(self.Bill1Locator), EC.presence_of_element_located(self.Bill2Locator), EC.presence_of_element_located(self.UsageDetailExpanderLocator), )