From 6f6fcf2ff698755197a5ad9e38dcbf5dc1fcedd8 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 9 Oct 2023 12:26:34 +0100 Subject: [PATCH] Update system tests for verifying LoPS This updates the system tests for verifying LoPS to use the newer verify page and updates to use the right permissions. --- .../assessor_interface/complete_assessment.rb | 6 +++++ .../pre_assessment_tasks_spec.rb | 6 ++--- ...> reviewing_professional_standing_spec.rb} | 27 ++++++++++++++++--- .../verifying_professional_standing_spec.rb | 24 ++++++++--------- 4 files changed, 44 insertions(+), 19 deletions(-) rename spec/system/assessor_interface/{reviewing_verifications_spec.rb => reviewing_professional_standing_spec.rb} (79%) diff --git a/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb b/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb index 9372b58282..9a1e24be8b 100644 --- a/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb +++ b/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb @@ -20,6 +20,12 @@ def request_further_information def decline_qts new_states.find { |radio_item| radio_item.label.text == "Decline QTS" } end + + def send_for_review + new_states.find do |radio_item| + radio_item.label.text == "Send application for review" + end + end end end end diff --git a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb index 536fe83fd0..87b300230c 100644 --- a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb +++ b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb @@ -43,8 +43,8 @@ end it "locate professional standing" do - when_i_visit_the(:assessor_application_page, application_id:) - then_i_see_the(:assessor_application_page, application_id:) + when_i_visit_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, application_form_id:) and_i_see_a_waiting_on_status and_i_click_awaiting_professional_standing then_i_see_the( @@ -53,7 +53,7 @@ ) when_i_fill_in_the_locate_form - then_i_see_the(:assessor_application_page, application_id:) + then_i_see_the(:assessor_application_page, application_form_id:) and_i_see_a_preliminary_check_status and_the_teacher_receives_a_professional_standing_received_email end diff --git a/spec/system/assessor_interface/reviewing_verifications_spec.rb b/spec/system/assessor_interface/reviewing_professional_standing_spec.rb similarity index 79% rename from spec/system/assessor_interface/reviewing_verifications_spec.rb rename to spec/system/assessor_interface/reviewing_professional_standing_spec.rb index 07c4ce1d13..f086b04ad5 100644 --- a/spec/system/assessor_interface/reviewing_verifications_spec.rb +++ b/spec/system/assessor_interface/reviewing_professional_standing_spec.rb @@ -14,6 +14,18 @@ then_i_see_the(:assessor_application_page, application_form_id:) when_i_click_on_verification_decision + then_i_see_the(:assessor_complete_assessment_page, application_form_id:) + + when_i_select_send_for_review + then_i_see_the( + :assessor_assessment_recommendation_review_page, + application_form_id:, + ) + + when_i_click_continue_from_review + then_i_see_the(:assessor_application_status_page, application_form_id:) + + when_i_click_on_overview_button then_i_see_the(:assessor_application_page, application_form_id:) when_i_click_on_review_verifications @@ -58,12 +70,19 @@ def given_there_is_an_application_form_with_failed_verifications def when_i_click_on_verification_decision assessor_application_page.verification_decision_task.click + end - # TODO: review functionality is not built yet, this page can never be reached - application_form.assessment.review! + def when_i_select_send_for_review + assessor_complete_assessment_page.send_for_review.choose + assessor_complete_assessment_page.continue_button.click + end - # TODO: reload the page - when_i_visit_the(:assessor_application_page, application_form_id:) + def when_i_click_continue_from_review + assessor_assessment_recommendation_review_page.continue_button.click + end + + def when_i_click_on_overview_button + assessor_application_status_page.button_group.overview_button.click end def when_i_click_on_review_verifications diff --git a/spec/system/assessor_interface/verifying_professional_standing_spec.rb b/spec/system/assessor_interface/verifying_professional_standing_spec.rb index cf451cdfe9..56ff10884d 100644 --- a/spec/system/assessor_interface/verifying_professional_standing_spec.rb +++ b/spec/system/assessor_interface/verifying_professional_standing_spec.rb @@ -43,18 +43,18 @@ ) and_the_request_lops_verification_status_is("COMPLETED") - # when_i_click_record_lops_verification - # then_i_see_the( - # :assessor_verify_professional_standing_request_page, - # application_form_id:, - # assessment_id:, - # ) - # and_i_fill_in_the_verify_form - # then_i_see_the( - # :assessor_professional_standing_request_page, - # application_form_id:, - # assessment_id:, - # ) + when_i_click_record_lops_verification + then_i_see_the( + :assessor_verify_professional_standing_request_page, + application_form_id:, + assessment_id:, + ) + and_i_fill_in_the_verify_form + then_i_see_the( + :assessor_professional_standing_request_page, + application_form_id:, + assessment_id:, + ) end private