Closed sterankin closed 4 years ago
@sterankin This is not related to webdrivers
gem. The error (failure reason) is coming from Capybara/Selenium:
Capybara::ElementNotFound:
Unable to find field "username"
It could be a timing issue if the element is found during local execution, but not in Docker. I would recommend taking a screenshot upon test failure to visually confirm if the element is displayed or not when the error happens. You can seek more help here: https://groups.google.com/forum/#!forum/ruby-capybara Good luck!
Summary
I am trying to get my feature specs working in a Docker container for my CI build but the specs fail. However, the specs pass locally on my OSX. Note that I am trying to run the tests against a URL (not localhost)
I can run:
bundle exec rake spec:features
on my Mac and the tests pass. But when I try using Docker on my mac it fails. I noticed that the bundle install of webdrivers was not causing a $HOME/.webdrivers folder to be installed, so I am forcing it now in my Dockerfile.
Debug Info
Webdriver Debug Logs from Docker:
Gem file:
spec_helper.rb:
Expected Behavior
I expect the tests to pass the same as my local
Actual Behavior
Test fail e.g.: Capybara::ElementNotFound: Unable to find field "username"
I can see this is in logs caused by my Dockerfile rake task to update chromedriver: INFO Webdrivers Updated to chromedriver 79.0.3945.36
So I know its installing ok. But I'm not sure why the tests are failing.
Here is my Dockerfile to replicate:
Can anyone suggest what might be the issue here?