O'Reilly logo

RSpec Essentials by Mani Tadayon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Driving a Web Browser with Capybara

In the preceding five chapters, we have covered all the important features of RSpec, focusing on unit tests for libraries and command-line tools. Now it is time to build on this foundation to learn how to write end-to-end tests for web applications. In order to test web applications in a realistic way, we need to a way to interact with a web browser in our tests. The Capybara gem allows us to control a variety of browsers from within our test code to interact with a web application and make assertions about the behavior of the application within the browser.

In this chapter, we'll get familiar with how Capybara works, and how it integrates with RSpec. Unlike the preceding chapters, in which we developed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required