Class: FileObject
- Inherits:
-
Object
- Object
- FileObject
- Includes:
- PageHelper, Utilities, Workflows
- Defined in:
- lib/sakai-cle-test-api/data_objects/resource.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
Returns the value of attribute href.
-
#name ⇒ Object
Returns the value of attribute name.
-
#site ⇒ Object
Returns the value of attribute site.
-
#source_path ⇒ Object
Returns the value of attribute source_path.
-
#target_folder ⇒ Object
Returns the value of attribute target_folder.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ FileObject
constructor
A new instance of FileObject.
Methods included from Workflows
menu_link, #open_my_site_by_name
Methods included from Utilities
#current_hour, #current_month, #current_year, #get_filename, #in_15_minutes, #last_hour, #last_month, #last_year, #make, #make_date, #next_hour, #next_month, #next_year, #on_page, #random_alphanums, #random_alphanums_plus, #random_email, #random_high_ascii, #random_letters, #random_multiline, #random_nicelink, #random_string, #random_xss_string, #tomorrow, #yesterday
Methods included from PageHelper
#make, #on, #visit, #wait_until
Constructor Details
#initialize(browser, opts = {}) ⇒ FileObject
Returns a new instance of FileObject.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 9 def initialize(browser, opts={}) @browser = browser defaults = { } = defaults.merge(opts) @name = [:name] @source_path = [:source_path] @site = [:site] [:target_folder] == nil ? @target_folder=@site : @target_folder=[:target_folder] raise "You must specify a Site for your Folder" if @site==nil end |
Instance Attribute Details
#href ⇒ Object
Returns the value of attribute href.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 7 def href @href end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 7 def name @name end |
#site ⇒ Object
Returns the value of attribute site.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 7 def site @site end |
#source_path ⇒ Object
Returns the value of attribute source_path.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 7 def source_path @source_path end |
#target_folder ⇒ Object
Returns the value of attribute target_folder.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 7 def target_folder @target_folder end |
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sakai-cle-test-api/data_objects/resource.rb', line 23 def create open_my_site_by_name @site unless @browser.title=~/#{@site}/ resources unless @browser.title=~/Resources$/ on Resources do |file| file.upload_file_to_folder @target_folder end on ResourcesUploadFiles do |upload| upload.file_to_upload @name, @source_path upload.upload_files_now end on Resources do |file| @href = file.href @name end end |