Class: Applitools::UniversalEyes

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/applitools/universal_sdk/universal_eyes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(eyes, universal_client) ⇒ UniversalEyes

Returns a new instance of UniversalEyes.



11
12
13
14
15
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 11

def initialize(eyes, universal_client)
  @eyes = eyes
  @universal_client = universal_client
  @closed_or_aborted = false
end

Instance Attribute Details

#closed_or_abortedObject

Returns the value of attribute closed_or_aborted.



9
10
11
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 9

def closed_or_aborted
  @closed_or_aborted
end

Instance Method Details

#abortObject



31
32
33
34
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 31

def abort
  @closed_or_aborted = true
  @universal_client.eyes_abort(@eyes)
end

#check(settings, image_target = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 17

def check(settings, image_target = {})
  elapsed_time_start = Time.now
  # Applitools::EyesLogger.logger.debug "check settings: #{settings}"
  check_result = @universal_client.eyes_check(@eyes, settings, image_target)
  # Applitools::EyesLogger.logger.debug "check_result: #{check_result}"
  Applitools::EyesLogger.logger.info "Completed in #{format('%.2f', Time.now - elapsed_time_start)} seconds"
  check_result
end

#closeObject



26
27
28
29
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 26

def close
  @closed_or_aborted = true
  @universal_client.eyes_close(@eyes)
end

#extract_text(targets_array, driver_target) ⇒ Object



48
49
50
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 48

def extract_text(targets_array, driver_target)
  @universal_client.eyes_extract_text(@eyes, targets_array, driver_target)
end

#extract_text_regions(patterns_array, driver_target) ⇒ Object



44
45
46
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 44

def extract_text_regions(patterns_array, driver_target)
  @universal_client.eyes_extract_text_regions(@eyes, patterns_array, driver_target)
end

#eyes_get_resultsObject



36
37
38
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 36

def eyes_get_results
  @universal_client.eyes_get_results(@eyes)
end

#locate(settings, driver_target) ⇒ Object



40
41
42
# File 'lib/applitools/universal_sdk/universal_eyes.rb', line 40

def locate(settings, driver_target)
  @universal_client.eyes_locate(@eyes, settings, driver_target)
end