Class: QuestionPoolsList

Inherits:
AssessmentsBase show all
Defined in:
lib/sambal-cle/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, button, damballa, frame_element, link

Instance Method Details

#add_new_poolObject

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



675
676
677
678
679
680
681
682
# File 'lib/sambal-cle/page_objects/assessments.rb', line 675

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.



705
706
707
708
# File 'lib/sambal-cle/page_objects/assessments.rb', line 705

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



669
670
671
# File 'lib/sambal-cle/page_objects/assessments.rb', line 669

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

#importObject

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



698
699
700
701
# File 'lib/sambal-cle/page_objects/assessments.rb', line 698

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.



686
687
688
689
690
691
692
693
694
# File 'lib/sambal-cle/page_objects/assessments.rb', line 686

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