Class: Lessons

Inherits:
LessonsBase show all
Defined in:
lib/sambal-cle/page_objects/lessons.rb

Overview

The Lessons page in a site (“icon-sakai-melete”)

Note that this class is inclusive of both the Instructor/Admin and the Student views of this page many methods will error out if used when in the Student view.

Instance Method Summary collapse

Methods inherited from LessonsBase

menu_elements

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#lessons_listObject

Returns an array of the Module titles displayed on the page.



59
60
61
62
63
64
65
66
67
# File 'lib/sambal-cle/page_objects/lessons.rb', line 59

def lessons_list
  list = []
  lessons_table.links.each do |link|
    if link.id=~/lis.+module.+form:table:.+:(edit|view)Mod/
      list << link.text
    end
  end
  return list
end

#sections_list(module_name) ⇒ Object

Returns and array containing the list of section titles for the specified module.



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/sambal-cle/page_objects/lessons.rb', line 71

def sections_list(module_name)
  list = []
  if lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).exist?
    lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).links.each do |link|
      if link.id=~/Sec/
        list << link.text
      end
    end
  end
  return list
end