Acceptance Test the Shopping Cart

All the code for our shopping cart is in place. We’re going to walk through a few different scenarios and ensure the cart works as expected in each. You would be performing these types of tests incrementally as you build the system, but it’s important to run through all of the scenarios again when the code is complete.

Our test scenarios revolve around the requirements—we’ll combine multiple requirements into a single scenario, so that we can quickly work through our acceptance tests. To keep things concise, we won’t test what happens after clicking the purchase button.

Our first scenario will be a test of the add and remove item features.

First Scenario

We’ll follow the same pattern as outlined in Chapter ...

Get Real-Time Phoenix now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.