Class: Applitools::ClassicRunner

Inherits:
EyesRunner show all
Defined in:
lib/applitools/core/classic_runner.rb

Instance Attribute Summary collapse

Attributes inherited from EyesRunner

#batches_server_connectors_map, #remove_duplicate_tests, #universal_client, #universal_eyes_manager

Instance Method Summary collapse

Methods inherited from EyesRunner

#add_batch, #close_all_eyes, #delete_all_batches, #get_universal_eyes_manager, #set_remove_duplicate_tests

Constructor Details

#initialize(mask_log = nil) ⇒ ClassicRunner

Returns a new instance of ClassicRunner.



8
9
10
11
12
# File 'lib/applitools/core/classic_runner.rb', line 8

def initialize(mask_log = nil)
  super(mask_log)
  self.all_test_results = []
  self.all_pending_exceptions = {}
end

Instance Attribute Details

#all_pending_exceptionsObject

Returns the value of attribute all_pending_exceptions.



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

def all_pending_exceptions
  @all_pending_exceptions
end

#all_test_resultsObject

Returns the value of attribute all_test_results.



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

def all_test_results
  @all_test_results
end

Instance Method Details

#aggregate_exceptions(result, exception) ⇒ Object



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

def aggregate_exceptions(result, exception)
  all_pending_exceptions[result] = exception
end

#aggregate_result(test_result) ⇒ Object



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

def aggregate_result(test_result)
  Applitools::ArgumentGuard.is_a?(test_result, 'test_result', Applitools::TestResults)
  all_test_results << test_result
end

#get_all_test_results(throw_exception = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/applitools/core/classic_runner.rb', line 23

def get_all_test_results(throw_exception = false)
  begin
    if throw_exception
      all_pending_exceptions.each do |_result, exception|
        raise exception
      end
    end
  ensure
    delete_all_batches
  end
  # return all_test_results unless all_test_results.empty?
  all_universal_results = close_all_eyes
  Applitools::TestResultSummary.new(all_universal_results)
end

#rendering_info(connector) ⇒ Object



38
39
40
# File 'lib/applitools/core/classic_runner.rb', line 38

def rendering_info(connector)
  @rendering_info ||= RenderingInfo.new(connector.rendering_info)
end

#universal_eyes_manager_configObject



42
43
44
# File 'lib/applitools/core/classic_runner.rb', line 42

def universal_eyes_manager_config
  Applitools::UniversalEyesManagerConfig.classic
end