0

I'm working on an advertising application, where there is some cross-domain JS. I'd like to write tests that verify that the cross-domain JS is working as intended.

My first thoughts are that I would need to be able to

visit some_url_thats_not_my_rails_app

However, Capybara throws a "No Route Matches", since it obviously goes to only relative paths, and is intended for testing your OWN website. But I really need to go on ANOTHER page, and verify that things like the serialized token are identical.

Is Capybara the right tool for this? If so, what do I need to do to force non-relative paths?

1 Answer 1

2

Yes, Capybara is right tool for it. You can also use Ruby with Selenium webdriver(Would be awesome with page object gem) or Ruby with Watir webdriver.

To visit and test any web application, you can use Ruby and Capybara. For this you need to set app_host. Add this one in support/env.rb:

Capybara.app_host = "http://flipkart.com"
And in hooks.rb
Before do
  visit('/')
end

You can use Capybara with Selenium webdriver and you will be good to test any deployed application in production, staging or prep env.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.