From 9a9981f9b654d459eab930069be23ae7e57414e8 Mon Sep 17 00:00:00 2001 From: Avin Hurry Date: Wed, 10 Jul 2024 15:14:27 +0100 Subject: [PATCH] [1755] Put back page object --- .../publish/course_requirement_edit.rb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/support/page_objects/publish/course_requirement_edit.rb diff --git a/spec/support/page_objects/publish/course_requirement_edit.rb b/spec/support/page_objects/publish/course_requirement_edit.rb new file mode 100644 index 0000000000..0e7495e14a --- /dev/null +++ b/spec/support/page_objects/publish/course_requirement_edit.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative '../sections/error_link' +require_relative '../sections/copy_content' + +module PageObjects + module Publish + class CourseRequirementEdit < PageObjects::Base + set_url '/publish/organisations/{provider_code}/{recruitment_cycle_year}/courses/{course_code}/requirements' + + sections :errors, Sections::ErrorLink, '.govuk-error-summary__list li>a' + + element :copy_content_warning, '[data-qa="copy-course-warning"]' + element :personal_qualities, '#publish-course-requirement-form-personal-qualities-field' + element :other_requirements, '#publish-course-requirement-form-other-requirements-field' + element :use_content, '[data-qa="course__use_content"]' + + section :copy_content, Sections::CopyContent + + element :submit, 'button.govuk-button[type="submit"]' + + def error_messages + errors.map(&:text) + end + end + end +end