Black Box Testing with RSpec and Capybara
summary
Using Capybara and RSpec with the page object pattern replaces repeated visit fill_in click lines with single page methods, extracts shared sections, and uses Ruby's forwardable to wrap Capybara elements. A practical tip uses has_no_css to avoid unnecessary wait time. The example suite shows single-line registration, no magic selectors, fewer duplicated strings, faster tests and one-place UI changes so refactoring actually works.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:42Capybara
- 1:33Registration form spec
- 1:52Adding another spec
- 2:08And more specs!
- 3:26Page object pattern
- 4:25Revised spec
- 4:51Simplify other specs
- 5:17Making more page objects
- 5:55Page base object
- 6:09Other shared methods
- 7:09New Registration Page class Registration Pace
- 7:51Page sections
- 10:29Sharing similar sections
- 10:54Form implementation
- 11:44Real world example
- 13:18Tests are code
- 14:08Jilian Rosile Comverge
related talks
21mWriting Declarative, Maintainable Integration Tests Using Page Objects
01h 19mBDD and Acceptance Testing with RSpec & Capybara
49mFront End Testing Frontier
29mMinitest with Capybara: Tips, Tricks and Lessons Learned
34mEliminating Inconsistent Test Failures
32mAmbitious Capybara
30mTeaching Capybara Testing - An Illustrated Adventure
20mMake it SPECtacular
