Class: ResourcesUploadFiles

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

Constant Summary collapse

@@filex =

TODO: This is almost certainly not going to work right.

0

Instance Method Summary collapse

Methods inherited from ResourcesBase

#access_level, #attach_a_copy, #continue, #create_html_page_in, #create_subfolders_in, #edit_content, #edit_details, #file_names, #folder_names, #go_to_folder, #href, #item, #open_actions_menu, #open_add_menu, #open_folder, #remove_item, #select_file, #upload_file, #upload_files_to_folder, #upload_local_file, #upload_multiple_files_to_folder, #url=

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

Clicks the Add Another File link.



247
248
249
# File 'lib/sakai-cle-test-api/page_objects/resources.rb', line 247

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

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

Enters the specified folder/filename value into the file field on the page. The method will throw an error if the specified file is not found.

This method is designed to be able to use multiple times, but it assumes that the add_another_file method is used before it, every time except before the first time.



232
233
234
235
# File 'lib/sakai-cle-test-api/page_objects/resources.rb', line 232

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

Clicks the Upload Files Now button, resets the @@filex class variable back to zero, and instantiates the Resources page class.



240
241
242
243
244
# File 'lib/sakai-cle-test-api/page_objects/resources.rb', line 240

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