Search code examples
javascriptrubycapybaracapybara-webkit

Disabling ClickFailed screenshots in capybara-webkit


Is there a way to disable capybara-webkit from creating a screenshot(click_failed_XXXXXX) when a ClickFailed error occurs? Thanks in advance.


Solution

  • That depends

    If you never need it in the current execution environment you could always overwrite it

    module Capybara::Webkit
      class Driver
         def save_screenshot(path, options={})
         end
      end
    end
    

    This should do the trick (haven't tested it)