Class: StylesUploadFiles

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

Overview

TODO Dry this up because there can be a superclass here

Constant Summary collapse

@@filex =
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.



67
68
69
# File 'lib/sakai-cle-test-api/page_objects/styles.rb', line 67

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.



52
53
54
55
# File 'lib/sakai-cle-test-api/page_objects/styles.rb', line 52

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 then instantiates the StylesAddAttachment Class.



59
60
61
62
63
64
# File 'lib/sakai-cle-test-api/page_objects/styles.rb', line 59

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