Sha256: 664bafca93f5741427ddb7293928669e0a9788c309f5563a2e197227e73383eb

Contents?: true

Size: 488 Bytes

Versions: 19

Compression:

Stored size: 488 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 :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
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/atoms.rb
watir-webdriver-0.6.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.8 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.7 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.6 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.5 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.4 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.3 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.2 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.1 lib/watir-webdriver/atoms.rb
watir-webdriver-0.5.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.4.1 lib/watir-webdriver/atoms.rb
watir-webdriver-0.4.0 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.9 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.8 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.7 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.6 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.5 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.4 lib/watir-webdriver/atoms.rb