Skip to content

Commit

Permalink
sign in with one login in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Jul 22, 2024
1 parent 31ca60a commit 008a758
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 1 addition & 8 deletions spec/features/further_education_payments/happy_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
26 changes: 26 additions & 0 deletions spec/features/further_education_payments/ineligible_paths_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions spec/support/feature_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 008a758

Please sign in to comment.