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 live chat feature

The live chat test suite consists of three tests. First, we must ensure that the chat box opens up when the live chat icon is clicked on the top bar. Second, we must ensure that the chat bot responds to us when we ask it a question. Third, we must ensure that the conversation is retained when we navigate to another section of the website.

The live chat test suite is implemented in the livechat_test.go source file found in the client/tests/go directory.

The waitChat JavaScript function will be used to wait for the chat box to open:

var waitChat = js.MakeFunc(func(this *js.Object, arguments []*js.Object) interface{} {  this.Call("waitForSelector", "#chatbox")  return nil})

The askQuestion JavaScript function will ...

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