def dont_see_queue_in_queue_list(driver, context): # noqa case_page = CaseListPage(driver) functions.try_open_filters(driver) case_page.filter_by_case_reference(context.reference_code) functions.click_apply_filters(driver) assert context.reference_code not in driver.find_element_by_id( "main-content").text
def assign_user_to_case(driver, enabled_disabled): if enabled_disabled == "enabled": assert ( "disabled" not in CaseListPage(driver).get_class_name_of_assign_users_button() ), "assign users button is not enabled" elif enabled_disabled == "disabled": assert ( "disabled" in CaseListPage(driver).get_class_name_of_assign_users_button() ), "assign users button is not disabled"
def see_queue_in_queue_list(driver, context): # noqa case_page = CaseListPage(driver) functions.try_open_filters(driver) case_page.click_clear_filters_button() case_page = CaseListPage(driver) functions.try_open_filters(driver) case_page.filter_by_case_reference(context.reference_code) functions.click_apply_filters(driver) assert driver.find_element_by_id(context.case_id).is_displayed()
def user_is_on_case_list(driver, context): first_name, last_name = context.user_name.split(" ", 1) first_name = first_name[0].upper() last_name = last_name[0].upper() assert first_name + last_name in CaseListPage(driver).get_text_of_assignees( driver, context.case_id ), f"'{context.user_name}' is not an assignee on case list"
def system_queue_shown_in_dropdown(driver, queue_name): # noqa CaseListPage(driver).click_on_queue_name(queue_name)
def system_queue_shown_in_dropdown(driver, context): CaseListPage(driver).click_on_queue_name(context.queue_name)
def filter_search_for_assign_users(driver, internal_info): CaseListPage(driver).enter_name_to_filter_search_box(internal_info["name"])
def i_can_see_the_case_on_the_exporter_amendments_queue(driver, context): case_list_page = CaseListPage(driver) case_list_page.assert_case_is_present(context.app_id)
def case_in_cases_list(driver, context): # noqa context.case_row = CaseListPage(driver).get_case_row(context.case_id) assert context.reference_code in context.case_row.text
def click_checkbox_for_application(driver, internal_url, context): CaseListPage(driver).click_on_case_checkbox(context.case_id) CaseListPage(driver).click_on_assign_users_button()
@then("user is assignee on case list") def user_is_on_case_list(driver, context): first_name, last_name = context.user_name.split(" ", 1) first_name = first_name[0].upper() last_name = last_name[0].upper() assert first_name + last_name in CaseListPage(driver).get_text_of_assignees( driver, context.case_id ), f"'{context.user_name}' is not an assignee on case list" @when("I filter assigned user by Not Assigned") def i_filter_case_officer_by_not_assigned(driver): case = CaseListPage(driver) functions.try_open_filters(driver) case.enter_assigned_user_filter_text("Not assigned") functions.click_apply_filters(driver) @then("only SSO users name is displayed in user list for assign cases") def user_is_on_case_list(driver, internal_info): elements = CaseListPage(driver).get_text_checkbox_elements() for element in elements: assert internal_info["name"] in element.text, internal_info["name"] + "is not displayed in user list" @then("user is not assignee on case list") def user_is_not_on_case_list(driver, context): assert not CaseListPage(driver).has_assignees(driver, context.case_id), "This case has assignees"
def filter_by_ogel(driver): functions.try_open_filters(driver) CaseListPage(driver).select_filter_case_type_from_dropdown( "Open General Export Licence") functions.click_apply_filters(driver)
def assert_case_is_present(driver, apply_for_clc_query, context): assert CaseListPage(driver).assert_case_is_present(context.clc_case_id), "clc case ID is not present on page"
def filter_status_change(driver, context, status): # noqa CaseListPage(driver).select_filter_user_status_from_dropdown(status) functions.click_apply_filters(driver)
def queue_shown_in_dropdown(driver, context): # noqa CaseListPage(driver).click_on_queue_name(context.queue_name)
def user_is_on_case_list(driver, internal_info): elements = CaseListPage(driver).get_text_checkbox_elements() for element in elements: assert internal_info["name"] in element.text, internal_info["name"] + "is not displayed in user list"
def user_is_not_on_case_list(driver, context): assert not CaseListPage(driver).has_assignees(driver, context.case_id), "This case has assignees"
def case_sla(driver, context): # noqa assert CaseListPage(driver).get_case_row_sla(context.case_row) == "0"
def select_all_cases(driver): CaseListPage(driver).click_select_all_checkbox()
def i_click_clear_filters(driver, context): # noqa CaseListPage(driver).click_clear_filters_button()
def i_click_on_the_exporter_amendments_banner(driver, context): case_list_page = CaseListPage(driver) case_list_page.click_on_exporter_amendments_banner()