On this page
Overview
Capybara is a Ruby library for testing web applications through user-facing actions such as following links, filling forms, and checking page text. It can exercise Rack applications without a browser and use the same interaction model with browser drivers.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Best fit
Before adoption
Official sources
- [1]teamcapybara/capybara README at 3.40.0(2026-10-05)
- [2]Capybara official documentation(2026-10-05)
- [3]Capybara fixed version source(2026-10-05)
- [4]teamcapybara/capybara License.txt at 3.40.0(2026-10-05)
- [5]teamcapybara/capybara GitHub metadata(2026-10-05)
Supplemental curator note
A strong fit when user journeys should read naturally in Ruby tests. Start with a small Rack app that needs no external browser and verify navigation plus visible content.
Try it in 3 steps
- 1
Create a pinned test project
Requires Ruby 3.0 or later and Bundler. Create a temporary project pinned to Capybara 3.40.0.
demo=$(mktemp -d "${TMPDIR:-/tmp}/capybara-demo.XXXXXX") && cd "$demo" && printf '%s\n' 'source "https://rubygems.org"' 'gem "capybara", "3.40.0"' 'gem "minitest", "~> 5.0"' > Gemfile - 2
Install the dependencies
Install dependencies under vendor/bundle inside the temporary project.
bundle config set path vendor/bundle && bundle install - 3
Verify a Rack user journey
Visit an in-memory Rack app, follow Greeting, and require Minitest to find Hello Ada.
printf '%s\n' 'require "capybara/minitest"' 'require "minitest/autorun"' 'class JourneyTest < Minitest::Test' ' include Capybara::DSL' ' include Capybara::Minitest::Assertions' ' def setup' ' Capybara.app = ->(env) { env["PATH_INFO"] == "/hello" ? [200,{"content-type"=>"text/html"},["<h1>Hello Ada</h1>"]] : [200,{"content-type"=>"text/html"},["<a href=/hello>Greeting</a>"]] }' ' end' ' def test_journey' ' visit "/"; click_link "Greeting"; assert_text "Hello Ada"' ' end' 'end' > demo.rb && bundle exec ruby demo.rb
Growth
Growth trends · Last 30 days
10,177 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 2
- Open PRs
- 20
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- hacktoberfest
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Catch221,507 Stars
1 shared tag(s) · 1 shared category(s)
write C++ unit tests, BDD scenarios, and micro-benchmarks in one test framework and integrate them with CMake and CTest
C++ - React Testing Library19,660 Stars
1 shared tag(s) · 1 shared category(s)
A React DOM testing library that queries by roles and accessible names to verify user-visible behavior
JavaScript - Keploy18,539 Stars
1 shared tag(s) · 1 shared category(s)
turn real network traffic into API tests and dependency mocks without application SDK changes
Go - RSpec Rails5,276 Stars
3 shared tag(s) · 1 shared category(s) · Same language
Describe and verify Rails models, HTTP responses, and browser behavior as specs
Ruby - SimpleCov4,927 Stars
2 shared tag(s) · 1 shared category(s) · Same language
A Ruby coverage library that merges test results and reveals code left unexecuted
Ruby - WebMock4,049 Stars
2 shared tag(s) · 1 shared category(s) · Same language
stub Ruby HTTP requests without real network calls and verify expectations against methods, URIs, headers, and bodies
Ruby
Report incorrect information
Tell us if any listing information is incorrect or outdated.