thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 428 forks source link

Build failure with QT5 (5.5) #987

Closed ademars94 closed 6 years ago

ademars94 commented 7 years ago

I am desperately trying to get Capybara Webkit running on CircleCI's Ubuntu machine.

Our tests were failing locally due to Capybara Webkit not being able to load our assets. This problem has been manifesting itself as ElementNotFound errors, as well as JS not executing properly under test:

Capybara::ElementNotFound:
       Unable to find css ".dropdown .spec-actions"
     # /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/node/finders.rb:44:in `block in find'
     # /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/node/base.rb:85:in `synchronize'
     # /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/node/finders.rb:33:in `find'
     # /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/session.rb:699:in `block (2 levels) in <class:Session>'
     # ./spec/features/environments_actions_spec.rb:12:in `block (2 levels) in <top (required)>'

Luckily, updating to QT5 and rebuilding solved that issue for us, but only locally.

I am now trying to do the same for our CircleCI builds. I've set up the machine to use QT5, but I am getting the following output at the end of gem install capybara-webkit --verbose:

current directory: /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-webkit-1.12.0
make "DESTDIR=" clean
make: *** No rule to make target `clean'.  Stop.
current directory: /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-webkit-1.12.0
make "DESTDIR="
ok
current directory: /opt/circleci/.rvm/gems/ruby-2.3.0/gems/capybara-webkit-1.12.0
make "DESTDIR=" install
ok
Building has failed. See above output for more information on the failure.
Successfully installed capybara-webkit-1.12.0

The "above output" it's referring to is the "no rule to make target clean" line. It seems like everything was going just fine until this step. Is there something I need to configure here, or could this be a bug? It says the build failed, but it seems to be installing Capybara Webkit (using QT5).

However, after the install when we run our tests, we are still getting ElementNotFound and JS failures, but only on CircleCI.

jferris commented 7 years ago

Nothing obvious jumps out at me. Are you using Trusty on Circle? Could you paste the full build log and your circle.yml?

ademars94 commented 7 years ago

@jferris We were using Circle's Trusty machines, so it is possible there is an issue with Capybara Webkit on Trusty. Hacking away at this problem over the past few days, that's the best diagnosis I've come up with (assuming I didn't accidentally do something weird, which is certainly also a possibility). I've been running tests with Capybara Webkit locally under El Capitan with zero issues after upgrading QT.

Our circle.yml has been through so many iterations it would basically be useless to post it, but in general our .yml sets the QMAKE env variable to the right path for QT5.5, then does gem install capybara-webkit, and then does bundle install.

This seems to be what we are supposed to do... Switch to QT5.5, get bundler to build Capybara Webkit's native extensions using the version of qmake from QT5.5, and the problem should be solved. At least that's how it went on El Capitan. Either I am missing something or there's a bug hiding here.

stevenspiel commented 6 years ago

Any resolution here? I'm also having the same issue.

twalpole commented 6 years ago

Closing due to lack of reponse