Class: PortfoliosUploadFiles
- Defined in:
- lib/sakai-cle-test-api/page_objects/portfolio_templates.rb
Overview
TODO - This class is not DRY. Identical methods in multiple classes
Constant Summary collapse
- @@filex =
0
Instance Method Summary collapse
-
#add_another_file ⇒ Object
Clicks the Add Another File link.
-
#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.
-
#upload_files_now ⇒ Object
Clicks the Upload Files Now button and instantiates the PortfolioAttachFiles Class.
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_file ⇒ Object
Clicks the Add Another File link.
110 111 112 |
# File 'lib/sakai-cle-test-api/page_objects/portfolio_templates.rb', line 110 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.
95 96 97 98 |
# File 'lib/sakai-cle-test-api/page_objects/portfolio_templates.rb', line 95 def file_to_upload(file_name, file_path) frm.file_field(:id, "content_#{@@filex}").set(file_path + file_name) @@filex+=1 end |
#upload_files_now ⇒ Object
Clicks the Upload Files Now button and instantiates the PortfolioAttachFiles Class.
102 103 104 105 106 107 |
# File 'lib/sakai-cle-test-api/page_objects/portfolio_templates.rb', line 102 def upload_files_now frm.(:value=>"Upload Files Now").click sleep 1 # TODO - use a wait clause here @@filex=0 PortfolioAttachFiles.new(@browser) end |