From 34695fa234ea4df8565a268ad4f73d1d5a12c3a7 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Wed, 2 Oct 2024 12:22:05 +0100 Subject: [PATCH 1/2] update copy on EY find ref screen --- config/locales/en.yml | 2 +- .../practitioner/find_reference_spec.rb | 10 +++++----- .../practitioner/happy_path_spec.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index a6da19c7bd..fa052ffbf9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1404,7 +1404,7 @@ en: claim_description: for early years financial incentive payment forms: find_reference: - question: Track your application + question: Enter your claim reference errors: presence: Enter your claim reference number impermissible: Enter a valid claim reference number diff --git a/spec/features/early_years_payment/practitioner/find_reference_spec.rb b/spec/features/early_years_payment/practitioner/find_reference_spec.rb index 3fcce0a04c..0aa49c38b1 100644 --- a/spec/features/early_years_payment/practitioner/find_reference_spec.rb +++ b/spec/features/early_years_payment/practitioner/find_reference_spec.rb @@ -14,29 +14,29 @@ when_early_years_payment_practitioner_journey_configuration_exists visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=other@example.com" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" fill_in "Claim reference number", with: claim.reference click_button "Submit" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" end scenario "after multiple attempts should work" do when_early_years_payment_practitioner_journey_configuration_exists visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=user@example.com" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" fill_in "Claim reference number", with: "foo" click_button "Submit" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" fill_in "Claim reference number", with: claim.reference click_button "Submit" expect(page).to have_content "Sign in with GOV.UK One Login" click_link "Back" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" fill_in "Claim reference number", with: claim.reference click_button "Submit" expect(page).to have_content "Sign in with GOV.UK One Login" diff --git a/spec/features/early_years_payment/practitioner/happy_path_spec.rb b/spec/features/early_years_payment/practitioner/happy_path_spec.rb index bcd6bb284e..e31a525877 100644 --- a/spec/features/early_years_payment/practitioner/happy_path_spec.rb +++ b/spec/features/early_years_payment/practitioner/happy_path_spec.rb @@ -14,7 +14,7 @@ when_early_years_payment_practitioner_journey_configuration_exists visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=user@example.com" - expect(page).to have_content "Track your application" + expect(page).to have_content "Enter your claim reference" fill_in "Claim reference number", with: claim.reference click_button "Submit" From f92bc9693f6dbdc5147531a4a492142dbd7abd56 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Wed, 2 Oct 2024 12:22:21 +0100 Subject: [PATCH 2/2] fixes flaky JS test --- .../early_career_payments_claim_spec.rb | 2 +- spec/support/feature_helpers.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/spec/features/early_career_payments/early_career_payments_claim_spec.rb b/spec/features/early_career_payments/early_career_payments_claim_spec.rb index 98e559659c..7a55f6626c 100644 --- a/spec/features/early_career_payments/early_career_payments_claim_spec.rb +++ b/spec/features/early_career_payments/early_career_payments_claim_spec.rb @@ -997,7 +997,7 @@ skip_tid # - Which school do you teach at - choose_school school + choose_school_js school # - NQT in Academic Year after ITT choose "Yes" diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index 212fc67389..0c8b88cad6 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -40,6 +40,22 @@ def choose_school(school) click_button "Continue" end + def choose_school_js(school) + expect(page).to have_text(/Which (additional )?school/) # there can be variations of the full text depending on which journey/page + + fill_in :school_search, with: school.name.sub("The ", "").split(" ").first + + within("#school_search__listbox") do + sleep(1) # seems to aid in success, as if click happens before event is bound + find("li", text: school.name).click + end + + click_button "Continue" + + choose school.name + click_button "Continue" + end + def choose_still_teaching(teaching_at = "Yes, at Penistone Grammar School") choose teaching_at click_on "Continue"