Sha256: fa664128cc37d5800a2afd6dc535abd926ac09a080a79a00499d3aa330874027
Contents?: true
Size: 988 Bytes
Versions: 1
Compression:
Stored size: 988 Bytes
Contents
# frozen_string_literal: true require "rspec/core" require "capybara_screenshot_diff/dsl" RSpec::Matchers.define :match_screenshot do |name, **options| description { "match a screenshot" } match do |_page| screenshot(name, **options) true end end RSpec.configure do |config| config.include ::CapybaraScreenshotDiff::DSL, type: :feature config.include ::CapybaraScreenshotDiff::DSL, type: :system config.after do if self.class.include?(::CapybaraScreenshotDiff::DSL) && ::Capybara::Screenshot.active? errors = verify_screenshots!(@test_screenshots) # TODO: Use rspec/mock approach to postpone verification raise ::CapybaraScreenshotDiff::ExpectationNotMet, errors.join("\n") if errors && !errors.empty? end end config.before do if self.class.include?(::CapybaraScreenshotDiff::DSL) && ::Capybara::Screenshot.window_size ::Capybara::Screenshot::BrowserHelpers.resize_to(::Capybara::Screenshot.window_size) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
capybara-screenshot-diff-1.9.2 | lib/capybara_screenshot_diff/rspec.rb |