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 ...

Get Isomorphic Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.