Class: SnapDiff::AttemptsReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/snap_diff/attempts_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(snapshot, comparison_options, stability_options = {}) ⇒ AttemptsReporter

Returns a new instance of AttemptsReporter.



9
10
11
12
13
# File 'lib/snap_diff/attempts_reporter.rb', line 9

def initialize(snapshot, comparison_options, stability_options = {})
  @snapshot = snapshot
  @comparison_options = comparison_options
  @wait = stability_options[:wait]
end

Instance Method Details

#build_comparison_for(attempt_path, previous_attempt_path) ⇒ Object



23
24
25
# File 'lib/snap_diff/attempts_reporter.rb', line 23

def build_comparison_for(attempt_path, previous_attempt_path)
  Comparison.new(attempt_path, previous_attempt_path, @comparison_options)
end

#generateObject



15
16
17
18
19
20
21
# File 'lib/snap_diff/attempts_reporter.rb', line 15

def generate
  attempts_screenshot_paths = @snapshot.find_attempts_paths

  annotate_attempts(attempts_screenshot_paths)

  "Could not get stable screenshot within #{@wait}s:\n#{attempts_screenshot_paths.join("\n")}"
end