spec/rails_helper.rb
#
# This method allows to submit visual regression testing screenshots
# to percy.io. To do this
#
This method allows to submit visual regression testing screenshots
to percy.io. To do this
This method allows to submit visual regression testing screenshots to percy . io . To do this
def take_snapshots!(snapshot_name)
    return unless ENV["PERCY_TOKEN"]
    begin
      @previous_window_size = Capybara.current_session.current_window.size
      Percy.snapshot page,
                     name:   snapshot_name.to_s,
                     widths: [400, 1100]
    ensure
      Capybara.current_session.current_window.resize_to(*@previous_window_size)
      @previous_window_size = nil
    end
  end
def take_snapshots! ( snapshot_name ) return unless ENV [ "PERCY_TOKEN" ] begin @previous_window_size = Capybara . current_session . current_window . size Percy . snapshot page , name : snapshot_name . to_s , widths : [ 400 , 1100 ] ensure Capybara . current_session . current_window . resize_to ( * @previous_window_size ) @previous_window_size = nil end end
This method allows to submit visual regression testing screenshots
to percy.io.
This method allows to submit visual regression testing screenshots to percy . io .
# Ensure viewport-size specific capybara specs do not get messed up # by percy adjusting the screen size
snapshot_name