Application Testing with Capybara

Confidently implement automated tests for web applications using Capybara
Preview in Mapt

Application Testing with Capybara

Matthew Robbins

1 customer reviews
Confidently implement automated tests for web applications using Capybara
Mapt Subscription
FREE
$29.99/m after trial
eBook
$14.00
RRP $19.99
Save 29%
Print + eBook
$33.99
RRP $33.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$14.00
$33.99
$29.99p/m after trial
RRP $19.99
RRP $33.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Application Testing with Capybara Book Cover
Application Testing with Capybara
$ 19.99
$ 14.00
Penetration Testing with Shellcode Book Cover
Penetration Testing with Shellcode
$ 39.99
$ 28.00
Buy 2 for $31.50
Save $28.48
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781783281251
Paperback104 pages

Book Description

Everybody understands why implementing automated tests is important but at the same time developing them can be costly and time consuming, and tests can be also be fragile and prone to false positives. By using Capybara, you can develop robust tests quickly and run them in multiple drivers ensuring greater re-use; Capybara’s API also extends the human readable style made popular by frameworks such as Cucumber and RSpec.

"Application Testing with Capybara" takes you from installing the gem to getting up and running with a YouTube search scenario within the first two chapters. We then look deeper into the API, using Rack-Test for applications built with Rails or Sinatra and see how to test handle Asynchronous JavaScript and “black box” components such as Flash. Finally, we consider some advanced topics such as looking at alternatives to Selenium and accessing the native driver directly.

This book takes you from the basics of installing Capybara, through its API and onto advanced topics. You will learn how to use Capybara’s extensive API to interact with your application, covering topics such as navigation, filling in forms, and querying your page for expected content. Beyond this we will consider why Capybara is so well suited to testing applications written in frameworks such as Rails and Sinatra. We will look at strategies for validating seemingly “untestable” components such as HTML5 or Flash by building out a testable API. Finally we will turn you into a Capybara ninja by covering advanced topics such as accessing functionality in the base driver, advanced driver configuration, and alternative flavours of drivers outside Selenium and Rack-Test.

Table of Contents

Chapter 1: Your First Scenario with Capybara
Installing Capybara
Preparing your system
Installing system libraries
Installing Capybara
Installing Cucumber and Selenium
Cucumber-Rails
Your first scenario – a YouTube search
Summary
Chapter 2: Mastering the API
Locating elements with XPath and CSS
Navigation
Submitting forms
Finders, scoping, and multiple matches
Asserting and querying
Summary
Chapter 3: Testing Rails and Sinatra Applications
Understanding the Rack interface
Capybara and Rack::Test
Which driver to use and when?
A note on Rails/RSpec and Capybara
Summary
Chapter 4: Dealing with Ajax, JavaScript, and Flash
Ajax and asynchronous JavaScript
Flash and HTML5 – black box elements
Summary
Chapter 5: Ninja Topics
Using Capybara outside of Cucumber
Advanced interactions and accessing the driver directly
Advanced driver configuration
The driver ecosystem
Summary

What You Will Learn

  • Install and configure Capybara
  • Use Capybara and Cucumber to test scenarios
  • Exploit Capybara’s API for interacting with web pages
  • Employ Capybara to test Rack applications implemented using Rails or Sinatra
  • Handle asynchronous JavaScript
  • Apply Capybara to test “black box” components such as Flash or HTML5 Canvas, Audio, and Video
  • Practise Capybara outside Cucumber in bespoke frameworks
  • Use Capybara with popular Ruby test frameworks
  • Explore advanced driver configuration
  • Work with alternative drivers such as Capybara-Webkit and Capybara-Mechanize

Authors

Table of Contents

Chapter 1: Your First Scenario with Capybara
Installing Capybara
Preparing your system
Installing system libraries
Installing Capybara
Installing Cucumber and Selenium
Cucumber-Rails
Your first scenario – a YouTube search
Summary
Chapter 2: Mastering the API
Locating elements with XPath and CSS
Navigation
Submitting forms
Finders, scoping, and multiple matches
Asserting and querying
Summary
Chapter 3: Testing Rails and Sinatra Applications
Understanding the Rack interface
Capybara and Rack::Test
Which driver to use and when?
A note on Rails/RSpec and Capybara
Summary
Chapter 4: Dealing with Ajax, JavaScript, and Flash
Ajax and asynchronous JavaScript
Flash and HTML5 – black box elements
Summary
Chapter 5: Ninja Topics
Using Capybara outside of Cucumber
Advanced interactions and accessing the driver directly
Advanced driver configuration
The driver ecosystem
Summary

Book Details

ISBN 139781783281251
Paperback104 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Selenium WebDriver Practical Guide Book Cover
Selenium WebDriver Practical Guide
$ 26.99
$ 18.90
Selenium Testing Tools Cookbook Book Cover
Selenium Testing Tools Cookbook
$ 26.99
$ 18.90
Chef Infrastructure Automation Cookbook Book Cover
Chef Infrastructure Automation Cookbook
$ 26.99
$ 18.90
Jenkins Continuous Integration Cookbook Book Cover
Jenkins Continuous Integration Cookbook
$ 26.99
$ 18.90
Responsive Web Design by Example : Beginner's Guide Book Cover
Responsive Web Design by Example : Beginner's Guide
$ 26.99
$ 18.90