Class: Discussions

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 Discussions “Area” in a Group/Course.

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

#add_topicObject

Clicks the “Add topic” button.



1603
1604
1605
1606
1607
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1603

def add_topic
  self.button(:id=>"discussion_add_topic").click
  self.wait_for_ajax(2) #
  #@browser.wait_until { @browser.h1(:class=>"discussion_topic_subject").parent.button(:text=>"Reply").present? }
end

#delete(message_text) ⇒ Object

Clicks the “Delete” button for a specified message.



1634
1635
1636
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1634

def delete(message_text)
  self.span(:class=>"discussion_post_message", :text=>message_text).parent.parent.button(:text=>"Delete").click
end

#edit(message_text) ⇒ Object

Clicks the “Edit” button for the specified message.



1628
1629
1630
1631
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1628

def edit(message_text)
  self.span(:class=>"discussion_post_message", :text=>message_text).parent.parent.button(:text=>"Edit").click
  self.wait_until { self.textarea(:name=>"discussion_topic_reply_text", :text=>message_text).present? }
end

#hide_replies(topic_title) ⇒ Object

Clicks the button that collapses an expanded message thread.



1647
1648
1649
1650
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1647

def hide_replies(topic_title)
  self.h1(:class=>"discussion_topic_subject", :text=>topic_title).parent.button(:class=>"discussion_show_topic_replies s3d-button s3d-link-button").click
  
end

#quote(message_text) ⇒ Object

Clicks the “Quote” button for the specified message.



1621
1622
1623
1624
1625
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1621

def quote(message_text)
  self.span(:class=>"discussion_post_message", :text=>message_text).parent.parent.button(:text=>"Quote").fire_event "onclick"
  self.wait_for_ajax(2) #
  #self.wait_until { self.textarea(:name=>"quoted_text", :text=>message_text).present? }
end

#reply_to(message_title) ⇒ Object

Clicks the “Reply” button for the specified message.



1615
1616
1617
1618
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1615

def reply_to(message_title)
  self.h1(:class=>"discussion_topic_subject", :text=>message_title).parent.button(:text=>"Reply").click
  self.wait_until { self.h1(:class=>"discussion_topic_subject", :text=>message_title).parent.text_field(:id=>"discussion_topic_reply_text").present? }
end

#view_replies(topic_title) ⇒ Object

Clicks the button that expands the thread to view the replies.



1641
1642
1643
1644
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1641

def view_replies(topic_title)
  self.h1(:class=>"discussion_topic_subject", :text=>topic_title).parent.button(:class=>"discussion_show_topic_replies s3d-button s3d-link-button").click
  
end