Sha256: 8a9a1309a0b06d394569f1c58eb92ecf1d65d18638a0fc44fe09200dc1aeec2b

Contents?: true

Size: 482 Bytes

Versions: 9

Compression:

Stored size: 482 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 Exception::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

9 entries across 9 versions & 1 rubygems

Version Path
watir-6.17.0 lib/watir/js_snippets.rb
watir-6.16.5 lib/watir/js_snippets.rb
watir-6.16.4 lib/watir/js_snippets.rb
watir-6.16.3 lib/watir/js_snippets.rb
watir-6.16.2 lib/watir/js_snippets.rb
watir-6.16.1 lib/watir/js_snippets.rb
watir-6.16.0 lib/watir/js_snippets.rb
watir-6.15.1 lib/watir/js_snippets.rb
watir-6.15.0 lib/watir/js_snippets.rb