Class: QuestionPoolsList

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

Overview

The page with the list of existing Question Pools

Instance Method Summary collapse

Methods inherited from AssessmentsBase

menu_bar_elements, pool_page_elements, question_page_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

#add_new_poolObject

Clicks the Add New Pool link, then instantiates the AddQuestionPool page class.



644
645
646
647
648
649
650
651
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 644

def add_new_pool
  #puts "clicking add new pool..."
  #10.times {frm.link(:text=>"Add New Pool").flash}
  frm.link(:text=>"Add New Pool").click
  #puts "clicked..."
  #frm.text_field(:id=>"questionpool:namefield").wait_until_present(200)
  AddQuestionPool.new(@browser)
end

#assessmentsObject

Clicks the Assessments link and then instantiates the AssessmentsList page class.



674
675
676
677
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 674

def assessments
  frm.link(:text=>"Assessments").click
  AssessmentsList.new(@browser)
end

#edit_pool(name) ⇒ Object

Clicks the edit button, next is the EditQuestionPool page class.

Parameters:

  • name (String)

    the name of the pool you want to edit



638
639
640
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 638

def edit_pool(name)
  frm.span(:text=>name).fire_event("onclick")
end

#importObject

Clicks “Import” and then instantiates the PoolImport page class.



667
668
669
670
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 667

def import
  frm.link(:text=>"Import").click
  PoolImport.new(@browser)
end

#pool_namesObject

Returns an array containing strings of the pool names listed on the page.



655
656
657
658
659
660
661
662
663
# File 'lib/sakai-cle-test-api/page_objects/assessments.rb', line 655

def pool_names
  names= []
  frm.table(:id=>"questionpool:TreeTable").rows.each do | row |
    if row.span(:id=>/questionpool.+poolnametext/).exist?
      names << row.span(:id=>/questionpool.+poolnametext/).text
    end
  end
  return names
end