Multi domain app. Using POW server locally. Cucumber tests
In one of the steps i set app_host (subdomain belongs to account and fabricated each time):
def set_current_subdomain(subdomain)
Capybara.app_host = "http://#{subdomain}.example.com:#{Capybara.server_port}"
end
in cucumber settings:
Capybara.run_server = true
Capybara.server_port = 8200
Capybara.javascript_driver = :selenium #default driver when you using @javascript tag
Capybara.app = Rack::ShowExceptions.new(MyApp::Application)
Capybara.default_driver = :rack_test
Step example
visit(new_user_session_url(subdomain: @account.subdomain, port: Capybara.server_port))
Cucumber tests pass with :rack_test but not with :webkit or :selenium
Unable to load URL: http://veumbogan8d11d7feca.example.com:8200/signin because of error loading http://veumbogan8d11d7feca.example.com:8200/signin: Unknown error (Capybara::Webkit::InvalidResponseError)
webkit_debug output:
Finished "EnableLogging" with response "Success()"
Wrote response true ""
Received "Visit"
Started "Visit"
Load started
"Visit" started page load
Started request to "http://kuphal375cb65167.example.com:8200/signin"
Finished "Visit" with response "Success()"
Received 0 from "http://kuphal375cb65167.example.com:8200/signin"
Page finished with false
Load finished
Page load from command finished
Wrote response false "{"class":"InvalidResponseError","message":"Unable to load URL: http://kuphal375cb65167.example.com:8200/signin because of error loading http://kuphal375cb65167.example.com:8200/signin: Unknown error"}"
When using selenium, firefox opens with "Server not found"
Nothing suspicious in test.log: account was created, notification email has been sent, etc
- rails 3.2.17
- mongoid 2.4.11
- capybara 2.1.0
- webkit 1.1.1
- selenium-webdriver 2.40.0
Would appreciate an advice how to debug this and what might be the problem
PS: database_cleaner setup:
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.orm = "mongoid"
Before { DatabaseCleaner.clean }