Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change screenshot files name in Minitest and capybara-screenshot? #294

Open
Ju-Arrighi opened this issue Jul 12, 2023 · 0 comments
Open

Comments

@Ju-Arrighi
Copy link

Is there a way to change the default screenshot default file name when using capybara-screenshot with minitest?

I'm using minitest and I have this file which contains spaces and colon. I should "clean" it to upload artifacts. I' ve tried to override it in my test_helper.rb with:
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
"screenshot_#{example.description.gsub(' ', '-').gsub(/^.*/spec//,'')}"
end

But nothing happens. Iḿ confused because it seems to me that capybara-screenshot is not working at all since the saved files still have /screenshots path besides /capybara path.

[Screenshot Image]: /home/julianaarrighi/code/xattering-backend/tmp/screenshots/failures_test_: when clicking the reset password email should allow to reset the AppUser's password. .png

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant