A Simple Way To Setup Slack For Test Automation Notifications

A Toyota production line is stopped when a default is detected.

While a production line is directly visible by all the operators, it is different for an immaterial software production line. Hence, engineering teams using shared communication channels are able to fix defects quicker.

Slack has more than 12.5 million simultaneous users, making it one of the most used communication tools, especially by cross-functional teams. The capability to send messages to Slack is therefore critical for your test automation initiative.

Cerberus Testing is the open-source test automation platform supporting a variety of automation use-cases, plus native connectors. This article is a step-by-step tutorial to connect your Slack channels to Cerberus Testing notifications.

Follow Cerberus Testing for more test automation. 

Pre-requisites

You must have the following requisites in order to perform this tutorial:

  • A Slack account and workspace created (get one on https://slack.com)
  • A Slack public channel created to receive the notifications (created  inside Slack)
  • A Cerberus Testing instance (get yours in the Cloud or on your own)
  • A Cerberus Testing campaign created and available in the menu Run > Campaign

From there, we will follow the following 4 steps:

  1. Create a Slack application
  2. Activate Workspace Webhooks
  3. Retrieve the Webhook URL
  4. Setting up the Campaign Parameters

Let’s start by creating your Slack application.

1. Create a Slack application

The first step is to create Slack application within your Slack account. It should be the account used to host your team collaborative space. 

Navigate to api.slack.com/apps to access the app creation menu “Create a Slack App”. From there, you need to set these two parameters :

  • App Name: enter your desired application name. Ideally it should contains “cerberus” inside to know it is of Cerberus Testing if you come later on
  • Development Slack Workspace: select the workspace that contains the channels to receive the notifications
Figure 1: How to create a Slack app from the Apps menu, Cerberus Testing.

Once clicking on “Create App”, your Slack application is now ready. The next step is to activate the workspace webhooks.

2. Activate Workspace Webhooks

Now that your workspace is created, you need to enable external applications to interact with your channel. With Cerberus Testing, this is achieved through webhooks.

You can activate the webhooks by navigating in the bottom of the page to “Add features and functionality” and select “Incoming Webhooks”. On the page that opens, switch on the slider “Active Incoming Webhooks” to “On”.

Figure 2: How to activate the incoming webhook in Slack, Cerberus Testing.

You can now create your own webhook for Cerberus Testing.

3. Retrieve the Webhook URL

A Webhook URL allows you to segment the incoming calls per application types, or even specific environments. In our case, we will configure a single webhook.

Navigate to the bottom page to “Webhook URLS for Your Workspace” and click on “Add New Webhook to Workspace”. You just need to keep the Webhook URL that has been created and verify it is set on the correct Slack #channel

Figure 3: How to create a Webhook URL in your Slack workspace, Cerberus Testing.

You can now configure your Slack connector inside Cerberus Testing to start receiving notifications.

4. Setting up the Campaign Parameters

Cerberus Testing notifications have evolved for more flexibility. Instead of being fixed, you can configure notifications based on different notifications states.

In our case we will configure the notification only for failed campaign execution. To set your own:

  1. Go to the menu “Run > Campaign > Notifications”
  2. Select your *Event reference” for start or end
  3. Select the “Hook Connector” to “SLACK”
  4. Set the Hook recipient with the webhook url and the Hook channel
Figure 4: Configure a Slack notification in Cerberus Testing.

Test your notifications by running the campaign and verify the slack message appears if the condition are met

Accelerate your Test Automation with native notifications

You are now ready to configure test automation notifications depending on your use-cases, environment and teams. 

By using the built-in features of Cerberus Testing, you are able to directly get the value of notifications, without time spent in coding.

You can also set notifications for other connectors such as Google Chat, Microsoft Teams. Explore the platform to discover them all 🙂

Follow Cerberus Testing for more test automation.

Related resources

Article

The Inexpensive Way To Quickly Monitor Your Automated Tests

Video: Cerberus Integration With Slack
A Simple Way To Setup Slack For Test Automation Notifications
Scroll to top