Upgrading Capybara to latest version makes Gitlab CI fail

202 Views Asked by At

I'm upgrading my Capybara to the latest version (up from 2.18.0) This causes the normalized_whitespace deprecation running to show up a lot when running my tests. I read that pulling the master branch of the gem fixes the issue, effectively it does but now my CI on Gitlab fails with:

Errno::ENOENT: No such file or directory - /builds/products/micheticket/vendor/ruby/2.5.0/bundler/gems/capybara-webkit-77fdac424cd6/bin/webkit_server

Does anyone have any Idea on how to fix this?

2

There are 2 best solutions below

7
Thomas Walpole On

Note that Capybara and capybara-webkit are two different things, Capybara is the testing framework, and capybara-webkit is a driver you can configure to be used with Capybara. Since capybara-webkit includes a C portion it needs to be compiled on the platform it's being installed on which means having all of its dependencies (specific versions of QtWebkit, etc) available on the platform. Having those available by default has become rare because QtWebKit stopped development quite some time ago. capybara-webkit development has also stopped and the project is likely to be archived very soon. You're going to have a much easier time if you swap to testing using the selenium driver (headless Chrome or Firefox) or one of the new direct to Chrome via CDP drivers like Apparition which are in beta currently but aim to provide the extra features that capybara-webkit had over selenium.

1
Code Star 8 On

I use a gem to manage and install the drivers. Webkit is deprecated. I would use the chrome driver.

gem 'chromedriver-helper'