Module: AddEditSectionsMethods
- Includes:
- PageObject
- Defined in:
- lib/kuali-sakai-common-lib/sections.rb
Overview
Methods in this class currently do not support adding multiple instances of sections simultaneously. That will be added at some future time. The same goes for adding days with different meeting times. This will hopefully be supported in the future.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_sections ⇒ Object
Clicks the Add Sections button then instantiates the Sections Class, unless there’s an Alert message, in which case it will reinstantiate the class.
- #alert_text ⇒ Object
-
#check_days(array) ⇒ Object
This method takes an array object containing strings of the days of the week and then clicks the appropriate checkboxes, based on those strings.
-
#update ⇒ Object
The Update button is only available when editing an existing Sections record.
Class Method Details
.page_elements(identifier) ⇒ Object
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/kuali-sakai-common-lib/sections.rb', line 157 def self.page_elements(identifier) in_frame(identifier) do |frame| select_list(:category, :id=>/SectionsForm:category/, :frame=>frame) text_field(:name, :id=>/SectionsForm:sectionTable:0:titleInput/, :frame=>frame) checkbox(:monday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/, :frame=>frame) checkbox(:tuesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/, :frame=>frame) checkbox(:wednesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/, :frame=>frame) checkbox(:thursday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/, :frame=>frame) checkbox(:friday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/, :frame=>frame) checkbox(:saturday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/, :frame=>frame) checkbox(:sunday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/, :frame=>frame) text_field(:start_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:startTime/, :frame=>frame) text_field(:end_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:endTime/, :frame=>frame) text_field(:location, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:location/, :frame=>frame) (:startAM) { |page| page.(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>0, :frame=>frame) } (:startPM) { |page| page.(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>1, :frame=>frame) } (:endAM) { |page| page.(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>0, :frame=>frame) } (:endPM) { |page| page.(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>1, :frame=>frame) } (:unlimited_students) { |page| page.(:name=>/SectionsForm:sectionTable:0:limit/, :index=>0, :frame=>frame) } (:limited_students) { |page| page.(:name=>/SectionsForm:sectionTable:0:limit/, :index=>1, :frame=>frame) } text_field(:max_students, :id=>/SectionsForm:sectionTable:0:maxEnrollmentInput/, :frame=>frame) end end |
Instance Method Details
#add_sections ⇒ Object
Clicks the Add Sections button then instantiates the Sections Class, unless there’s an Alert message, in which case it will reinstantiate the class.
121 122 123 124 125 126 127 128 |
# File 'lib/kuali-sakai-common-lib/sections.rb', line 121 def add_sections frm.(:value=>"Add Sections").click if frm.div(:class=>"validation").exist? AddEditSections.new(@browser) else Sections.new(@browser) end end |
#alert_text ⇒ Object
130 131 132 |
# File 'lib/kuali-sakai-common-lib/sections.rb', line 130 def alert_text frm.div(:class=>"validation").text end |
#check_days(array) ⇒ Object
This method takes an array object containing strings of the days of the week and then clicks the appropriate checkboxes, based on those strings.
147 148 149 150 151 152 153 154 155 |
# File 'lib/kuali-sakai-common-lib/sections.rb', line 147 def check_days(array) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/).set if array.include?(/mon/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/).set if array.include?(/tue/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/).set if array.include?(/wed/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/).set if array.include?(/thu/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/).set if array.include?(/fri/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/).set if array.include?(/sat/i) frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/).set if array.include?(/sun/i) end |
#update ⇒ Object
The Update button is only available when editing an existing Sections record.
135 136 137 138 139 140 141 142 |
# File 'lib/kuali-sakai-common-lib/sections.rb', line 135 def update frm.(:value=>"Update").click if frm.div(:class=>"validation").exist? AddEditSections.new(@browser) else Sections.new(@browser) end end |