Skip to content

Commit

Permalink
Handles Capybara.save_path to be relative
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwessman committed Mar 4, 2023
1 parent d1879ba commit ba9eb08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions lib/blinka_reporter/minitest_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ba9eb08

Please sign in to comment.