Class: Applitools::ScreenshotTaker

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/eyes_selenium/eyes/screenshot_taker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver_server_uri, driver_session_id) ⇒ ScreenshotTaker

Returns a new instance of ScreenshotTaker.



9
10
11
12
# File 'lib/eyes_selenium/eyes/screenshot_taker.rb', line 9

def initialize(driver_server_uri, driver_session_id)
  @driver_server_uri = driver_server_uri
  @driver_session_id = driver_session_id
end

Instance Attribute Details

#driver_server_uriObject (readonly)

Returns the value of attribute driver_server_uri.



7
8
9
# File 'lib/eyes_selenium/eyes/screenshot_taker.rb', line 7

def driver_server_uri
  @driver_server_uri
end

#driver_session_idObject (readonly)

Returns the value of attribute driver_session_id.



7
8
9
# File 'lib/eyes_selenium/eyes/screenshot_taker.rb', line 7

def driver_session_id
  @driver_session_id
end

Instance Method Details

#screenshotObject



14
15
16
17
# File 'lib/eyes_selenium/eyes/screenshot_taker.rb', line 14

def screenshot
  res = self.class.get(driver_server_uri.to_s.gsub(/\/$/,"") + "/session/#{driver_session_id}/screenshot")
  res.parsed_response['value']
end