Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:40:31+00:00 2026-06-11T02:40:31+00:00

I am using Capybara with Cucumber in my rails application. I want to run

  • 0

I am using Capybara with Cucumber in my rails application. I want to run the Sphinx reindex and the Redis server to be running for some specific Test Scenarios. But the downside here is the scenarios are very very slow making it run for hours.

Here is my env.rb file

require 'rubygems'

ENV["RAILS_ENV"] = "cucumber"

require 'cucumber/rails'
require 'capybara/cucumber'
require 'capybara/rails'
require 'capybara/session'
require 'rake'

Capybara.default_selector = :css
ActionController::Base.allow_rescue = false
Cucumber::Rails::World.use_transactional_fixtures = true
Capybara.default_wait_time = 4
Capybara.ignore_hidden_elements=false
Capybara::Server.new(Capybara.app).boot

include Rake::DSL
Rake::Task["db:fixtures:load"].invoke

Before('@javascript') do
  Capybara.register_driver :selenium do |app|
    Capybara::Selenium::Driver.new(app,:browser=>:chrome )
  end
  Capybara.current_driver = :selenium
  Capybara.javascript_driver=:selenium
end

Before('@javascript', '@index') do
  `rake ts:in RAILS_ENV=cucumber` unless ThinkingSphinx.sphinx_running?
  `rake ts:start RAILS_ENV=cucumber`
end

After('@javascript','@index') do
  `rake ts:stop RAILS_ENV=cucumber`
end

Before('@javascript','@redis','@javascript') do
  `redis-server config/test_redis.conf`
  `rake redis_specifics:cache_build RAILS_ENV=cucumber --trace`
end

After('@javascript','@redis','@javascript') do
  pid = `ps aux | grep 'config/test_redis.conf'| grep -v 'grep' | awk '{print $2}'`
  `pkill #{pid}`
end

One more problem is when I run this on different machines, there is a dependency that Redis is installed and that the user is having permission to create and destroy folders. Is there a better way to handle this situation? May be to implement the similar transactional style fixtures that the Normal testing framework of Rails uses ?

Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:40:32+00:00Added an answer on June 11, 2026 at 2:40 am

    I’d suggest using a library like fakeredis (https://github.com/guilleiguaran/fakeredis). This will get rid of the dependency on redis in your tests, and ensure that data is not kept around between tests.

    I’d expect there to be something similar for sphinx, but don’t know of anything off the top of my head.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an integration test for a rails application using Capybara within Rspec. After
I'm using Capybara through Cucumber to test a Rails app. The Rails app has
I am using capybara and selenium to run my cucumber test on my local
I am running some cucumber features using capybara and I need to check if
Using cucumber and capybara to test a rails app. Assuming I cannot change the
I am running integration tests for my Rails app using Cucumber with Capybara. I
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1, capybara-1.1.2 and factory_girl-2.6.3. I have
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1 and capybara-1.1.2 with the Selenium
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1 and capybara-1.1.2 with the Selenium
I am using Ruby on Rails with Cucumber and Capybara. How would I go

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.