Module: SyllabusEditMethods

Defined in:
lib/kuali-sakai-common-lib/syllabus.rb

Instance Method Summary collapse

Instance Method Details

#addObject

Clicks the “Add” button, then instantiates the AddEditSyllabusItem Class.



29
30
31
32
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 29

def add
  frm.link(:text=>"Add").click
  AddEditSyllabusItem.new(@browser)
end

#check_title(title) ⇒ Object

Clicks the checkbox for the item with the specified title.



46
47
48
49
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 46

def check_title(title)
  index=syllabus_titles.index(title)
  frm.checkbox(:index=>index).set
end

#headerObject

Returns the text of the page header



40
41
42
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 40

def header
  frm.div(:class=>"portletBody").h3.text
end

#move_title_down(title) ⇒ Object



57
58
59
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 57

def move_title_down(title)
  #FIXME
end

#move_title_up(title) ⇒ Object



52
53
54
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 52

def move_title_up(title)
  #FIXME
end

#open_item(title) ⇒ Object

Opens the specified item and instantiates the XXXX Class.



69
70
71
72
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 69

def open_item(title)
  frm.link(:text=>title).click
  Class.new(@browser)
end

#redirectObject



34
35
36
37
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 34

def redirect
  frm.link(:text=>"Redirect").click
  SyllabusRedirect.new(@browser)
end

#syllabus_titlesObject

Returns an array containing the titles of the syllabus items displayed on the page.



76
77
78
79
80
81
82
83
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 76

def syllabus_titles
  titles = []
  s_table = frm.table(:class=>"listHier lines nolines")
  1.upto(s_table.rows.size-1) do |x|
    titles << s_table[x][0].text
  end
  return titles
end

#updateObject

Clicks the “Update” button and instantiates the DeleteSyllabusItems Class.



63
64
65
66
# File 'lib/kuali-sakai-common-lib/syllabus.rb', line 63

def update
  frm.button(:value=>"Update").click
  DeleteSyllabusItems.new(@browser)
end