Module: MessagesDeletedListMethods

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.page_elements(identifier) ⇒ Object



396
397
398
399
400
# File 'lib/kuali-sakai-common-lib/messages.rb', line 396

def self.page_elements(identifier)
  in_frame(identifier) do |frame|
    link(:check_all, :text=>"Check All", :frame=>frame)
  end
end

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



361
362
363
# File 'lib/kuali-sakai-common-lib/messages.rb', line 361

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.



381
382
383
384
# File 'lib/kuali-sakai-common-lib/messages.rb', line 381

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

#compose_messageObject



350
351
352
353
# File 'lib/kuali-sakai-common-lib/messages.rb', line 350

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

#deleteObject



391
392
393
394
# File 'lib/kuali-sakai-common-lib/messages.rb', line 391

def delete
  frm.link(:text=>"Delete").click
  MessageDeleteConfirmation.new(@browser)
end

#headerObject

Returns a string consisting of the content of the page header–or “breadcrumb”, as it’s called.



338
339
340
# File 'lib/kuali-sakai-common-lib/messages.rb', line 338

def header
  frm.div(:class=>"breadCrumb specialLink").text
end

#messagesObject

Clicks the “Messages” breadcrumb link to return to the top level of Messages. Then instantiates the Messages class.



345
346
347
348
# File 'lib/kuali-sakai-common-lib/messages.rb', line 345

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

#moveObject



386
387
388
389
# File 'lib/kuali-sakai-common-lib/messages.rb', line 386

def move
  frm.link(:text, "Move").click
  MoveMessageTo.new(@browser)
end

#subjectsObject

Creates an array consisting of the message subject lines.



367
368
369
370
371
372
373
374
# File 'lib/kuali-sakai-common-lib/messages.rb', line 367

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