Fix Capybara screenshots in feature specs#6753
Merged
Conversation
d18d515 to
375fc0b
Compare
thomasleese
approved these changes
Apr 30, 2026
375fc0b to
c5aefae
Compare
c5aefae to
f4b511e
Compare
@chrislo & I accidentally removed the screenshotting capability in #6669 at the same time as we removed the redundant configuration for running feature specs in a browser using the cuprite driver, because we were under the mistaken impression that rack-test driver did not support screenshots. As @murugapl & @misaka pointed out, capybara-screenshot does actually support HTML screenshots when using rack-test. These screenshots are improved by setting `Capybara.asset_host = "http://localhost:4000"` so that assets can be loaded if you have the Rails app running locally. This commit partially reverts this commit [1] to restore the screenshotting behaviour. [1]: 0a95de7
f4b511e to
4446df0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@chrislo & I accidentally removed the screenshotting capability in #6669 at the same time as we removed the redundant configuration for running feature specs in a browser using the cuprite driver, because we were under the mistaken impression that rack-test driver did not support screenshots.
As @murugapl & @misaka pointed out, capybara-screenshot does actually support HTML screenshots when using rack-test. These screenshots are improved by setting
Capybara.asset_host = "http://localhost:4000"so that assets can be loaded if you have the Rails app running locally.This commit partially reverts this commit to restore the screenshotting behaviour.