Module: Capybara::Screenshot

Extended by:
Os
Defined in:
lib/capybara/screenshot/diff.rb,
lib/capybara/screenshot/diff/os.rb,
lib/capybara/screenshot/diff/vcs.rb,
lib/capybara/screenshot/diff/version.rb,
lib/capybara/screenshot/diff/test_methods.rb,
lib/capybara/screenshot/diff/drivers/utils.rb,
lib/capybara/screenshot/diff/image_compare.rb,
lib/capybara/screenshot/diff/stabilization.rb,
lib/capybara/screenshot/diff/drivers/vips_driver.rb,
lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb

Defined Under Namespace

Modules: Diff, Os

Constant Summary

Constants included from Os

Os::ON_LINUX, Os::ON_MAC, Os::ON_WINDOWS

Class Method Summary collapse

Methods included from Os

os_name

Class Method Details

.active?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/capybara/screenshot/diff.rb', line 28

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

.root=(path) ⇒ Object



24
25
26
# File 'lib/capybara/screenshot/diff.rb', line 24

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

.screenshot_areaObject



32
33
34
35
36
37
# File 'lib/capybara/screenshot/diff.rb', line 32

def screenshot_area
  parts = [Capybara::Screenshot.save_path]
  parts << Capybara.current_driver.to_s if Capybara::Screenshot.add_driver_path
  parts << os_name if Capybara::Screenshot.add_os_path
  File.join parts
end

.screenshot_area_absObject



39
40
41
# File 'lib/capybara/screenshot/diff.rb', line 39

def screenshot_area_abs
  root / screenshot_area
end