All quizzes
Free quiz · 20 questions in the bank

Capybara quiz

Test your Capybara knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What kind of test is Capybara primarily designed for, as distinct from a narrow unit test of a single method or class?

Questions in this quiz
  1. What kind of test is Capybara primarily designed for, as distinct from a narrow unit test of a single method or class?
  2. What does Capybara's support for RSpec matchers like `have_content` or `have_selector` typically enable in an assertion?
  3. What do Capybara methods like `click_button`, `fill_in`, and `click_link` collectively enable a test to do?
  4. What is a "headless" browser (like headless Chrome, commonly used with a driver such as Cuprite or Selenium's headless mode) in the context of running Capybara tests, and why is it commonly used in CI?
  5. When might a test need to switch to a JavaScript-capable driver (like Selenium or a headless Chrome-based driver) instead of Capybara's default Rack::Test driver?
  6. Why might a Capybara test that passes reliably when run alone occasionally fail intermittently ("flaky") when run as part of a larger, parallelized test suite?
  7. What is a realistic tradeoff to weigh when deciding how much of a test suite should consist of full Capybara feature tests versus narrower unit/controller tests?
  8. What is a common integration between Capybara and the Ruby on Rails testing ecosystem, particularly RSpec?
  9. What is the purpose of Capybara's `within` method, e.g. `within('#sidebar') { click_link 'Settings' }`?
  10. What does Capybara's ability to simulate form interactions like `select` (for dropdowns) or `check`/`uncheck` (for checkboxes) provide beyond simple text field filling?
  11. Why might a test suite using Capybara's default `Rack::Test` driver run significantly faster than one using a full browser driver like Selenium?
  12. What is a general principle Capybara's design illustrates about balancing test realism against test speed/complexity in browser-based testing generally?
Gaps to close?
Read the curated Capybara notes — core concepts, patterns, interview prep.
Capybara notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web