Class: SelectSchemaFile

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

Instance Method Summary collapse

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

#continueObject



103
104
105
106
107
# File 'lib/sakai-cle-test-api/page_objects/forms.rb', line 103

def continue
  frm.button(:value=>"Continue").click
  frm.frame(:id, "instruction___Frame").td(:id, "xEditingArea").wait_until_present
  AddForm.new(@browser)
end

#file_namesObject

FIXME



92
93
94
95
96
97
98
99
100
101
# File 'lib/sakai-cle-test-api/page_objects/forms.rb', line 92

def file_names #FIXME
  names = []
  resources_table = frm.table(:class=>"listHier lines")
  1.upto(resources_table.rows.size-1) do |x|
    if resources_table[x][0].link.exist? && resources_table[x][0].a(:index=>0).title=~/File Type/
      names << resources_table[x][0].text
    end
  end
  return names
end

#open_folder(name) ⇒ Object



81
82
83
84
# File 'lib/sakai-cle-test-api/page_objects/forms.rb', line 81

def open_folder(name)
  frm.link(:text=>name).click
  SelectSchemaFile.new(@browser)
end

#select_file(filename) ⇒ Object



86
87
88
89
90
# File 'lib/sakai-cle-test-api/page_objects/forms.rb', line 86

def select_file(filename)
  index = file_names.index(filename)
  frm.table(:class=>"listHier lines").tr(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click
  SelectSchemaFile.new(@browser)
end

#show_other_sitesObject



76
77
78
79
# File 'lib/sakai-cle-test-api/page_objects/forms.rb', line 76

def show_other_sites
  frm.link(:title=>"Show other sites").click
  SelectSchemaFile.new(@browser)
end