는이 문제를 연구 꽤 많은 시간을 할애하고, 문제에 대한 몇 가지 흥미로운 블로그 게시물을 찾았지만 해결책으로는 나를 위해 일하지 않는다.
내가 그렇게처럼, 웹킷과 심령에 카피 바라 셀레늄의 기본 JS 드라이버로 전환 :
# Gemfile
gem "capybara-webkit"
# spec/spec_helper.rb
Spork.prefork do
Capybara.javascript_driver = :webkit
end
및
# Gemfile
gem "poltergeist"
# spec/spec_helper.rb
Spork.prefork do
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
end
하지만
여기에 내가 시도 옵션은 어느 쪽이든을 가진 운.
this thread 당
및 this article 내가 시도 :
# spec/spec_helper.rb
Spork.prefork do
Capybara.server_boot_timeout = 600 # Default is 10 my entire suite
end # takes ~550s to run, that's why I
# attempted such a large boot timeout in
# case the time was from beginning of suite
# execution.
를 아무 소용.
은 그 때 나는
this article 발견, 그래서 시도 :
# spec/spec_helper.rb
# initial advice was for cucumber, and thus recommended this to be placed in
# the features/env.rb file
def find_available_port
server = TCPServer.new('127.0.0.1', 0)
server.addr[1]
ensure
server.close if server
end
if ENV['TDDIUM'] then
Capybara.server_port = find_available_port
end
하지만 그와 운.
는 또한 DatabaseCleaner 아직도 per this issue on StackOverflow.
행운, FactoryGirl에서 내 공장 멋지게 연주했다 확인하기 위해 내 database_cleaner 설정을 확인.
다음 나는과 같이, 내 Guardfile 내 낮은 수준의 RSpec에 테스트에서 내 카피 바라 시험을 구문 분석을 시도 :
group 'integration tests' do
# Capybara Tests
guard 'rspec', spec_paths: ['spec/requests'] do
watch(%r{^spec/requests/.+_spec\.rb})
end
# Cucumber Feature Tests
guard 'cucumber', bundler: true do
watch(%r{^features/.+\.feature$})
end
end
group 'unit tests' do
rspec_paths = ['spec/controllers', 'spec/helpers', 'spec/models', 'spec/views']
# RSpec Unit Tests
guard 'rspec', spec_paths: rspec_paths do
watch(%r{^spec/.+_spec\.rb$})
end
# Jasmine JS Unit Tests
guard 'jasmine', all_on_start: false, all_after_pass: false do
watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
end
end
과 성공을! 마침내!