...

/

System Testing the Checkout Flow

System Testing the Checkout Flow

Get familiar with the testing of checkout flow using Active Job.

In Testing Our JavaScript Functionality, we wrote a system test that uses a real browser to simulate user interaction. To test the entire flow of checking out, communicating with the payment processor, and sending an email, we’ll expand that test.

To test the full end-to-end workflow, including the execution of Active Jobs, we want to do the following:

  1. Add a book to the cart.
  2. Fill in the checkout form completely (including selecting a pay type).
  3. Submit the order.
  4. Process all background jobs.
  5. Check that the order was created properly.
...