这是我的第一个在线问题,所以请发表评论,我会尝试更新我的问题以澄清。
我对 Web 开发很陌生,目前正在为公司项目开发测试套件。当我尝试对涉及javascript的函数进行集成测试时,它工作得很好。我尝试同时使用 webkit(从 git 捆绑)和 selenium。Webkit 给出了以下错误消息。
Wrote response false "Unable to load URL: http://127.0.0.1:56618/ because of error loading http://127.0.0.1:56618/: Connection closed"
Cleaning database...done
Received "Reset"
Started "Reset"
Finished "Reset"
Wrote response true ""
should see invalid message (FAILED - 1)
Failures:
1) Users GET /sign_in with invalid account should see invalid message
Failure/Error: visit root_path
Capybara::Webkit::InvalidResponseError:
Unable to load URL: http://127.0.0.1:56618/ because of error loading http://127.0.0.1:56618/: Connection closed
在使用 Selenium 时,FireFox 会抱怨:
Your Firefox profile cannot be loaded. It may be missing or inaccessible.
有人知道可能是什么问题吗?提前致谢!
我的 sepc_helper.rb
Spork.prefork do
...
..
.
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) { require "#{Rails.root}/db/seeds.rb" }
config.before(:each) do
if Capybara.current_driver == :rack_test
DatabaseCleaner.strategy = :transaction
else
DatabaseCleaner.strategy = :truncation
end
DatabaseCleaner.start
end
config.after(:each) do
if Capybara.current_driver == :rack_test
DatabaseCleaner.clean
else
DatabaseCleaner.clean
load "#{Rails.root}/db/seeds.rb"
end
end
end
end
Spork.each_run do
ActiveRecord::Schema.verbose = false
load "#{Rails.root.to_s}/db/schema.rb"
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
end