Sha256: 49571d49c9e8d093144e0ea9783e482de4779bc63c9d5bbd22568779c2ee49fa

Contents?: true

Size: 461 Bytes

Versions: 15

Compression:

Stored size: 461 Bytes

Contents

module Watir
  module JSSnippets

    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

15 entries across 15 versions & 1 rubygems

Version Path
watir-6.13.0 lib/watir/js_snippets.rb
watir-6.12.0 lib/watir/js_snippets.rb
watir-6.11.0 lib/watir/js_snippets.rb
watir-6.11.0.beta2 lib/watir/js_snippets.rb
watir-6.11.0.beta1 lib/watir/js_snippets.rb
watir-6.10.3 lib/watir/js_snippets.rb
watir-6.10.2 lib/watir/js_snippets.rb
watir-6.10.0 lib/watir/js_snippets.rb
watir-6.9.1 lib/watir/js_snippets.rb
watir-6.9.0 lib/watir/js_snippets.rb
watir-6.8.4 lib/watir/js_snippets.rb
watir-6.8.3 lib/watir/js_snippets.rb
watir-6.8.2 lib/watir/js_snippets.rb
watir-6.8.1 lib/watir/js_snippets.rb
watir-6.8.0 lib/watir/js_snippets.rb