Class: Applitools::EyesRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/core/eyes_runner.rb

Direct Known Subclasses

ClassicRunner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEyesRunner

Returns a new instance of EyesRunner.



9
10
11
12
13
# File 'lib/applitools/core/eyes_runner.rb', line 9

def initialize
  self.batches_server_connectors_map = {}
  self.universal_client = nil # eyes.open
  self.universal_eyes_manager = nil # eyes.open
end

Instance Attribute Details

#batches_server_connectors_mapObject

Returns the value of attribute batches_server_connectors_map.



5
6
7
# File 'lib/applitools/core/eyes_runner.rb', line 5

def batches_server_connectors_map
  @batches_server_connectors_map
end

#remove_duplicate_testsObject

Returns the value of attribute remove_duplicate_tests.



7
8
9
# File 'lib/applitools/core/eyes_runner.rb', line 7

def remove_duplicate_tests
  @remove_duplicate_tests
end

#universal_clientObject

Returns the value of attribute universal_client.



6
7
8
# File 'lib/applitools/core/eyes_runner.rb', line 6

def universal_client
  @universal_client
end

#universal_eyes_managerObject

Returns the value of attribute universal_eyes_manager.



6
7
8
# File 'lib/applitools/core/eyes_runner.rb', line 6

def universal_eyes_manager
  @universal_eyes_manager
end

Instance Method Details

#add_batch(batch_id, &block) ⇒ Object



15
16
17
# File 'lib/applitools/core/eyes_runner.rb', line 15

def add_batch(batch_id, &block)
  batches_server_connectors_map[batch_id] ||= block if block_given?
end

#close_all_eyesObject



29
30
31
# File 'lib/applitools/core/eyes_runner.rb', line 29

def close_all_eyes
  get_universal_eyes_manager.close_all_eyes(remove_duplicate_tests)
end

#delete_all_batchesObject



19
20
21
# File 'lib/applitools/core/eyes_runner.rb', line 19

def delete_all_batches
  batches_server_connectors_map.each_value { |v| v.call if v.respond_to? :call }
end

#get_universal_eyes_manager(eyes = nil) ⇒ Object



23
24
25
26
27
# File 'lib/applitools/core/eyes_runner.rb', line 23

def get_universal_eyes_manager(eyes=nil)
  return universal_eyes_manager if universal_eyes_manager
  self.universal_client = Applitools::Connectivity::UniversalClient.new(eyes) if universal_client.nil?
  self.universal_eyes_manager = universal_client.make_manager(universal_eyes_manager_config.to_hash)
end

#set_remove_duplicate_tests(value) ⇒ Object



33
34
35
# File 'lib/applitools/core/eyes_runner.rb', line 33

def set_remove_duplicate_tests(value)
  self.remove_duplicate_tests = !!value
end