module Selenium::WebDriver::Atoms

def execute_atom(function_name, *arguments)

def execute_atom(function_name, *arguments)
  script = format("/* #{function_name} */return (%<atom>s).apply(null, arguments)",
                  atom: read_atom(function_name))
  execute_script(script, *arguments)
end

def read_atom(function)

def read_atom(function)
  File.read(File.expand_path("../atoms/#{function}.js", __FILE__))
end