Class: GlossaryFileUpload

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

Overview

The file upload page for Glossary importing

Constant Summary collapse

@@filex =
0

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

#add_another_fileObject



113
114
115
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 113

def add_another_file
  frm.link(:text=>"Add Another File").click
end

#file_to_upload(file_name, file_path = "") ⇒ Object

Note that the file_to_upload method can be used multiple times, but it assumes that the add_another_file method is used before it, every time except before the first time.



101
102
103
104
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 101

def file_to_upload(file_name, file_path="")
  frm.file_field(:id, "content_#{@@filex}").set(file_path + file_name)
  @@filex+=1
end

#upload_files_nowObject



106
107
108
109
110
111
# File 'lib/sakai-cle-test-api/page_objects/glossary.rb', line 106

def upload_files_now
  frm.button(:value=>"Upload Files Now").click
  sleep 0.5
  @@filex=0
  GlossaryAttach.new(@browser)
end