Class: AddEditSections

Inherits:
SectionsBase show all
Defined in:
lib/sakai-cle-test-api/page_objects/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

Methods inherited from SectionsBase

menu_elements

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageMaker

Instance Method Details

#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.



126
127
128
129
130
131
132
133
134
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 126

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.



114
115
116
117
118
119
120
121
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 114

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