File: atoms.rb

package info (click to toggle)
ruby-selenium-webdriver 3.141.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,500 kB
  • sloc: ruby: 6,660; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Selenium
  module WebDriver
    module Atoms

      private

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

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

    end # Atoms
  end # WebDriver
end # Selenium