Class: Sections

Inherits:
SectionsBase show all
Defined in:
lib/sakai-cle-test-api/page_objects/sections.rb

Overview

Topmost page for Sections in Site Management

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

#alert_textObject



94
95
96
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 94

def alert_text
  frm.div(:class=>"validation").text
end

#assign_students(title) ⇒ Object



39
40
41
42
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 39

def assign_students(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign Students/).click
  AssignStudents.new(@browser)
end

#assign_tas(title) ⇒ Object



34
35
36
37
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 34

def assign_tas(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign TAs/).click
  AssignTeachingAssistants.new(@browser)
end

#availability_for(title) ⇒ Object



90
91
92
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 90

def availability_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[6].text
end

#check(title) ⇒ Object



44
45
46
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 44

def check(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>/remove/).set
end

#current_size_for(title) ⇒ Object



85
86
87
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 85

def current_size_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[5].text
end

#days_for(title) ⇒ Object



70
71
72
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 70

def days_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[2].text
end

#edit(title) ⇒ Object

Clicks the Edit link for the specified section. Then instantiates the AddEditSections class.



29
30
31
32
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 29

def edit(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Edit/).click
  AddEditSections.new(@browser)
end

#location_for(title) ⇒ Object



80
81
82
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 80

def location_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[4].text
end

#remove_sectionsObject



58
59
60
61
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 58

def remove_sections
  frm.button(:value=>"Remove Sections").click
  Sections.new(@browser)
end

#section_namesObject



48
49
50
51
52
53
54
55
56
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 48

def section_names
  names = []
  frm.table(:class=>/listHier/).rows.each do |row|
    if row.td(:class=>"leftIndent").exist?
      names << row.td(:class=>"leftIndent").div(:index=>0).text
    end
  end
  return names
end

#success_textObject



98
99
100
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 98

def success_text
  frm.div(:class=>"success").text
end

#tas_for(title) ⇒ Object

Returns the text of the Teach Assistant cell for the specified Section.



65
66
67
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 65

def tas_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[1].text
end

#time_for(title) ⇒ Object



75
76
77
# File 'lib/sakai-cle-test-api/page_objects/sections.rb', line 75

def time_for(title)
  frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[3].text
end