Note that there are some explanatory texts on larger screens.

plurals
  1. POwriting test for rspec using capybara where java script is not working
    primarykey
    data
    text
    <p>In my Gemfile i have use </p> <pre><code>group :development, :test do gem 'rspec-rails' gem 'factory_girl_rails' gem 'capybara', :git =&gt; 'git://github.com/jnicklas/capybara.git' gem 'launchy' end group :test do gem 'faker' gem 'guard-rspec' gem 'selenium-webdriver', '2.35.1' # gem 'capybara-webkit' gem 'database_cleaner' end </code></pre> <p>In spec/spec_helper.rb </p> <pre><code># This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' require 'capybara/rspec' require 'capybara/rails' Capybara.default_driver = :selenium Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration) RSpec.configure do |config| config.include Capybara::DSL config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = false config.order = "random" end </code></pre> <p>in spec/requests/home_spec.rb</p> <pre><code>describe "Homepage with 'Government Contracts Awarded By Year'", :js =&gt; true do it "should have visible" do visit root_path page.has_content?('Government Contracts Awarded By Year') end it "Graph View", :driver =&gt; :selenium do page.has_css?('#ui-id-1') # $("#by_year_tabs ul li a#ui-id-1").text() click_link 'ui-id-1' end it "Table View", :driver =&gt; :selenium do page.has_css?('#ui-id-2') # click_link 'ui-id-2' page.has_selector?(:xpath, '//table/tr') end end </code></pre> <p>when i run this test on terminal then i got error </p> <p>Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)</p> <p>i have ried many versions of selenium but not fix yet ... please give valuable suggetions to solve this kind of problem and i am on vagrant in which i have installed firefox as well crome setup already.</p> <p>thanks </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload