Class: ResourcesUploadFiles

Inherits:
ResourcesBase show all
Defined in:
lib/sambal-cle/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

resources_elements

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#add_another_fileObject

Clicks the Add Another File link.



239
240
241
# File 'lib/sambal-cle/page_objects/resources.rb', line 239

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.



224
225
226
227
# File 'lib/sambal-cle/page_objects/resources.rb', line 224

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.



232
233
234
235
236
# File 'lib/sambal-cle/page_objects/resources.rb', line 232

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