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.

Instance Method Summary collapse

Instance Method Details

#add_sectionsObject

Clicks the Add Sections button then instantiates the Sections Class, unless there’s an Alert message, in which case it will reinstantiate the class.



122
123
124
125
126
127
128
129
# File 'lib/kuali-sakai-common-lib/sections.rb', line 122

def add_sections
  frm.button(:value=>"Add Sections").click
  if frm.div(:class=>"validation").exist?
    AddEditSections.new(@browser)
  else
    Sections.new(@browser)
  end
end

#alert_textObject



131
132
133
# File 'lib/kuali-sakai-common-lib/sections.rb', line 131

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.



148
149
150
151
152
153
154
155
156
# File 'lib/kuali-sakai-common-lib/sections.rb', line 148

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

#updateObject

The Update button is only available when editing an existing Sections record.



136
137
138
139
140
141
142
143
# File 'lib/kuali-sakai-common-lib/sections.rb', line 136

def update
  frm.button(:value=>"Update").click
  if frm.div(:class=>"validation").exist?
    AddEditSections.new(@browser)
  else
    Sections.new(@browser)
  end
end