* adds csv formatter only in CI and adds --format progress to rspec in CI * addressing feedback * adds more functionality to csv reporter, and makes screenshots taken from rspec/retry have unique names * induces intentional fails (will revert after testing) * induces intentional fails (will revert after testing) * makes screenshot timestamp more precise and tweaks intentional fails (again willremove later) * restores spec files to normal and tweaks screenshot microseconds * remove the putses at end of CSVFormatter
13 lines
775 B
Ruby
13 lines
775 B
Ruby
# https://github.com/mattheworiordan/capybara-screenshot/issues/225
|
|
# https://stackoverflow.com/questions/44336581/turn-off-screenshots-in-rails-system-tests
|
|
# https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L64
|
|
# Without this monkeypatch, if there's multiple screenshots taken due to rspec/retry, each new screenshot
|
|
# will overwrite the last one. This monkeypatch makes the screenshot name unique so they won't overwrite each other
|
|
require "action_dispatch/system_testing/test_helpers/screenshot_helper"
|
|
::ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper.module_eval do
|
|
private
|
|
|
|
def image_name
|
|
"#{method_name}_#{Time.current.utc.strftime('%Y-%m-%dT%H:-%M-%S-%3NZ')}"
|
|
end
|
|
end
|