Sha256: 0758d9f8416e56c455f9f0adefcdcf085cdc8c8319496ca8cc32dfa91c7b244d

Contents?: true

Size: 528 Bytes

Versions: 13

Compression:

Stored size: 528 Bytes

Contents

module Watir
  module Atoms

    ATOMS = {}

    def self.load(function_name)
      ATOMS[function_name] = File.read(File.expand_path("../atoms/#{function_name}.js", __FILE__))
    end

    load :fireEvent
    load :getAttribute
    load :getOuterHtml
    load :getInnerHtml
    load :getParentElement

    private

    def execute_atom(function_name, *arguments)
      script = "return (%s).apply(null, arguments)" % ATOMS.fetch(function_name)
      driver.execute_script(script, *arguments)
    end

  end # Atoms
end # Watir

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
watir-webdriver-0.9.9 lib/watir-webdriver/atoms.rb
watir-6.0.0.beta3 lib/watir/atoms.rb
watir-6.0.0.beta2 lib/watir/atoms.rb
watir-6.0.0.beta1 lib/watir/atoms.rb
watir-webdriver-0.9.3 lib/watir-webdriver/atoms.rb
watir-webdriver-0.9.2 lib/watir-webdriver/atoms.rb
watir-webdriver-0.9.1 lib/watir-webdriver/atoms.rb
watir-webdriver-0.9.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.8.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.7.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.6.11 lib/watir-webdriver/atoms.rb
watir-webdriver-0.6.10 lib/watir-webdriver/atoms.rb
watir-webdriver-0.6.9 lib/watir-webdriver/atoms.rb