diff --git a/config/initializers/system_test_case.rb b/config/initializers/system_test_case.rb new file mode 100644 index 0000000..9e3ef71 --- /dev/null +++ b/config/initializers/system_test_case.rb @@ -0,0 +1,3 @@ +ActiveSupport.on_load :action_dispatch_system_test_case do + prepend CoreExt::ActionDispatch::SystemTesting::TestHelpers::CustomScreenshotHelperUniqueId +end diff --git a/lib/core_ext/action_dispatch/system_testing/test_helpers/custom_screenshot_helper_unique_id.rb b/lib/core_ext/action_dispatch/system_testing/test_helpers/custom_screenshot_helper_unique_id.rb new file mode 100644 index 0000000..3798c38 --- /dev/null +++ b/lib/core_ext/action_dispatch/system_testing/test_helpers/custom_screenshot_helper_unique_id.rb @@ -0,0 +1,7 @@ +module CoreExt::ActionDispatch::SystemTesting::TestHelpers::CustomScreenshotHelperUniqueId + private + + def unique + Time.current.strftime("%Y-%m-%d %H:%M:%S.%9N_#{Minitest.seed}") + end +end