Search⌘ K
AI Features

Acceptance Test the Shopping Cart (Part I)

Explore acceptance testing for a real-time shopping cart built with Phoenix and Elixir. Understand how to define test scenarios, write test steps, and set expectations for cart features like adding, removing items, and synchronization across tabs. This lesson helps you validate that the shopping cart behaves correctly in various user interactions, improving the reliability of your application.

Test scenarios

All the code for our shopping cart is in place. We’ll walk through a few different scenarios and ensure the cart works as expected in each. We would be performing these tests incrementally as we build the system, but it’s essential 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 to quickly work through our acceptance tests. We won’t test what happens after clicking the purchase button to keep things concise.

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

First scenario

We’ll follow the same pattern outlined in the Section ...