Developer(s) | Thomas Walpole |
---|---|
Stable release |
2.13.0
|
Written in | Ruby |
Operating system | Cross-platform |
Type | Behavior driven development framework / Test tool |
License | MIT License |
Website | teamcapybara |
Capybara is a web-based test automation software that simulates scenarios for user stories and automates web application testing for behavior-driven software development. It is a part of the Cucumber testing framework written in the Ruby programming language that simulates various aspects of a web browser from the perspective of a real user.
Pretending to be a user, it can interact with the application to receive pages, parse the HTML and submit the forms.
In the course of the software development process especially in the Agile and Test-driven Development environments, as the size of the tests increase, it becomes difficult to manage tests which are complex and not modular.
By extending the human-readable behavior-driven development style of frameworks such as Cucumber and RSpec into the automation code itself, Capybara aims to develop simple web-based automated tests.
Capybara is a library/gem built to be used on top of an underlying web-based driver. It offers a user-friendly DSL (Domain Specific Language) which is used to describe actions that are executed by the underlying web driver.
When the page is loaded using the DSL (and underlying web driver), Capybara will try to locate the relevant element in the DOM (Document Object Model) and execute the action, such as click button, link, etc.
By default, Capybara uses the :rack_test
driver which does not have any support for executing JavaScript. Driver can be switched in Before and After blocks. Some of the web drivers supported by Capybara are mentioned below.