I am completely new to utilizing Capybara and have not had any experience with Selenium in the past. Currently, I am working on a Ruby on Rails project on MacOSX and encountering an issue where the browser window does not open when I execute my test. My technology stack includes: Capybara, Selenium, RSpec, and Ruby on Rails. Here is the structure of my test:
describe 'Downloads', js: true do
context ' compress zip and download file' do
before do
Capybara.current_driver = :selenium
session = Capybara::Session.new(:selenium)
session.visit '/users/sign_in'
find('#tab_signin').click
within("#new_user") do
fill_in 'user_login', :with => '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7716131a1e19371b1814161b591f180403">[email protected]</a>'
fill_in 'user_password', :with => 'password'
end
click_button 'Sign in'
end
it 'downloads the project and navigates to downloads page' do
visit 'some/path'
within '.create-download' do
find(:select).find("option[value='zip']").select_option
end
sleep 3
page.should have_css('#download-modal.in')
end
end end
I have also attempted making changes to my features/support/env.rb file as follows:
Capybara.javascript_driver = :selenium
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile)
end
Update
Upon running the test, the browser fails to open and displays the following error message:
Failure/Error: visit '/users/sign_in'
ArgumentError:
unknown option: {:resynchronize=>true}