def shopping_cart_num_exist(self): try: driver.find_element_by_xpath(self.shopping_cart_num_xpath) return False except NoSuchElementException: return True
def add_to_cart_from_item(self): el = driver.find_element_by_xpath(self.add_to_cart_button_xpath) el.click()
def remove_from_cart_home_page(self, n): el = driver.find_element_by_xpath('//*[@class="inventory_item"][' + str(n) + ']//button') el.click()
def back_to_home_page(self): el = driver.find_element_by_xpath(self.back_button_xpath) el.click()
def message_user_locked_out_exist(self): return driver.find_element_by_xpath('//*[text()="' + self.user_locked_out_text + '"]') != None
def message_credentials_not_match_exist(self): return driver.find_element_by_xpath('//*[text()="' + self.credentials_not_match_text + '"]') != None
def finish_button_click(self): el = driver.find_element_by_xpath(self.checkout_button_xpath) el.click()
def continue_button_click(self): el = driver.find_element_by_xpath(self.continue_button_xpath) el.click()