I'm using selenium, capybara with rspec for testing, i noticed all tests pass locally, but on travis all tests fail with this error on each spec.
- xvfb-run bundle exec rspec spec/features/*.rb
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.use_transactional_fixtures = false
config.infer_base_class_for_anonymous_controllers = false1
config.filter_run_excluding :broken => true
Capybara.default_driver = :selenium
Capybara.run_server = true
Capybara.default_wait_time = 30
Well I found the reason of the issue and the solution.
Reason: We use responsive design, and apparently travis uses small windows size which turned on the mobile design and that is why it couldn't find the elements.
script: - xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rspec spec/features/*.rb
You basically set windows size to a larger size.