Class: AssignmentsPreview

Inherits:
AssignmentsBase show all
Defined in:
lib/sakai-cle-test-api/page_objects/assignments.rb

Overview

Page that appears when you click to preview an Assignment

Instance Method Summary collapse

Methods inherited from AssignmentsBase

listview_elements, menu_elements

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageMaker

Instance Method Details

#assignment_instructionsObject

Grabs the Assignment Instructions text.



366
367
368
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 366

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

#back_to_listObject



376
377
378
379
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 376

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.



390
391
392
393
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 390

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

#headerObject

Returns the text content of the page header



351
352
353
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 351

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

#instructor_commentsObject

Grabs the instructor comments text.



371
372
373
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 371

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.



357
358
359
360
361
362
363
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 357

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.



383
384
385
386
# File 'lib/sakai-cle-test-api/page_objects/assignments.rb', line 383

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