module Selenium::WebDriver::Atoms
def atom_script(function_name)
def atom_script(function_name) format("/* #{function_name} */return (%<atom>s).apply(null, arguments)", atom: read_atom(function_name)) end
def execute_atom(function_name, *arguments)
def execute_atom(function_name, *arguments) execute_script(atom_script(function_name), *arguments) end
def read_atom(function)
def read_atom(function) File.read(File.expand_path("../atoms/#{function}.js", __FILE__)) end