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"