Module: FolderListMethods
- Includes:
- PageObject
- Defined in:
- lib/kuali-sakai-common-lib/messages.rb
Class Method Summary collapse
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
-
#mark_read ⇒ Object
Clicks the “Mark Read” link, then reinstantiates the class because the page partially refreshes.
-
#messages ⇒ Object
Clicks the Messages link in the Breadcrumb bar at the top of the page, then instantiates the Messages class.
- #move ⇒ Object
-
#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
Class Method Details
.page_elements(identifier) ⇒ Object
300 301 302 303 304 305 306 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 300 def self.page_elements(identifier) in_frame(identifier) do |frame| select_list(:view, :id=>"prefs_pvt_form:viewlist", :frame=>frame) link(:check_all, :text=>"Check All", :frame=>frame) link(:delete, :text=>"Delete", :frame=>frame) end end |
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
249 250 251 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 249 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.
258 259 260 261 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 258 def (subject) index=subjects.index(subject) frm.checkbox(:name=>"prefs_pvt_form:pvtmsgs:#{index}:_id122").set end |
#compose_message ⇒ Object
231 232 233 234 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 231 def frm.link(:text=>"Compose Message").click ComposeMessage.new(@browser) end |
#mark_read ⇒ Object
Clicks the “Mark Read” link, then reinstantiates the class because the page partially refreshes.
275 276 277 278 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 275 def mark_read frm.link(:text=>"Mark Read").click MessagesReceivedList.new(@browser) end |
#messages ⇒ Object
Clicks the Messages link in the Breadcrumb bar at the top of the page, then instantiates the Messages class
267 268 269 270 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 267 def frm.link(:text=>"Messages").click Messages.new(@browser) end |
#move ⇒ Object
295 296 297 298 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 295 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.
238 239 240 241 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 238 def (subject) frm.link(:text, /#{Regexp.escape(subject)}/).click MessageView.new(@browser) end |
#subjects ⇒ Object
Creates an array consisting of the message subject lines.
282 283 284 285 286 287 288 289 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 282 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
291 292 293 |
# File 'lib/kuali-sakai-common-lib/messages.rb', line 291 def # TODO - Write this method end |