Module: AssignmentsPreviewMethods

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

Overview

Page that appears when you click to preview an Assignment

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.page_elements(identifier) ⇒ Object



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 427

def self.page_elements(identifier)
  in_frame(identifier) do |frame|
    hidden_field(:assignment_id, :name=>"assignmentId", :frame=>frame)
    link(:assignment_list, :text=>"Assignment List", :frame=>frame)
    link(:permissions, :text=>"Permissions", :frame=>frame)
    link(:options, :text=>"Options", :frame=>frame)
    link(:hide_assignment, :href=>/doHide_preview_assignment_assignment/, :frame=>frame)
    link(:show_assignment, :href=>/doShow_preview_assignment_assignment/, :frame=>frame)
    link(:hide_student_view, :href=>/doHide_preview_assignment_student_view/, :frame=>frame)
    link(:show_student_view, :href=>/doShow_preview_assignment_student_view/, :frame=>frame)
    button(:edit, :name=>"revise", :frame=>frame)
    button(:save_draft, :name=>"save", :frame=>frame)
    button(:done, :name=>"done", :frame=>frame)
  end
end

Instance Method Details

#assignment_instructionsObject

Grabs the Assignment Instructions text.



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

def assignment_instructions
  frm.div(:class=>"textPanel").text
end

#back_to_listObject



408
409
410
411
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 408

def back_to_list
  frm.button(:value=>"Back to list").click
  AssignmentsList.new(@browser)
end

#cancelObject

Clicks the Cancel button and instantiates the AssignmentsList Class.



422
423
424
425
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 422

def cancel
  frm.button(:value=>"Cancel").click
  AssignmentsList.new(@browser)
end

#headerObject

Returns the text content of the page header



383
384
385
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 383

def header
  frm.div(:class=>"portletBody").h3.text
end

#instructor_commentsObject

Grabs the instructor comments text.



403
404
405
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 403

def instructor_comments
  frm.div(:class=>"portletBody").div(:class=>"textPanel", :index=>2).text
end

#item_summaryObject

Returns a hash object containing the contents of the Item Summary table. The hash’s Key is the header column and the value is the content column.



389
390
391
392
393
394
395
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 389

def item_summary
  hash = {}
  frm.table(:class=>"itemSummary").rows.each do |row|
    hash.store(row.th.text, row.td.text)
  end
  return hash
end

#postObject

Clicks the Post button, then instantiates the AssignmentsList page class.



415
416
417
418
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 415

def post
  frm.button(:name=>"post").click
  AssignmentsList.new(@browser)
end