Class: OmniAI::Tools::Browser::BaseDriver
- Inherits:
-
Object
- Object
- OmniAI::Tools::Browser::BaseDriver
- Defined in:
- lib/omniai/tools/browser/base_driver.rb
Overview
A base driver intended to be overridden by specific browser drivers (e.g. waitir).
Direct Known Subclasses
Constant Summary collapse
- TIMEOUT =
Integer(ENV.fetch("OMNIAI_BROWSER_TIMEOUT", 10))
Instance Method Summary collapse
- #click(selector:) ⇒ Hash
- #close ⇒ Object
- #fill_in(selector:, text:) ⇒ Hash
- #goto(url:) ⇒ Hash
- #html ⇒ String
-
#initialize(logger: Logger.new(IO::NULL)) ⇒ BaseDriver
constructor
A new instance of BaseDriver.
- #screenshot {|file| ... } ⇒ Object
- #title ⇒ String
- #url ⇒ String
Constructor Details
#initialize(logger: Logger.new(IO::NULL)) ⇒ BaseDriver
Returns a new instance of BaseDriver.
11 12 13 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 11 def initialize(logger: Logger.new(IO::NULL)) @logger = logger end |
Instance Method Details
#click(selector:) ⇒ Hash
58 59 60 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 58 def click(selector:) raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#close ⇒ Object
15 16 17 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 15 def close raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#fill_in(selector:, text:) ⇒ Hash
51 52 53 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 51 def fill_in(selector:, text:) raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#goto(url:) ⇒ Hash
43 44 45 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 43 def goto(url:) raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#html ⇒ String
30 31 32 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 30 def html raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#screenshot {|file| ... } ⇒ Object
36 37 38 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 36 def screenshot raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#title ⇒ String
25 26 27 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 25 def title raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |
#url ⇒ String
20 21 22 |
# File 'lib/omniai/tools/browser/base_driver.rb', line 20 def url raise NotImplementedError, "#{self.class.name}#{__method__} undefined" end |