Sha256: f374786d8f6c17977ef7d6c23cabbbeeacaca4cf045a126e77e3ee60e7f77d3f
Contents?: true
Size: 1017 Bytes
Versions: 31
Compression:
Stored size: 1017 Bytes
Contents
# encoding: utf-8 module Watir class FileField < Input # # Set the file field to the given path # # @param [String] a path # # @raise [Errno::ENOENT] if the file doesn't exist # def set(path) raise Errno::ENOENT, path unless File.exist?(path) self.value = path end # # Set the file field to the given path # # @param [String] a path # def value=(path) assert_exists path = path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if File::ALT_SEPARATOR @element.send_keys path end end module Container def file_field(*args) FileField.new(self, extract_selector(args).merge(:tag_name => "input", :type => "file")) end def file_fields(*args) FileFieldCollection.new(self, extract_selector(args).merge(:tag_name => "input", :type => "file")) end end # Container class FileFieldCollection < InputCollection def element_class FileField end end # FileFieldCollection end # Watir
Version data entries
31 entries across 31 versions & 1 rubygems