Learning RackTest
RackTest is Capybara’s default driver. It is written in pure Ruby and does not have any support for executing JavaScript. Since this driver interacts directly with Rack interfaces. Moreover, it does not require a server to be started. However, this means that if your application is not a Rack application (Rails, Sinatra and most other Ruby frameworks are Rack applications). Then, you cannot use this driver. Furthermore, you cannot use the RackTest driver to test a remote application, or to access remote URLs (e.g., redirects to external sites, external APIs, or OAuth services) that your application might interact with.
capybara-mechanize provides a similar driver that can access remote servers.
RackTest can configure with a set of headers like this:
Capybara.register_driver :rack_test do |app|
Capybara::RackTest::Driver.new(app, :headers => { ‘HTTP_USER_AGENT’ => ‘Capybara’ })
End
the section on adding and configuring drivers.
Make your resume stand out and become a Certified Capybara Testing Professional. Try free practice tests here!
A great career is just a certification away. So, practice and validate your skills to become Certified Capybara Testing Professional