Module: MessagesReceivedListMethods
- Includes:
- PageObject
- Defined in:
- lib/kuali-sakai-common-lib/messages.rb
Overview
The page showing the list of received messages.
Instance Method Summary collapse
-
#alert_message_text ⇒ Object
Grabs the text from the message box that appears after doing some action.
-
#check_message(subject) ⇒ Object
Checks the checkbox for the specified message in the list.
- #compose_message ⇒ Object
-
#header ⇒ Object
Returns a string consisting of the content of the page header–or “breadcrumb”, as it’s called.
-
#mark_read ⇒ Object
Clicks the “Mark Read” link, then reinstantiates the class because the page partially refreshes.
-
#messages ⇒ Object
Clicks the “Messages” breadcrumb link to return to the top level of Messages.
-
#move ⇒ Object
Clicks the Move link, then instantiates the MoveMessageTo Class.
-
#open_message(subject) ⇒ Object
Clicks on the specified message subject then instantiates the MessageView class.
-
#subjects ⇒ Object
Creates an array consisting of the message subject lines.
-
#unread_messages ⇒ Object
Returns an Array object containing the subjects of the displayed messages that are marked unread.
Instance Method Details
#alert_message_text ⇒ Object
Grabs the text from the message box that appears after doing some action.
Use this method to simplify writing Test::Unit asserts
171 172 173 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 171 def frm.span(:class=>"success").text end |
#check_message(subject) ⇒ Object
Checks the checkbox for the specified message in the list.
Will throw an error if the specified subject is not present.
180 181 182 183 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 180 def (subject) index=subjects.index(subject) frm.checkbox(:name=>"prefs_pvt_form:pvtmsgs:#{index}:_id122").set end |
#compose_message ⇒ Object
153 154 155 156 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 153 def frm.link(:text=>"Compose Message").click ComposeMessage.new(@browser) end |
#header ⇒ Object
Returns a string consisting of the content of the page header–or “breadcrumb”, as it’s called.
141 142 143 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 141 def header frm.div(:class=>"breadCrumb specialLink").text end |
#mark_read ⇒ Object
Clicks the “Mark Read” link, then reinstantiates the class because the page partially refreshes.
188 189 190 191 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 188 def mark_read frm.link(:text=>"Mark Read").click MessagesReceivedList.new(@browser) end |
#messages ⇒ Object
Clicks the “Messages” breadcrumb link to return to the top level of Messages. Then instantiates the Messages class.
148 149 150 151 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 148 def frm.link(:text=>"Messages").click Messages.new(@browser) end |
#move ⇒ Object
Clicks the Move link, then instantiates the MoveMessageTo Class.
213 214 215 216 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 213 def move frm.link(:text, "Move").click MoveMessageTo.new(@browser) end |
#open_message(subject) ⇒ Object
Clicks on the specified message subject then instantiates the MessageView class.
160 161 162 163 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 160 def (subject) frm.link(:text, /#{Regexp.escape(subject)}/).click MessageView.new(@browser) end |
#subjects ⇒ Object
Creates an array consisting of the message subject lines.
195 196 197 198 199 200 201 202 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 195 def subjects titles = [] = frm.table(:id=>"prefs_pvt_form:pvtmsgs") 1.upto(.rows.size-1) do |x| titles << .row(:index=>x).a.title end return titles end |
#unread_messages ⇒ Object
Returns an Array object containing the subjects of the displayed messages that are marked unread.
207 208 209 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 207 def # TODO - Write this method end |