Module: MessagesMethods
- Defined in:
- lib/kuali-sakai-common-lib/messages.rb
Overview
The Messages page for a Site
Instance Method Summary collapse
-
#compose_message ⇒ Object
Clicks the Compose Message button, then instantiates the ComposeMessage class.
- #deleted ⇒ Object
- #draft ⇒ Object
- #folder_settings(folder_name) ⇒ Object
-
#folders ⇒ Object
Gets all the folder names.
- #new_folder ⇒ Object
- #open_folder(foldername) ⇒ Object
- #received ⇒ Object
- #sent ⇒ Object
- #settings ⇒ Object
-
#total_messages_in_folder(folder_name) ⇒ Object
Gets the count of messages in the specified folder and returns it as a string.
-
#unread_messages_in_folder(folder_name) ⇒ Object
Gets the count of unread messages in the specified folder and returns it as a string.
Instance Method Details
#compose_message ⇒ Object
Clicks the Compose Message button, then instantiates the ComposeMessage class.
11 12 13 14 15 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 11 def frm.link(:text=>"Compose Message").click sleep 1 #FIXME ComposeMessage.new(@browser) end |
#deleted ⇒ Object
27 28 29 30 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 27 def deleted frm.link(:text=>"Deleted").click MessagesDeletedList.new(@browser) end |
#draft ⇒ Object
32 33 34 35 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 32 def draft frm.link(:text=>"Draft").click MessagesDraftList.new(@browser) end |
#folder_settings(folder_name) ⇒ Object
76 77 78 79 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 76 def folder_settings(folder_name) frm.table(:class=>"hierItemBlockWrapper").row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Folder Settings").click MessageFolderSettings.new(@browser) end |
#folders ⇒ Object
Gets all the folder names
69 70 71 72 73 74 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 69 def folders links = frm.table(:class=>"hierItemBlockWrapper").links.find_all { |link| link.title != /Folder Settings/ } folders = [] links.each { |link| folders << link.text } return folders end |
#new_folder ⇒ Object
42 43 44 45 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 42 def new_folder frm.link(:text=>"New Folder").click MessagesNewFolder.new(@browser) end |
#open_folder(foldername) ⇒ Object
37 38 39 40 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 37 def open_folder(foldername) frm.link(:text=>foldername).click FolderList.new(@browser) end |
#received ⇒ Object
17 18 19 20 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 17 def received frm.link(:text=>"Received").click MessagesReceivedList.new(@browser) end |
#sent ⇒ Object
22 23 24 25 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 22 def sent frm.link(:text=>"Sent").click MessagesSentList.new(@browser) end |
#settings ⇒ Object
47 48 49 50 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 47 def settings frm.link(:text=>"Settings").click MessagesSettings.new(@browser) end |
#total_messages_in_folder(folder_name) ⇒ Object
Gets the count of messages in the specified folder and returns it as a string
55 56 57 58 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 55 def (folder_name) frm.table(:id=>"msgForum:_id23:0:privateForums").row(:text=>/#{Regexp.escape(folder_name)}/).span(:class=>"textPanelFooter", :index=>0).text =~ /\d+/ return $~.to_s end |
#unread_messages_in_folder(folder_name) ⇒ Object
Gets the count of unread messages in the specified folder and returns it as a string
63 64 65 66 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 63 def (folder_name) frm.table(:id=>"msgForum:_id23:0:privateForums").row(:text=>/#{Regexp.escape(folder_name)}/).span(:text=>/unread/).text =~ /\d+/ return $~.to_s end |