From 008a75829003072d1ec0f7dc00357f1d2a7ff458 Mon Sep 17 00:00:00 2001 From: Alkesh Vaghmaria Date: Mon, 22 Jul 2024 11:53:46 +0100 Subject: [PATCH] sign in with one login in specs --- .../college_not_found_spec.rb | 4 +++ .../happy_js_path_spec.rb | 2 ++ .../happy_path_spec.rb | 9 +------ .../ineligible_paths_spec.rb | 26 +++++++++++++++++++ spec/support/feature_helpers.rb | 11 ++++++++ 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/spec/features/further_education_payments/college_not_found_spec.rb b/spec/features/further_education_payments/college_not_found_spec.rb index 89075664c2..c4b80790b4 100644 --- a/spec/features/further_education_payments/college_not_found_spec.rb +++ b/spec/features/further_education_payments/college_not_found_spec.rb @@ -8,6 +8,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -27,6 +29,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" diff --git a/spec/features/further_education_payments/happy_js_path_spec.rb b/spec/features/further_education_payments/happy_js_path_spec.rb index 0d22d9fca7..4e88049771 100644 --- a/spec/features/further_education_payments/happy_js_path_spec.rb +++ b/spec/features/further_education_payments/happy_js_path_spec.rb @@ -11,6 +11,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index f67d8f60e9..6cd4a8ce70 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -11,14 +11,7 @@ expect(page).to have_link("Start now") click_link "Start now" - expect(page).to have_content("Sign in with GOV.UK One Login") - click_button "Continue with One Login" - - expect(page).to have_content("You've successfully signed in to GOV.UK One Login") - click_button "Prove your identity with One Login" - - expect(page).to have_content("You've successfully proved your identity with GOV.UK One Login") - click_button "Continue" + sign_in_with_one_login expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" diff --git a/spec/features/further_education_payments/ineligible_paths_spec.rb b/spec/features/further_education_payments/ineligible_paths_spec.rb index bccaff0c29..894b8eb851 100644 --- a/spec/features/further_education_payments/ineligible_paths_spec.rb +++ b/spec/features/further_education_payments/ineligible_paths_spec.rb @@ -13,6 +13,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "No" click_button "Continue" @@ -28,6 +30,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -63,6 +67,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -103,6 +109,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -134,6 +142,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -177,6 +187,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -212,6 +224,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -276,6 +290,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -340,6 +356,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -394,6 +412,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -425,6 +445,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -464,6 +486,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" @@ -503,6 +527,8 @@ expect(page).to have_link("Start now") click_link "Start now" + sign_in_with_one_login + expect(page).to have_content("Are you a member of staff with teaching responsibilities?") choose "Yes" click_button "Continue" diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index 928482f370..0b89dd9804 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -133,4 +133,15 @@ def set_slug_sequence_in_session(journey_session:, slug:) page.set_rack_session(slugs: visited_slugs) end + + def sign_in_with_one_login + expect(page).to have_content("Sign in with GOV.UK One Login") + click_button "Continue with One Login" + + expect(page).to have_content("You've successfully signed in to GOV.UK One Login") + click_button "Prove your identity with One Login" + + expect(page).to have_content("You've successfully proved your identity with GOV.UK One Login") + click_button "Continue" + end end