How teamcapybara/capybara works
Capybara is a Ruby acceptance-testing library that drives web applications through a user-oriented DSL and reports query or matcher results. The principal workflow is test code issuing navigation and interaction commands to a session, which uses a selectable driver to operate on an application; queries and selectors support finding elements and checking page state. Rack::Test and Selenium are the built-in backends, with a server available for Rack applications. Framework adapters expose Capybara to common test frameworks. Relationships reflect README-documented capabilities; sampled source is incomplete, so internal call-level wiring is not inferred.
Main entry points: session.rb Session orchestration · dsl.rb Interaction DSL · rack_test/driver.rb Rack::Test driver · selenium/driver.rb Selenium driver
Components 20
Test API
- Interaction DSL
lib/capybara/dsl.rb - Session orchestration
lib/capybara/session.rb
Query and matching
- Selector registry
lib/capybara/selector/definition.rb - Selector queries
lib/capybara/queries/selector_query.rb - Text queries
lib/capybara/queries/text_query.rb - Node assertions
lib/capybara/node/matchers.rb
Session runtime
- Rack::Test driver
lib/capybara/rack_test/driver.rb - Rack browser
lib/capybara/rack_test/browser.rb - Selenium driver
lib/capybara/selenium/driver.rb - Selenium nodes
lib/capybara/selenium/node.rb - Rack app server
lib/capybara/server.rb - Bundled jQuery
lib/capybara/spec/public/jquery.js - Bundled jQuery UI
lib/capybara/spec/public/jquery-ui.js - Visibility atom
lib/capybara/selenium/atoms/src/isDisplayed.js
Test integrations
- RSpec matchers
lib/capybara/rspec/matchers.rb - Framework adapters
lib/capybara/rspec.rb - Minitest adapter
lib/capybara/minitest.rb - Cucumber adapter
lib/capybara/cucumber.rb
Other components
- Test author
- Web application
Connections 13
- Test author → Interaction DSL: uses
README.md - Interaction DSL → Session orchestration: drives
README.md - Session orchestration → Rack::Test driver: selects backend
README.md - Session orchestration → Selenium driver: selects backend
README.md - Session orchestration → Selector registry: queries with
README.md - Session orchestration → Node assertions: asserts with
README.md - Session orchestration → Rack app server: launches app via
README.md - Rack::Test driver → Web application: tests
README.md - Selenium driver → Web application: drives browser against
README.md - Test author → Framework adapters: loads
README.md - Test author → Minitest adapter: loads
README.md - Test author → Cucumber adapter: loads
README.md - Test author → RSpec matchers: uses
README.md