diff --git a/spec/support/autoload/page_objects/assessor_interface/application.rb b/spec/support/autoload/page_objects/assessor_interface/application.rb index b561881941..7539de9b6b 100644 --- a/spec/support/autoload/page_objects/assessor_interface/application.rb +++ b/spec/support/autoload/page_objects/assessor_interface/application.rb @@ -7,19 +7,29 @@ class Application < SitePrism::Page element :add_note_button, ".app-inline-action .govuk-button" - section :overview, "#app-application-overview" do - element :name, "div:nth-of-type(1) > dd:nth-of-type(1)" - element :assessor_name, "div:nth-of-type(7) > dd:nth-of-type(1)" - element :reviewer_name, "div:nth-of-type(8) > dd:nth-of-type(1)" - element :status, "div:nth-of-type(10) > dd:nth-of-type(1)" - end - + section :summary_list, GovukSummaryList, ".govuk-summary-list" section :task_list, TaskList, ".app-task-list" section :management_tasks, ".app-task-list + .govuk-warning-text" do elements :links, ".govuk-link" end + def name_summary + summary_list.find_row(key: "Name") + end + + def assessor_summary + summary_list.find_row(key: "Assigned to") + end + + def reviewer_summary + summary_list.find_row(key: "Reviewer") + end + + def status_summary + summary_list.find_row(key: "Status") + end + def preliminary_check_task task_list.find_item("Preliminary check (qualifications)") end diff --git a/spec/support/autoload/page_objects/govuk_summary_list.rb b/spec/support/autoload/page_objects/govuk_summary_list.rb index d63421d986..1a5199a120 100644 --- a/spec/support/autoload/page_objects/govuk_summary_list.rb +++ b/spec/support/autoload/page_objects/govuk_summary_list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PageObjects class GovukSummaryList < SitePrism::Section sections :rows, ".govuk-summary-list__row" do diff --git a/spec/system/assessor_interface/assigning_assessor_spec.rb b/spec/system/assessor_interface/assigning_assessor_spec.rb index 9916442499..7993f3cd15 100644 --- a/spec/system/assessor_interface/assigning_assessor_spec.rb +++ b/spec/system/assessor_interface/assigning_assessor_spec.rb @@ -51,7 +51,7 @@ def and_i_select_an_assessor end def and_the_assessor_is_assigned_to_the_application_form - expect(assessor_application_page.overview.assessor_name.text).to eq( + expect(assessor_application_page.assessor_summary.value).to have_text( assessor.name, ) end @@ -66,7 +66,7 @@ def and_i_select_a_reviewer end def and_the_assessor_is_assigned_as_reviewer_to_the_application_form - expect(assessor_application_page.overview.reviewer_name.text).to eq( + expect(assessor_application_page.reviewer_summary.value).to have_text( assessor.name, ) end diff --git a/spec/system/assessor_interface/awaiting_professional_standing_spec.rb b/spec/system/assessor_interface/awaiting_professional_standing_spec.rb index 37117bd0fd..2b853f6db3 100644 --- a/spec/system/assessor_interface/awaiting_professional_standing_spec.rb +++ b/spec/system/assessor_interface/awaiting_professional_standing_spec.rb @@ -31,7 +31,7 @@ def given_there_is_an_application_form_with_professional_standing_request end def and_i_see_a_waiting_on_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "WAITING ON PROFESSIONAL STANDING", ) end @@ -49,7 +49,9 @@ def when_i_fill_in_the_form end def and_i_see_a_not_started_status - expect(assessor_application_page.overview.status.text).to eq("NOT STARTED") + expect(assessor_application_page.status_summary.value).to have_text( + "NOT STARTED", + ) end def and_the_teacher_receives_a_professional_standing_received_email diff --git a/spec/system/assessor_interface/change_application_form_name_spec.rb b/spec/system/assessor_interface/change_application_form_name_spec.rb new file mode 100644 index 0000000000..e69de29bb2 diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index f37fb64263..47bf9bff6d 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -375,17 +375,21 @@ def when_i_click_on_overview_button end def then_the_application_form_is_awarded - expect(assessor_application_page.overview.status.text).to eq("AWARDED") + expect(assessor_application_page.status_summary.value).to have_text( + "AWARDED", + ) end def then_the_application_form_is_waiting_on - expect(assessor_application_page.overview.status.text).to include( + expect(assessor_application_page.status_summary.value.text).to include( "WAITING ON", ) end def then_the_application_form_is_declined - expect(assessor_application_page.overview.status.text).to eq("DECLINED") + expect(assessor_application_page.status_summary.value).to have_text( + "DECLINED", + ) end def application_id diff --git a/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb b/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb index 8a25b12bd9..2930b111eb 100644 --- a/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb +++ b/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb @@ -167,7 +167,7 @@ def and_the_application_english_language_proof_method_is_moi end def then_i_see_the_application - expect(assessor_application_page.overview.name.text).to eq( + expect(assessor_application_page.name_summary.value).to have_text( "#{application_form.given_names} #{application_form.family_name}", ) end diff --git a/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb b/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb index 94af4833f4..e468712d6e 100644 --- a/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb +++ b/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb @@ -24,7 +24,7 @@ def when_i_click_back_link end def then_i_see_the_application - expect(assessor_application_page.overview.name.text).to eq( + expect(assessor_application_page.name_summary.value).to have_text( "#{application_form.given_names} #{application_form.family_name}", ) end diff --git a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb index 9680f8fdb8..05edea049f 100644 --- a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb +++ b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb @@ -49,7 +49,7 @@ def given_there_is_an_application_form_with_professional_standing_request end def and_i_see_a_waiting_on_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "PRELIMINARY CHECK", ) end diff --git a/spec/system/assessor_interface/verifying_professional_standing_spec.rb b/spec/system/assessor_interface/verifying_professional_standing_spec.rb index b6e5b3aa76..0ed8b851e5 100644 --- a/spec/system/assessor_interface/verifying_professional_standing_spec.rb +++ b/spec/system/assessor_interface/verifying_professional_standing_spec.rb @@ -39,7 +39,7 @@ def given_there_is_an_application_form_with_professional_standing_request end def and_i_see_a_waiting_on_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "WAITING ON PROFESSIONAL STANDING", ) end @@ -74,7 +74,7 @@ def when_i_fill_in_the_review_form end def and_i_see_a_received_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "RECEIVED PROFESSIONAL STANDING", ) end diff --git a/spec/system/assessor_interface/verifying_qualifications_spec.rb b/spec/system/assessor_interface/verifying_qualifications_spec.rb index 0a0b63c313..08c41983c0 100644 --- a/spec/system/assessor_interface/verifying_qualifications_spec.rb +++ b/spec/system/assessor_interface/verifying_qualifications_spec.rb @@ -80,7 +80,7 @@ def given_there_is_an_application_form_with_qualification_request end def and_i_see_a_waiting_on_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "WAITING ON QUALIFICATION", ) end @@ -139,11 +139,13 @@ def when_i_go_back_to_overview end def and_i_see_a_received_status - expect(assessor_application_page.overview.status.text).to eq("RECEIVED") + expect(assessor_application_page.status_summary.value).to have_text( + "RECEIVED", + ) end def and_i_see_an_in_progress_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "ASSESSMENT IN PROGRESS", ) end diff --git a/spec/system/assessor_interface/verifying_references_spec.rb b/spec/system/assessor_interface/verifying_references_spec.rb index ff20338f4a..94ddbabbd4 100644 --- a/spec/system/assessor_interface/verifying_references_spec.rb +++ b/spec/system/assessor_interface/verifying_references_spec.rb @@ -38,7 +38,7 @@ def given_there_is_an_application_form_with_reference_request end def and_i_see_a_waiting_on_status - expect(assessor_application_page.overview.status.text).to eq( + expect(assessor_application_page.status_summary.value).to have_text( "WAITING ON REFERENCE", ) end diff --git a/spec/system/assessor_interface/view_application_form_spec.rb b/spec/system/assessor_interface/view_application_form_spec.rb index aba5fb0f96..a3f9b4c0a9 100644 --- a/spec/system/assessor_interface/view_application_form_spec.rb +++ b/spec/system/assessor_interface/view_application_form_spec.rb @@ -25,7 +25,7 @@ def when_i_click_back_link end def then_i_see_the_application - expect(assessor_application_page.overview.name.text).to eq( + expect(assessor_application_page.name_summary.value).to have_text( "#{application_form.given_names} #{application_form.family_name}", ) end diff --git a/spec/system/assessor_interface/view_timeline_events_spec.rb b/spec/system/assessor_interface/view_timeline_events_spec.rb index 95e82d90d8..a14eee26aa 100644 --- a/spec/system/assessor_interface/view_timeline_events_spec.rb +++ b/spec/system/assessor_interface/view_timeline_events_spec.rb @@ -25,7 +25,7 @@ def given_an_application_form_exists end def and_i_click_view_timeline - assessor_application_page.overview.click_link( + assessor_application_page.click_link( "View timeline of this applications actions", ) end