3
votes

I created a simple Rails 4 app that uses Facebook to login. I'm writing a feature test that would allow me to sign in to Github and verify that it redirects back to my home page.

The problem:

  • Facebook app is configured to respond to localhost:5000.
  • Selenium browser launches app in 127.0.0.1:5723

So the login fails.

``` require 'rails_helper'

describe 'the registration process', js: true do it 'signs me in using Github' do visit root_path

click_link 'Sign up / Login'
find("a[href='/users/auth/facebook']").click
within('.auth-form-body') do
  fill_in 'login', with: 'foobar'
  fill_in 'password', with: 'barbaz'
end
click_button 'Sign in'

end end ```

What can I do to configure Selenium to use the same old localhost:5000?

1
Just a doubt, cant you use visit 'localhost:5000' of capybara dsl to route to port 5000Manoj Menon

1 Answers

0
votes
Capybara.server_port = 8200

This worked. And I found it from When running selenium with capybara/rails, how do I configure the server?