Iteration G3: Testing Our JavaScript Functionality
Now that we have application-level functionality in JavaScript code, we’re going to need to have tests in place to ensure that the function not only works as intended but continues to work as we make changes to the application.
Testing this functionality involves a lot of steps: visiting the store, selecting an item, adding that item to the cart, clicking checkout, filling in a few fields, and selecting a payment type. And from a testing perspective, we’re going to need both a Rails server and a browser.
To accomplish this, Rails makes use of the popular Google Chrome web browser and Capybara,[65] which is a tool that drives this automation. Microsoft Edge and Mozilla’s Firefox are also ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access