Integration Testing
We use the end-to-end testing tool Cypress to test the main features of the Airy Live Chat Plugin, the Inbox, and the Control Center.
You can find the tests in the airy repository at /integration. The tests are intended to be run on a local instance; a few values need to be configured before the tests can be run.
Here is a step-by-step guide to running the tests locally:
First, make sure that all dependencies are up-to-date in your
airyrepository. In doubt, delete yournodes_modulesand runyarn install.You need to have the contacts feature enabled (it is disabled by default). To enable it, set the
integration.contacts.enabledfield in your airy.yaml config totrue.Run a local instance with the command
scripts/dev_cli.sh create --provider=minikube. Apply the configuration once the process is finished.Next, start the development server for the Control Center with the command:
./scripts/web-dev.sh //frontend/control-center:bundle_serverNavigate to the
Catalogpage and install the Airy Live Chat Plugin. Once it is installed, navigate to theConnectorspage, selectAiry Chat Plugin, and add a new channel.Copy the channelID of the new channel and add it to the Cypress configuration file
/integration/cypress.config.tsatenv.channelId.Open the demo page by passing the
channel_idas a query parameter:
http://localhost/chatplugin/ui/example?channel_id=<channel_id>
Write a message in the chat.Start the development server of the Inbox:
./scripts/web-dev.sh //frontend/inbox:bundle_serverYou should see the conversation of the Airy Live Chat Plugin channel you just created. Copy its conversationID (it is the id that is passed in its URL) and add it to the configuration file
/integration/cypress.config.tsatenv.conversationId.Then, copy the id of the conversation's message and add it to the configuration file
/integration/cypress.config.tsatenv. messageId(you can find the message's id by inspecting its DOM element, as the id is passed to the DIV as a key).
You are now ready to run the tests on your local instance 🎉
Start the development server for the Control Center with the command
./scripts/web-dev.sh //frontend/control-center:bundle_serverOpen the Cypress dashboard with the command:
/node_modules/.bin/cypress open -C integration/cypress.config.ts
The dashboard lists all tests. You can run tests by clicking on each item on the list.
