diff --git a/CHANGELOG.md b/CHANGELOG.md index c1e2b40..68b3b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - Removes support for reporting to Blinka, removing the need for httparty. +- Makes `Capybara.save_path` relative to the current working directory for images ## [0.7.2] - 2023-02-19 diff --git a/README.md b/README.md index 65cc015..f9b8b82 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Output the test results to different paths with `BLINKA_PATH`. - name: Tests env: - BLINKA_JSON: ./tests.json + BLINKA_PATH: ./tests.json run: bundle exec rails test - name: Archive results for Blinka diff --git a/lib/blinka_reporter/minitest_adapter.rb b/lib/blinka_reporter/minitest_adapter.rb index 349dfb7..034383d 100644 --- a/lib/blinka_reporter/minitest_adapter.rb +++ b/lib/blinka_reporter/minitest_adapter.rb @@ -65,9 +65,12 @@ def image image_path = if defined?(Capybara) && Capybara.respond_to?(:save_path) && Capybara.save_path.present? - "#{Capybara.save_path}/failures_#{name}.png" + "#{Capybara.save_path}/failures_#{name}.png".gsub( + Dir.getwd, + "" + ).delete_prefix("/") else - "./tmp/screenshots/failures_#{name}.png" + "tmp/screenshots/failures_#{name}.png" end return unless File.exist?(image_path)