def upload(self, file_path): elem = BasePage.find_element(self, By.CSS_SELECTOR, 'div.files-container input') get_driver(self).execute_script("arguments[0].className = 'file-input';", elem) get_driver(self).execute_script("arguments[0].style.visibility = 'visible';", elem) elem.send_keys([file_path]) assert BasePage.is_element_present(self, By.CSS_SELECTOR, self.delete_button), 'Failed to upload file'
def verify_more_options_is_opened(self, index=None, opened=None): if index is None: index = 1 if opened is None: opened = True present = BasePage.is_element_present(self, By.CSS_SELECTOR, self.row_number_prefix.format(index) + self.add_header_button) return present if opened else not present