changing selenium domain/subdomain within cucumber scenarios
- by dalyons
So, I have a Rails webapp that utilizes subdomains for separating the admin functionality from the public functionality using subdomain-fu.
So there is functionality(that I want to test!) contained within two urls(eg admin.example.com and www.example.com). I want some scenarios to run against the admin domain, and some against the www domain.
My problem is that I cant figure out how to change the domain that selenium uses at any time after startup. I can put something like this in my env.rb:
Webrat.configure do |config|
config.mode = :selenium
config.application_address = "admin.example.com"
end
And it will work, but only for the scenarios that need the admin domain. If I try something like:
host! "www.example.com"
inside my steps, well it seems to just be ignored by selenium, which goes on using "admin.example.com"
Any ideas? Or if its not possible, any ideas for a workaround?