Module: FolderListMethods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/messages.rb

Instance Method Summary collapse

Instance Method Details

#alert_message_textObject

Grabs the text from the message box that appears after doing some action.

Use this method to simplify writing Test::Unit asserts



246
247
248
# File 'lib/kuali-sakai-common-lib/messages.rb', line 246

def alert_message_text
  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.



255
256
257
258
# File 'lib/kuali-sakai-common-lib/messages.rb', line 255

def check_message(subject)
  index=subjects.index(subject)
  frm.checkbox(:name=>"prefs_pvt_form:pvtmsgs:#{index}:_id122").set
end

#compose_messageObject



228
229
230
231
# File 'lib/kuali-sakai-common-lib/messages.rb', line 228

def compose_message
  frm.link(:text=>"Compose Message").click
  ComposeMessage.new(@browser)
end

#mark_readObject

Clicks the “Mark Read” link, then reinstantiates the class because the page partially refreshes.



272
273
274
275
# File 'lib/kuali-sakai-common-lib/messages.rb', line 272

def mark_read
  frm.link(:text=>"Mark Read").click
  MessagesReceivedList.new(@browser)
end

#messagesObject

Clicks the Messages link in the Breadcrumb bar at the top of the page, then instantiates the Messages class



264
265
266
267
# File 'lib/kuali-sakai-common-lib/messages.rb', line 264

def messages
  frm.link(:text=>"Messages").click
  Messages.new(@browser)
end

#moveObject



292
293
294
295
# File 'lib/kuali-sakai-common-lib/messages.rb', line 292

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.



235
236
237
238
# File 'lib/kuali-sakai-common-lib/messages.rb', line 235

def open_message(subject)
  frm.link(:text, /#{Regexp.escape(subject)}/).click
  MessageView.new(@browser)
end

#subjectsObject

Creates an array consisting of the message subject lines.



279
280
281
282
283
284
285
286
# File 'lib/kuali-sakai-common-lib/messages.rb', line 279

def subjects
  titles = []
  messages = frm.table(:id=>"prefs_pvt_form:pvtmsgs")
  1.upto(messages.rows.size-1) do |x|
    titles << messages.row(:index=>x).a.title
  end
  return titles
end

#unread_messagesObject



288
289
290
# File 'lib/kuali-sakai-common-lib/messages.rb', line 288

def unread_messages
  # TODO - Write this method
end