generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port feature specs to RSpec from Cypress
- Port the LP Partnership landing page scenarios - Port the LP Viewing my schools scenario - Port the LP Searching my schools list scenario - Port the LP viewing schools with pupil premiums scenarios - Port the Admin viewing school participants scenarios - Port the Admin Participant Management scenarios Additionally: - Remove the "Delete participant" spec since the delete action is not functioning - Consolidate the specs for participant details into a single file - Fix the HTML for the participant table
- Loading branch information
Showing
17 changed files
with
319 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
spec/cypress/integration/admin/ParticipantManagment.feature
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
spec/cypress/integration/admin/ViewSchoolParticipants.feature
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
spec/cypress/integration/lead_providers/PartnershipGuidance.feature
This file was deleted.
Oops, something went wrong.
88 changes: 0 additions & 88 deletions
88
spec/cypress/integration/lead_providers/YourSchools.feature
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
require "rails_helper" | ||
require_relative "./participant_steps" | ||
|
||
RSpec.feature "Admin should be able to update participants details", js: true, rutabaga: false do | ||
RSpec.feature "Admin should be able to manage participants details", js: true, rutabaga: false do | ||
include ParticipantSteps | ||
|
||
before do | ||
|
@@ -60,4 +60,36 @@ | |
when_i_click_on_the_participants_name "Billy Mentor" | ||
then_the_participants_email_should_have_updated "[email protected]" | ||
end | ||
|
||
scenario "Admin can validate the identity of NPQ participants" do | ||
npq = NewSeeds::Scenarios::NPQ.new.build | ||
|
||
when_i_visit_the_details_page_of_the_participant(npq.participant_profile.id) | ||
and_i_click_on_the_identity_confirmation(npq.participant_profile.id) | ||
and_i_approve_the_identity_confirmation | ||
then_i_should_see_the_confirmation_message | ||
end | ||
|
||
def when_i_visit_the_details_page_of_the_participant(participant_id) | ||
@details_page = Pages::AdminSupportParticipantDetail.load(participant_id:) | ||
end | ||
|
||
def and_i_click_on_the_identity_confirmation(participant_id) | ||
@details_page.edit_identity_confirmation | ||
@identity_confirmation_page = Pages::AdminParticipantIdentityValidation.loaded(participant_id:) | ||
end | ||
|
||
def and_i_click_on_the_override_decision | ||
@details_page.edit_decision | ||
end | ||
|
||
def and_i_approve_the_identity_confirmation | ||
@identity_confirmation_page.approved.click | ||
@identity_confirmation_page.decision_notes.set "Looks good" | ||
@identity_confirmation_page.confirm_button.click | ||
end | ||
|
||
def then_i_should_see_the_confirmation_message | ||
expect(page).to have_text("Participant task 'Identity' has been approved") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
require_relative "./participant_steps" | ||
|
||
RSpec.feature "Admin finding participants", js: true, rutabaga: false do | ||
include ParticipantSteps | ||
|
||
before do | ||
given_there_is_a_school_that_has_chosen_fip_for_2021_and_partnered | ||
and_i_am_signed_in_as_an_admin | ||
and_i_have_added_an_ect | ||
and_i_have_added_a_mentor | ||
when_i_visit_admin_participants_dashboard | ||
end | ||
|
||
scenario "Viewing a list of participants" do | ||
@page = Pages::AdminSupportParticipantList.load | ||
|
||
then_i_should_see_a_list_of_participants | ||
end | ||
|
||
scenario "Searching participants" do | ||
@page = Pages::AdminSupportParticipantList.load | ||
|
||
then_i_see_the_search_bar | ||
|
||
when_i_search_for_participant "Sally Teacher" | ||
then_the_search_results_are_displayed | ||
|
||
when_i_search_for_participant "random keyword" | ||
then_the_search_results_are_empty | ||
end | ||
|
||
def when_i_search_for_participant(keyword) | ||
@page.search_field.send_keys(keyword) | ||
@page.search_button.click | ||
end | ||
|
||
def then_i_see_the_search_bar | ||
expect(@page).to have_search_field | ||
expect(@page).to have_search_button | ||
end | ||
|
||
def then_the_search_results_are_displayed | ||
expect(@page).to have_search_results | ||
expect(@page.search_results.first.full_name.text).to eq("Sally Teacher") | ||
end | ||
|
||
def then_the_search_results_are_empty | ||
expect(@page).to_not have_search_results | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.