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, #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

Constructor Details

#initializeClassicRunner

Returns a new instance of ClassicRunner.



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

def initialize
  super
  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



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

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

#aggregate_result(test_result) ⇒ Object



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

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



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

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
  test_result_summary = Applitools::TestResultSummary.new(all_universal_results).old_style_results_array
  return [] if test_result_summary.reject { |tr| tr.aborted? }.empty?
  test_result_summary
end

#rendering_info(connector) ⇒ Object



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

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

#universal_eyes_manager_configObject



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

def universal_eyes_manager_config
  Applitools::UniversalEyesManagerConfig.classic
end