Skip to content

Commit

Permalink
Merge pull request #1756 from DFE-Digital/2320-refactor-page-objects-…
Browse files Browse the repository at this point in the history
…to-add-a-namespace-prefix

2320 refactor page objects to add a namespace prefix
  • Loading branch information
thomasleese authored Oct 13, 2023
2 parents 8cd32f1 + 5d8368d commit ef4f333
Show file tree
Hide file tree
Showing 25 changed files with 820 additions and 699 deletions.
457 changes: 232 additions & 225 deletions spec/support/page_helpers.rb

Large diffs are not rendered by default.

25 changes: 17 additions & 8 deletions spec/system/assessor_interface/assigning_assessor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
it "assigns an assessor" do
given_i_am_authorized_as_an_assessor_user

when_i_visit_the(:assign_assessor_page, application_id: application_form.id)
when_i_visit_the(
:assessor_assign_assessor_page,
application_id: application_form.id,
)
and_i_select_an_assessor
then_i_see_the(
:assessor_application_page,
Expand All @@ -23,7 +26,10 @@
it "assigns a reviewer" do
given_i_am_authorized_as_an_assessor_user

when_i_visit_the(:assign_reviewer_page, application_id: application_form.id)
when_i_visit_the(
:assessor_assign_reviewer_page,
application_id: application_form.id,
)
and_i_select_a_reviewer
then_i_see_the(
:assessor_application_page,
Expand All @@ -35,7 +41,10 @@
it "requires permission" do
given_i_am_authorized_as_a_support_user

when_i_visit_the(:assign_assessor_page, application_id: application_form.id)
when_i_visit_the(
:assessor_assign_assessor_page,
application_id: application_form.id,
)
then_i_see_the_forbidden_page
end

Expand All @@ -46,8 +55,8 @@ def given_there_is_an_application_form
end

def and_i_select_an_assessor
assign_assessor_page.assessors.second.input.click
assign_assessor_page.continue_button.click
assessor_assign_assessor_page.assessors.second.input.click
assessor_assign_assessor_page.continue_button.click
end

def and_the_assessor_is_assigned_to_the_application_form
Expand All @@ -57,12 +66,12 @@ def and_the_assessor_is_assigned_to_the_application_form
end

def when_i_visit_the_assign_reviewer_page
assign_reviewer_page.load(application_id: application_form.id)
assessor_assign_reviewer_page.load(application_id: application_form.id)
end

def and_i_select_a_reviewer
assign_reviewer_page.reviewers.second.input.click
assign_reviewer_page.continue_button.click
assessor_assign_reviewer_page.reviewers.second.input.click
assessor_assign_reviewer_page.continue_button.click
end

def and_the_assessor_is_assigned_as_reviewer_to_the_application_form
Expand Down
10 changes: 5 additions & 5 deletions spec/system/assessor_interface/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
given_the_service_is_open
given_staff_exist

when_i_visit_the(:applications_page)
then_i_see_the(:login_page)
when_i_visit_the(:assessor_applications_page)
then_i_see_the(:assessor_login_page)

when_i_login
then_i_see_the(:applications_page)
then_i_see_the(:assessor_applications_page)

when_i_click_sign_out
then_i_see_the(:staff_signed_out_page)
Expand All @@ -24,10 +24,10 @@ def given_staff_exist
end

def when_i_login
login_page.submit(email: "[email protected]", password: "password")
assessor_login_page.submit(email: "[email protected]", password: "password")
end

def when_i_click_sign_out
applications_page.header.sign_out_link.click
assessor_applications_page.header.sign_out_link.click
end
end
6 changes: 3 additions & 3 deletions spec/system/assessor_interface/change_work_history_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
given_i_am_authorized_as_a_user(manager)

when_i_visit_the(
:check_work_history_page,
:assessor_check_work_history_page,
application_id:,
assessment_id:,
section_id: assessment_section.id,
)
then_i_see_the(:check_work_history_page)
then_i_see_the(:assessor_check_work_history_page)

when_i_click_on_change_from_assessment
then_i_see_the(
Expand Down Expand Up @@ -68,7 +68,7 @@ def given_there_is_an_application_form
end

def when_i_click_on_change_from_assessment
check_work_history_page
assessor_check_work_history_page
.cards
.first
.find_row(key: "Reference contact’s full name")
Expand Down
Loading

0 comments on commit ef4f333

Please sign in to comment.