O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Verifying the shopping cart functionality

In order to verify the shopping cart functionality, we must be able to add a product multiple times to the shopping cart, check that the product exists in the shopping cart with the proper quantity of the product displayed, and have the ability to remove the product from the shopping cart. Therefore, there are 3 expected tests that we will need in the shopping cart test suite.

The main function in the shoppingcart_test.go source file, located in the client/tests/go directory, implements the shopping cart test suite:

func main() {  viewportParams := &caspertest.ViewportParams{Object:   js.Global.Get("Object").New()}  viewportParams.Width = 1440  viewportParams.Height = 960 casper.Get("options").Set("viewportSize", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required