Class: JForums

Inherits:
Object
  • Object
show all
Includes:
JForumsResources, PageObject, ToolsMenu
Defined in:
lib/sakai-cle-test-api/site_page_elements.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 included from ToolsMenu

#account, #administration_workspace, #aliases, #announcements, #assessments, #assignments, #basic_lti, #blogger, #blogs, #calendar, #chat_room, #discussion_forums, #drop_box, #email_archive, #evaluation_system, #feedback, #forms, #forums, #frm, #glossary, #gradebook, #gradebook2, #home, #job_scheduler, #lessons, #logout, #matrices, #media_gallery, #messages, #my_workspace, #news, #open_my_site_by_id, #open_my_site_by_name, #podcasts, #polls, #portfolio_templates, #portfolios, #profile, #profile2, #reset, #resources, #roster, #sections, #site_editor, #site_management_search, #site_setup, #sites, #styles, #syllabus, #tests_and_quizzes, #user_membership, #users, #web_content, #wiki

Instance Method Details

#forum_listObject

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



2383
2384
2385
2386
2387
2388
2389
2390
2391
# File 'lib/sakai-cle-test-api/site_page_elements.rb', line 2383

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.



2370
2371
2372
2373
# File 'lib/sakai-cle-test-api/site_page_elements.rb', line 2370

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.



2377
2378
2379
2380
# File 'lib/sakai-cle-test-api/site_page_elements.rb', line 2377

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.



2395
2396
2397
# File 'lib/sakai-cle-test-api/site_page_elements.rb', line 2395

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