Class: PrivateMessages
- Includes:
- JForumsResources
- Defined in:
- lib/sakai-cle-test-api/page_objects/jforums.rb
Overview
The page where users go to read their private messages in the Discussion Forums.
Instance Method Summary collapse
-
#new_pm ⇒ Object
Clicks the “New PM” button, then instantiates the NewPrivateMessage Class.
-
#open_message(title) ⇒ Object
Clicks to open the specified message, then instantiates the ViewPM Class.
-
#pm_subjects ⇒ Object
Collects all subject text strings of the listed private messages and returns them in an Array.
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
#new_pm ⇒ Object
Clicks the “New PM” button, then instantiates the NewPrivateMessage Class.
351 352 353 354 |
# File 'lib/sakai-cle-test-api/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/sakai-cle-test-api/page_objects/jforums.rb', line 358 def (title) frm.link(:class=>"topictitle", :text=>title).click ViewPM.new(@browser) end |
#pm_subjects ⇒ Object
Collects all subject text strings of the listed private messages and returns them in an Array.
365 366 367 368 369 370 |
# File 'lib/sakai-cle-test-api/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 |