Class: Comments

Inherits:
Object
  • Object
show all
Includes:
DocButtons, GlobalMethods, HeaderBar, HeaderFooterBar, LeftMenuBar, PageObject
Defined in:
lib/sakai-oae-test-api/page_classes.rb

Overview

Methods related to the Comments “Area” in a Course/Group.

Instance Method Summary collapse

Methods included from DocButtons

#add_page, #edit_page, #page_revisions

Methods included from PageObject

#method_missing, #name_li, #name_link

Methods included from HeaderBar

#add_content, #categories, #change_picture, #join_group, #join_requests, #manage_participants, #message, #page_title, #request_to_join_group, #settings

Methods included from LeftMenuBar

#add_new_area, #change_title_of, #delete_page, #expand, #menu_available?, #permissions_for_page, #public_pages, #view_profile_of_page

Methods included from HeaderFooterBar

#acknowledgements, #add_collection, #add_content, #browse_footer, #browse_footer_link, #change_language, #change_location, #click_link, #explore_footer, #explore_footer_link, #login, #messages_container, #my_account, #sign_out, #sign_up, #toggle_collector, #user_agreement

Methods included from GlobalMethods

#close_notification, #menu_item, #open_page, #view_person

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageObject

Instance Method Details

#delete(comment) ⇒ Object

Deletes the specified comment.



1690
1691
1692
1693
1694
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1690

def delete(comment)
  comment.gsub!("\n", " ")
  self.div(:text=>comment).parent.button(:text=>"Delete").click
  self.wait_for_ajax(2) #wait_until { self.button(:text=>"Undelete").present? }
end

#edit(comment) ⇒ Object

Clicks the “Edit button” for the specified comment.



1683
1684
1685
1686
1687
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1683

def edit(comment)
  comment.gsub!("\n", " ")
  self.p(:text=>comment).parent.parent.button(:text=>"Edit").click
  self.wait_for_ajax(2) #wait_until { self.textarea(:title=>"Edit your comment").present? }
end

#edit_commentObject

Clicks the “Edit comment” button.



1677
1678
1679
1680
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1677

def edit_comment
  self.button(:text=>"Edit comment").click
  self.wait_for_ajax(2) #wait_until { self.textarea(:title=>"Edit your comment").present? == false }
end

#submit_commentObject

Clicks the “Submit comment” button.



1671
1672
1673
1674
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1671

def submit_comment
  self.button(:text=>"Submit comment").click
  self.wait_for_ajax(2) #wait_until { self.text.include? "about 0 seconds ago" }
end