Sha256: dfe0e40224030715db597d73a64223cf68039545e9796f687d175da6c6215265

Contents?: true

Size: 465 Bytes

Versions: 4

Compression:

Stored size: 465 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 :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

4 entries across 4 versions & 1 rubygems

Version Path
watir-webdriver-0.3.3 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.2 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.1 lib/watir-webdriver/atoms.rb
watir-webdriver-0.3.0 lib/watir-webdriver/atoms.rb