def search_field(self, driver, search_string): """ Click on the "Filter Results" button. Then, use the table search field to search for {{search_string}}. Then, close the modal window """ FilterModal.search.inject_text(driver, search_string) time.sleep(SEARCH_AUTOCOMPLETE) FilterModal.sort("Service Title").click(driver) FilterModal.count.select_option(driver, "100")
def to_workspace_text(self, driver, text): """ Click on the "Filter Results" button. Then, find a cell which contains the text {{text}} and click on it. Next, click on "Select Tool" and choose the workspace option """ FilterModal.count.select_option(driver, "100") FilterModal.cell_text(text).click(driver) FilterModal.action.click(driver) FilterModal.to_workspace.click(driver) FilterModal.workspace.click(driver)
def data_prop_is_selected(self, driver, prop): data_props_list = FilterModal.data_props_list count_data_props = data_props_list.get_immediate_child_count(driver) for i in range(0, count_data_props): checkbox_label = FilterModal.data_prop_list_label(i).get_text( driver) if checkbox_label == prop: aria_selected = FilterModal.data_prop_list_entry( i).get_attribute(driver, "aria-selected") return aria_selected == "true" return False
def to_workspace_cell(self, driver, row, col): """ Click on the "Filter Results" button. Then, click on the cell in the {{row}} row and {{col}} column, then click "Select Action" and choose the workspace option """ FilterModal.count.select_option(driver, "100") FilterModal.close.scroll_to(driver) FilterModal.cell(row, col).click(driver) FilterModal.action.click(driver) FilterModal.to_workspace.click(driver) FilterModal.workspace.click(driver)
def set_data_props(self, driver, data_props): data_props_list = FilterModal.data_props_list count_data_props = data_props_list.get_immediate_child_count(driver) for i in range(0, count_data_props): checkbox_label = FilterModal.data_prop_list_label(i).get_text( driver) if checkbox_label in data_props: FilterModal.data_prop_list_checkbox(i).click(driver) FilterModal.apply_filters.click(driver) time.sleep(SEARCH_IN_PROGRESS) FilterModal.close.click(driver) time.sleep(MODAL_FADE)
def to_workspace_cell_range(self, driver, first_row, last_row): """ Select a range of rows from the Filter Results modal """ FilterModal.count.select_option(driver, '100') FilterModal.cell(first_row, 3).scroll_to(driver) FilterModal.cell(first_row, 3).click(driver) FilterModal.cell(last_row, 3).scroll_to(driver) FilterModal.cell(last_row, 3).range_click(driver) FilterModal.action.click(driver) FilterModal.to_workspace.click(driver) FilterModal.workspace.click(driver)
def to_workspace_cell_multi(self, driver, rows): """ Select multiple rows within Filter Results modal """ FilterModal.count.select_option(driver, '100') FilterModal.cell(rows[0], 3).scroll_to(driver) FilterModal.cell(rows[0], 3).click(driver) for i in range(1, len(rows)): FilterModal.cell(rows[i], 3).scroll_to(driver) FilterModal.cell(rows[i], 3).multi_click(driver) FilterModal.action.click(driver) FilterModal.to_workspace.click(driver) FilterModal.workspace.click(driver)
def to_workspace_texts_range(self, driver, texts): """ Click on the "Filter Results" button. Find a cell which contains the text in the first item of this list: {{texts}}. Next, find a cell which contains the text in the second imem of this list: {{texts}}. Click the first cell, then hold the Shift key and click the second cell. Finally, click "Select Tool" and choose the workspace export option """ FilterModal.count.select_option(driver, "100") FilterModal.cell_text(texts[0]).click(driver) FilterModal.sort("Service Title").click(driver) FilterModal.cell_text(texts[1]).scroll_to(driver) FilterModal.cell_text(texts[1]).multi_click(driver) FilterModal.action.click(driver) FilterModal.to_workspace.click(driver) FilterModal.workspace.click(driver)