Skip to main content

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 airy repository. In doubt, delete your nodes_modules and run yarn install.

  • You need to have the contacts feature enabled (it is disabled by default). To enable it, set the integration.contacts.enabled field in your airy.yaml config to true.

  • 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_server

  • Navigate to the Catalog page and install the Airy Live Chat Plugin. Once it is installed, navigate to the Connectors page, select Airy 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.ts at env.channelId.

  • Open the demo page by passing the channel_id as 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_server

  • You 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.ts at env.conversationId.

  • Then, copy the id of the conversation's message and add it to the configuration file /integration/cypress.config.ts at env. 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_server

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

Create Tags
Last updated on