所以我有一个在本地工作但不在CI服务器上的集成测试。
在CI服务器上,它会挂起来寻找页面上的元素,并且似乎在渲染页面本身。
有关可能原因可能是什么的任何想法?
这是测试(由于无法找到“获取个人计划”链接而失败)。另外,FWIW我使用了poltergeist作为js驱动程序:
require 'rails_helper'
RSpec.feature "Submitting id theft form", type: :feature, js: true do
scenario "with valid data" do
visit '/recommends/id-theft-protection'
click_link 'Get Individual Plan'
within("#new_recommends_insurance_id_theft_protection_referral") do
fill_in 'First Name', with: "test+#{Faker::Name.unique.first_name}"
fill_in 'Last Name', with: 'Carpenter'
fill_in 'Email Address', with: '*******@gmail.com'
fill_in 'Phone Number', with: '***********'
fill_in 'Street Address', with: '1 e'
fill_in 'City', with: 'Lexington'
select 'KY', from: 'State'
fill_in 'ZIP Code', with: '40503'
fill_in 'recommends_insurance_id_theft_protection_referral[birth_date]', with: '03/20/1989'
end
VCR.use_cassette('continue_to_payment') do
click_button 'Continue to Payment'
end
expect(page).to have_content('Submit Payment')
end
end
回溯:
09:57:17.781 bundle exec rspec spec --backtrace
09:57:17.781
09:57:17.781 Randomized with seed 64563
09:57:17.782
09:57:17.782 Progress: |============================================
09:57:17.782
09:57:17.782 1) Submitting id theft form with valid data
09:57:17.782 Failure/Error: click_link 'Get Individual Plan'
09:57:17.782
09:57:17.782 Capybara::ElementNotFound:
09:57:17.782 Unable to find visible link "Get Individual Plan"
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/node/finders.rb:314:in `block in synced_resolve'
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/node/base.rb:85:in `synchronize'
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/node/finders.rb:302:in `synced_resolve'
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/node/finders.rb:37:in `find'
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/node/actions.rb:43:in `click_link'
09:57:17.782 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/session.rb:808:in `block (2 levels) in <class:Session>'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/capybara-2.17.0/lib/capybara/dsl.rb:50:in `block (2 levels) in <module:DSL>'
09:57:17.783 # ./spec/features/submitting_id_theft_form_spec.rb:7:in `block (2 levels) in <top (required)>'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:254:in `instance_exec'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:254:in `block in run'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:500:in `block in with_around_and_singleton_context_hooks'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:457:in `block in with_around_example_hooks'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:466:in `block in run'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:606:in `block in run_around_example_hooks_for'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:342:in `call'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-rails-3.7.2/lib/rspec/rails/adapters.rb:127:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:447:in `instance_exec'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:447:in `instance_exec'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:375:in `execute_with'
09:57:17.783 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:608:in `block (2 levels) in run_around_example_hooks_for'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:342:in `call'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:609:in `run_around_example_hooks_for'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:466:in `run'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:457:in `with_around_example_hooks'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:500:in `with_around_and_singleton_context_hooks'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:251:in `run'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:628:in `block in run_examples'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `map'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `run_examples'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:590:in `run'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (3 levels) in run_specs'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `map'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (2 levels) in run_specs'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1926:in `with_suite_hooks'
09:57:17.784 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:113:in `block in run_specs'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:79:in `report'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/gems/rspec-core-3.7.1/exe/rspec:4:in `<top (required)>'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/bin/rspec:22:in `load'
09:57:17.785 # /opt/go/ruby_cache_2.4.1_build/dr-recommends/ruby/2.4.0/bin/rspec:22:in `<top (required)>'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
09:57:17.785 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
09:57:17.786 # /opt/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
09:57:17.786 # /opt/rubies/ruby-2.4.1/bin/bundle:22:in `load'
09:57:17.786 # /opt/rubies/ruby-2.4.1/bin/bundle:22:in `<main>'
09:57:17.786
09:57:17.786 Progress: |====================================================================|
09:57:17.786
09:57:17.786 Top 3 slowest examples (12.37 seconds, 99.6% of total time):
09:57:17.786 Submitting term life form with valid data
09:57:17.786 8.64 seconds ./spec/features/submitting_term_life_form_spec.rb:4
09:57:17.787 Submitting id theft form with valid data
09:57:17.787 2.55 seconds ./spec/features/submitting_id_theft_form_spec.rb:4
09:57:17.787 Submitting mortgage form with valid data
09:57:17.787 1.18 seconds ./spec/features/submitting_mortgage_form_spec.rb:4
09:57:17.787
09:57:17.787 Top 3 slowest example groups:
09:57:17.787 Submitting term life form
09:57:17.787 8.64 seconds average (8.64 seconds / 1 example) ./spec/features/submitting_term_life_form_spec.rb:3
09:57:17.787 Submitting id theft form
09:57:17.787 2.59 seconds average (2.59 seconds / 1 example) ./spec/features/submitting_id_theft_form_spec.rb:3
09:57:17.787 Submitting mortgage form
09:57:17.787 1.18 seconds average (1.18 seconds / 1 example) ./spec/features/submitting_mortgage_form_spec.rb:3
09:57:17.787
09:57:17.787 Finished in 12.42 seconds (files took 3.82 seconds to load)
09:57:17.788 3 examples, 1 failure
09:57:17.788
09:57:17.788 Failed examples:
09:57:17.788
09:57:17.788 rspec ./spec/features/submitting_id_theft_form_spec.rb:4 # Submitting id theft form with valid data
09:57:17.788
09:57:17.788 Randomized with seed 64563