Class: PrivateMessages

Inherits:
BasePage
  • Object
show all
Includes:
JForumsResources
Defined in:
lib/sambal-cle/page_objects/jforums.rb

Overview

The page where users go to read their private messages in the 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

Instance Method Details

#new_pmObject

Clicks the “New PM” button, then instantiates the NewPrivateMessage Class.



351
352
353
354
# File 'lib/sambal-cle/page_objects/jforums.rb', line 351

def new_pm
  frm.image(:alt=>"New PM").fire_event("onclick")
  NewPrivateMessage.new(@browser)
end

#open_message(title) ⇒ Object

Clicks to open the specified message, then instantiates the ViewPM Class.



358
359
360
361
# File 'lib/sambal-cle/page_objects/jforums.rb', line 358

def open_message(title)
  frm.link(:class=>"topictitle", :text=>title).click
  ViewPM.new(@browser)
end

#pm_subjectsObject

Collects all subject text strings of the listed private messages and returns them in an Array.



365
366
367
368
369
370
# File 'lib/sambal-cle/page_objects/jforums.rb', line 365

def pm_subjects
  anchor_objects = frm.links.find_all { |link| link.href=~/pm.read.+page/ }
  subjects = []
  anchor_objects.each { |link| subjects << link.text }
  return subjects
end