Module: Capybara::Screenshot

Defined in:
lib/capybara_screenshot_diff.rb,
lib/capybara/screenshot/diff/os.rb,
lib/capybara/screenshot/diff/vcs.rb,
lib/capybara/screenshot/diff/utils.rb,
lib/capybara/screenshot/diff/drivers.rb,
lib/capybara/screenshot/diff/version.rb,
lib/capybara/screenshot/diff/difference.rb,
lib/capybara/screenshot/diff/screenshoter.rb,
lib/capybara/screenshot/diff/test_methods.rb,
lib/capybara/screenshot/diff/image_compare.rb,
lib/capybara/screenshot/diff/area_calculator.rb,
lib/capybara/screenshot/diff/browser_helpers.rb,
lib/capybara/screenshot/diff/screenshot_matcher.rb,
lib/capybara/screenshot/diff/drivers/base_driver.rb,
lib/capybara/screenshot/diff/drivers/vips_driver.rb,
lib/capybara/screenshot/diff/stable_screenshoter.rb,
lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb

Defined Under Namespace

Modules: BrowserHelpers, Diff, Os Classes: Screenshoter

Class Method Summary collapse

Class Method Details

.active?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/capybara_screenshot_diff.rb', line 36

def active?
  enabled || (enabled.nil? && Diff.enabled)
end

.root=(path) ⇒ Object



32
33
34
# File 'lib/capybara_screenshot_diff.rb', line 32

def root=(path)
  @@root = Pathname(path).expand_path
end

.screenshot_areaObject



40
41
42
43
44
45
# File 'lib/capybara_screenshot_diff.rb', line 40

def screenshot_area
  parts = [Screenshot.save_path]
  parts << Os.name if Screenshot.add_os_path
  parts << Capybara.current_driver.to_s if Screenshot.add_driver_path
  File.join(*parts)
end

.screenshot_area_absObject



47
48
49
# File 'lib/capybara_screenshot_diff.rb', line 47

def screenshot_area_abs
  root / screenshot_area
end