Switch between a headed and headless server when integration testing with capybara

185 Views Asked by At

Let's say I have web-rat and selenium installed. How do I test my rails app quickly with web-rat (using capybara) , and then, do one final integration test with selenium?

1

There are 1 best solutions below

0
On BEST ANSWER

Open spec/spec_helper.rb

Add this line:

Capybara.current_driver = :selenium # This is capybara's default server anyway!

Now simply change the symbol to reference whichever server you want. E.g.

To use webkit:

Capybara.current_driver = :webkit 

Or to use Poltergesit:

Capybara.current_driver = :poltergeist