How to upload capybara screenshots to the Digital ocean cache?

I am running my rails tests using gitlab runner on Digital ocean servers
I save bundler cache in the Digital ocean Spaces

Also I am using capybara-screenshot to make screenshots of the page when a test case fails.
When a test fails a screenshot is being saved to tmp/capybara/

Then after the end of test run the build servers are deleted and screenshots are lost which makes investigation of the test failure a lot harder.

Is there a way to upload the contents of the tmp/capybara/ folder to Digital ocean Spaces using the key and secret which gitlab runner uses to retrieve/upload the cache?

Thank you!

Hi @Hirurg103, you may try saving those as artifacts within gitlab. There is a tutorial about doing this with GitLab CI/CD and that might lead you in the right direction.

1 Like