Capybara can mimic actions of real users interacting with web-based applications.
[3] Capybara is a Ruby library (also referred to as a gem) that is used with an underlying web-based driver.
It consists of a user-friendly DSL (Domain Specific Language) which describe actions that are executed by the underlying web driver.
[4] When the page is loaded using the DSL (and underlying web driver), Capybara will attempt to locate the relevant element in the DOM (Document Object Model) and execute an action such as click button, link, etc.
Written in Ruby, Capybara's default driver RackTest does not require a server to be started since it directly interacts with Rack interfaces.
Unlike Capybara's default driver, it supports JavaScript, can access HTTP resources outside of application and can also be set up for testing in headless mode which is especially useful for CI scenarios.
[4] Capybara-webkit driver (a gem) is used for true headless browser testing with JavaScript support.