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.



1587
1588
1589
1590
1591
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1587

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.



1618
1619
1620
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1618

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.



1612
1613
1614
1615
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1612

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.



1631
1632
1633
1634
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1631

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.



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

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.



1599
1600
1601
1602
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1599

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.



1625
1626
1627
1628
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1625

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