Class: JForums

Inherits:
BasePage show all
Includes:
JForumsResources
Defined in:
lib/sakai-cle-test-api/page_objects/jforums.rb

Overview

The topmost page in Discussion Forums

Instance Method Summary collapse

Methods included from JForumsResources

#discussion_home, #manage, #member_listing, #my_bookmarks, #my_profile, #private_messages, #search

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

#forum_listObject

Returns an array containing the names of the Forums listed on the page.



81
82
83
84
85
86
87
88
89
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 81

def forum_list
  list = frm.table(:class=>"forumline").links.map do |link|
    if link.href =~ /forums\/show\//
      link.text
    end
  end
  list.compact!
  return list
end

#open_forum(forum_name) ⇒ Object

Clicks on the supplied forum name Then instantiates the DiscussionForum class.



68
69
70
71
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 68

def open_forum(forum_name)
  frm.link(:text=>forum_name).click
  DiscussionForum.new(@browser)
end

#open_topic(topic_title) ⇒ Object

Clicks the specified Topic and instantiates the ViewTopic Class.



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

def open_topic(topic_title)
  frm.link(:text=>topic_title).click
  ViewTopic.new(@browser)
end

#topic_count(forum_name) ⇒ Object

Returns the displayed count of topics for the specified Forum.



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

def topic_count(forum_name)
  frm.table(:class=>"forumline").row(:text=>/#{Regexp.escape(forum_name)}/)[2].text
end