Class: CapybaraScreenshotDiff::AttemptsReporter
- Inherits:
-
Object
- Object
- CapybaraScreenshotDiff::AttemptsReporter
- Defined in:
- lib/capybara_screenshot_diff/attempts_reporter.rb
Instance Method Summary collapse
- #build_comparison_for(attempt_path, previous_attempt_path) ⇒ Object
- #generate ⇒ Object
-
#initialize(snapshot, comparison_options, stability_options = {}) ⇒ AttemptsReporter
constructor
A new instance of AttemptsReporter.
Constructor Details
#initialize(snapshot, comparison_options, stability_options = {}) ⇒ AttemptsReporter
Returns a new instance of AttemptsReporter.
7 8 9 10 11 |
# File 'lib/capybara_screenshot_diff/attempts_reporter.rb', line 7 def initialize(snapshot, , = {}) @snapshot = snapshot @comparison_options = @wait = [:wait] end |
Instance Method Details
#build_comparison_for(attempt_path, previous_attempt_path) ⇒ Object
21 22 23 |
# File 'lib/capybara_screenshot_diff/attempts_reporter.rb', line 21 def build_comparison_for(attempt_path, previous_attempt_path) Capybara::Screenshot::Diff::ImageCompare.new(attempt_path, previous_attempt_path, @comparison_options) end |
#generate ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/capybara_screenshot_diff/attempts_reporter.rb', line 13 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 |