Use headless Chrome instead of Capybara-Webkit #881
Merged
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.
This repo has been using capybara-webkit for testing, but that gem depends on an old version of qt. Every time I want to run tests locally I have to revert my package manager (Homebrew), edit my bash profile, and generally mess with a bunch of stuff. Then, when I want to do anything else, I have to undo it all. This has cost me hours of work.
This PR migrates the tests to Selenium with headless Chrome to avoid unnecessary dependencies on software that cannot be installed via the Gemfile. This will make it much easier for me to run tests, and should do the same for others as well, at least for Mac users who rely on Homebrew.
By default, Selenium uses Firefox, but that has some other non-gem dependencies that led me to choose Chrome instead. I also tried Apparition without success before using Chrome.
I've left the Capybara-Webkit-specific code in case we ever go back to it once it receives updates. It is wrapped in conditional statements anyway, so I didn't have to modify or comment it out except to remove the line
require 'capybara/webkit'
.While I was at it, I also:
Unfortunately, a database issue is still preventing some jobs from passing. That's a pre-existing issue, though, and nothing to do with this PR. All the jobs that passed before this PR still pass. Running tests locally with newer Ruby/Rails fails when running the whole suite, but passes when running one directory at a time.