Class: ViewTopic

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

Overview

Viewing a Topic/Message

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

#message_text(message_number) ⇒ Object

Gets the message text for the specified message (not zero-based). Useful for verification.



263
264
265
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 263

def message_text(message_number)
  frm.span(:class=>"postbody", :index=>message_number.to_i-1).text
end

#post_replyObject

Clicks the Post Reply button, then instantiates the NewTopic Class.



269
270
271
272
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 269

def post_reply
  frm.image(:alt=>"Post Reply").fire_event("onclick")
  NewTopic.new(@browser)
end

#quick_replyObject

Clicks the Quick Reply button and does not instantiate any page classes.



276
277
278
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 276

def quick_reply
  frm.image(:alt=>"Quick Reply").fire_event("onclick")
end

#submitObject

Clicks the submit button underneath the Quick Reply box, then re-instantiates the class, due to the page update.



282
283
284
285
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 282

def submit
  frm.button(:value=>"Submit").click
  ViewTopic.new(@browser)
end

#topic_nameObject

Gets the text of the Topic title. Useful for verification.



257
258
259
# File 'lib/sakai-cle-test-api/page_objects/jforums.rb', line 257

def topic_name
  frm.link(:id=>"top", :class=>"maintitle").text
end