Sha256: 79cb20dcb5e0a8159d976c5007aef99ef999d98a6741f396c3b34cd67370b589

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

module Watir
  module JSSnippets
    #
    # @api private
    #

    def execute_js(function_name, *arguments)
      file = File.expand_path("../js_snippets/#{function_name}.js", __FILE__)
      raise Watir::Error, "Can not excute script as #{function_name}.js does not exist" unless File.exist?(file)

      js = File.read(file)
      script = "return (#{js}).apply(null, arguments)"
      @query_scope.execute_script(script, *arguments)
    end
  end # JSSnippets
end # Watir

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-6.14.0 lib/watir/js_snippets.rb