Domanda

I'm trying to get Capybara set up with Sauce Connect to do some automated testing of a gem that I've written. I'm using Combustion to spin up a server at localhost:9000 for testing within the browser.

My spec_helper.rb looks likes this:

require 'rubygems'
require 'bundler'

Bundler.require :development

require 'rspec/rails'
require 'capybara/rails'
require 'capybara/rspec'
require 'sauce/capybara'
require 'sauce/parallel'

Combustion.initialize!

# Engine config initializer
require 'setup_credentials.rb'

RSpec.configure do |config|
  #config.use_transactional_fixtures = true
end



Capybara.default_driver = :sauce
Capybara.server_port = 9000

BROWSERS = [
  ["Mac", "Firefox", "17"]
]

index = ENV["TEST_ENV_NUMBER"] != "" ? (ENV["TEST_ENV_NUMBER"].to_i - 1) : 0
platform = BROWSERS[index]
Sauce.config do |config|
  config[:os] = platform[0]
  config[:browser] = platform[1]
  config[:version] = platform[2]
end

In another terminal I'm running:

java -jar Sauce-Connect.jar MY-USERNAME MY-API-KEY -p localhost:9000

I have on spec named miso_spec.rb that looks like this:

require "spec_helper"

describe "File upload", :sauce => true do
  it "should go through locally" do
    visit "http://localhost:9000"
    fill_in 'search', :with => "platform"
    click_button "searchButton"
    page.should have_content "Screencasts"
  end
end

And I'm running it by executing this command:

rspec -P "spec/features/miso_spec.rb"

A few seconds after initiating this command, my server is flooded with the GET request below and continues indefinitely.

Started GET "/__identify__" for 127.0.0.1 at 2013-05-31 13:51:05 +0200
** [Raven] User excluded error: #<ActionController::RoutingError: No route matches [GET] "/__identify__">

ActionController::RoutingError (No route matches [GET] "/__identify__"):

When I check the video on Saucelabs.com, I can see that the browser never makes it to http://localhost:9000. What is odd, however, is that when I take control of the testing session (you can click the video on Sauce Labs of the browser test while it is running to take control), manually navigating to this address brings up the locally-hosted page.

I'm fairly certain that I've ruled out Combustion being the source of the problem. Booting up a standard Rails server on this port still gives the routing error posted above. I'm not sure how to proceed. Thanks.

È stato utile?

Soluzione

Figured it out. I realized that I was requiring several things more than once, so I commented out lines 6-8 in spec_helper.rb.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top