Method: Applitools::Selenium::Driver#initialize

Defined in:
lib/applitools/selenium/driver.rb

#initialize(eyes, options) ⇒ Driver

Initializes a class instance.

If driver is not provided, Applitools::Selenium::Driver will raise an EyesError exception.

Parameters:

Options Hash (options):

  • :driver (Selenium::WebDriver::Driver)

    The Selenium webdriver instance.

  • :is_mobile_device (Boolean)

    Whether is a mobile device or not.



46
47
48
49
50
51
52
53
# File 'lib/applitools/selenium/driver.rb', line 46

def initialize(eyes, options)
  super(options[:driver])
  @is_mobile_device = options.fetch(:is_mobile_device, false)
  @eyes = eyes
  @frame_chain = Applitools::Selenium::FrameChain.new
  @browser = Applitools::Selenium::Browser.new(self, @eyes)
  Applitools::EyesLogger.warn '"screenshot_as" method not found!' unless driver.respond_to? :screenshot_as
end