def licence_audit(driver, context, internal_url): case_page = ApplicationPage(driver) ApplicationPage(driver).go_to_cases_activity_tab(internal_url, context) finalised_audit = case_page.get_text_of_audit_trail_item(0) assert "finalised" in finalised_audit document_audit = case_page.get_text_of_audit_trail_item(1) assert context.document_template_name in document_audit
def audit_trail_updated(driver, context, internal_info, internal_url): # noqa ApplicationPage(driver).go_to_cases_activity_tab_for_clc( internal_url, context) assert (context.status.lower() in Shared(driver).get_audit_trail_text().lower() ), "status has not been shown as approved in audit trail"
def entered_text_no_longer_in_case_field(driver, context): application_page = ApplicationPage(driver) assert context.text not in application_page.get_text_of_case_note_field(), "cancel button hasn't cleared text"
def go_to_the_organisation_which_submitted_the_case(driver): # noqa ApplicationPage(driver).go_to_organisation()
def i_click_cancel_button(driver): application_page = ApplicationPage(driver) application_page.click_cancel_btn()
def changes_have_been_made_to_case(driver, context, api_test_client): assert len(ApplicationPage(driver).get_case_notification_anchor())
def enforcement_audit(driver, internal_url, context): ApplicationPage(driver).go_to_cases_activity_tab(internal_url, context) assert "exported the case for enforcement check" in Shared( driver).get_audit_trail_text()
def select_product_for_review(driver): CasePage(driver).select_first_good() ApplicationPage(driver).click_review_goods()
def licence_audit(driver, context, internal_url): # noqa ApplicationPage(driver).go_to_cases_activity_tab(internal_url, context) second_audit = ApplicationPage(driver).get_text_of_audit_trail_item(1) assert context.licence_duration in second_audit assert context.licence_start_date in second_audit
def queue_change_in_audit(driver, context, internal_url): ApplicationPage(driver).go_to_cases_activity_tab(internal_url, context) assert "moved the case to " + context.queue_name in Shared( driver).get_audit_trail_text()
def latest_audit_trail(driver, expected_text, no): assert expected_text in ApplicationPage(driver).get_text_of_audit_trail_item(int(no) - 1)
def i_enter_a_next_review_date(driver, context): ApplicationPage(driver).set_next_review_date("01", "01", "2100", context) Shared(driver).click_submit()
def see_number_of_checkboxes_selected(driver, context, num): ApplicationPage(driver).click_move_case_button() # May be more queues due to case routing automation assert int(QueuesPages(driver).get_number_of_selected_queues()) >= int(num)
def filter_status_change(driver, user_type): # noqa page = ApplicationPage(driver) page.select_filter_user_type_from_dropdown(user_type)
def add_case_note(driver, case_note_text): ApplicationPage(driver).enter_case_note(case_note_text) ApplicationPage(driver).click_post_note_btn()
def click_on_notes_and_timeline(driver): ApplicationPage(driver).click_on_notes_and_timeline()
def click_visible_to_exporters_checkbox(driver): application_page = ApplicationPage(driver) application_page.click_visible_to_exporter_checkbox()
def move_case_to_new_queue(driver, context): # noqa ApplicationPage(driver).click_move_case_button() if not driver.find_element_by_id(context.queue_name.replace(" ", "-")).is_selected(): driver.find_element_by_id(context.queue_name.replace(" ", "-")).click() Shared(driver).click_submit()
def case_notes_tab(driver, internal_url, context): ApplicationPage(driver).go_to_cases_activity_tab(internal_url, context)
def original_application_linked(driver, context): assert context.old_app_id in ApplicationPage( driver).get_case_copy_of_field_href()
def select_status_save(driver, status, context): # noqa application_page = ApplicationPage(driver) application_page.select_status(status) context.status = status context.date_time_of_update = utils.get_formatted_date_time_h_m_pm_d_m_y() Shared(driver).click_submit()
def can_click_on_the_end_user_document_download_link(driver): assert ApplicationPage(driver).end_user_document_link_is_enabled()
def im_done_button(driver): # noqa ApplicationPage(driver).click_im_done_button()
def can_click_on_the_additional_document_download_link(driver): assert ApplicationPage(driver).additional_document_link_is_enabled()
def check_status_has_changed(driver, internal_url, context): ApplicationPage(driver).go_to_cases_activity_tab_for_eua( internal_url, context) assert "closed" in Shared(driver).get_audit_trail_text().lower()
def enter_case_note_text(driver, text, context): application_page = ApplicationPage(driver) if text == "too many characters": text = "T" * 2201 context.text = text application_page.enter_case_note(text)
def see_hmrc(driver, context): assert ApplicationPage(driver).get_type_of_case_from_page() == "HMRC Query" assert functions.element_with_id_exists( driver, ApplicationPage(driver).HMRC_GOODS_LOCATION)
def click_post_note(driver, context): application_page = ApplicationPage(driver) # TODO Make this an implicit wait! time.sleep(1) application_page.click_post_note_btn() context.date_time_of_post = utils.get_formatted_date_time_h_m_pm_d_m_y()
def click_edit_flags_link(driver): CasePage(driver).select_first_good() ApplicationPage(driver).click_review_goods()
def note_is_displayed(driver, context): application_page = ApplicationPage(driver) assert context.text in application_page.get_text_of_case_note(0) assert utils.search_for_correct_date_regex_in_element( application_page.get_text_of_case_note_date_time(0) ), "incorrect time format of post on case note"