sanitize image_name by removing all questions marks

Co-Authored-By: David Cook <david@redcliffs.net>
This commit is contained in:
Jean-Baptiste Bellet
2022-11-10 15:03:21 +01:00
parent abf8d44935
commit c2f82202a6

View File

@@ -16,7 +16,7 @@ module CupriteHelpers
# Use our `Capybara.save_path` to store screenshots with other capybara artifacts
# (Rails screenshots path is not configurable https://github.com/rails/rails/blob/49baf092439fc74fc3377b12e3334c3dd9d0752f/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L79)
def absolute_image_path
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name}.png")
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name.parameterize}.png")
end
# Make failure screenshots compatible with multi-session setup.