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

Leave a comment

Your email address will not be published. Required fields are marked *

Cerberus-Testing Terms Of Service


Website Terms and Conditions of Use

1. Terms

By accessing this Website, accessible from http://vgeouyk.cluster030.hosting.ovh.net, you are agreeing to be bound by these Website Terms and Conditions of Use and agree that you are responsible for the agreement with any applicable local laws. If you disagree with any of these terms, you are prohibited from accessing this site. The materials contained in this Website are protected by copyright and trade mark law. These Terms of Service has been created with the help of the Terms of Service Generator and the Privacy Policy Template.

2. Use License

Permission is granted to temporarily download one copy of the materials on Cerberus Testing's Website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:

  • modify or copy the materials;
  • use the materials for any commercial purpose or for any public display;
  • attempt to reverse engineer any software contained on Cerberus Testing's Website;
  • remove any copyright or other proprietary notations from the materials; or
  • transferring the materials to another person or "mirror" the materials on any other server.

This will let Cerberus Testing to terminate upon violations of any of these restrictions. Upon termination, your viewing right will also be terminated and you should destroy any downloaded materials in your possession whether it is printed or electronic format.

3. Disclaimer

All the materials on Cerberus Testing’s Website are provided "as is". Cerberus Testing makes no warranties, may it be expressed or implied, therefore negates all other warranties. Furthermore, Cerberus Testing does not make any representations concerning the accuracy or reliability of the use of the materials on its Website or otherwise relating to such materials or any sites linked to this Website.

4. Limitations

Cerberus Testing or its suppliers will not be hold accountable for any damages that will arise with the use or inability to use the materials on Cerberus Testing’s Website, even if Cerberus Testing or an authorize representative of this Website has been notified, orally or written, of the possibility of such damage. Some jurisdiction does not allow limitations on implied warranties or limitations of liability for incidental damages, these limitations may not apply to you.

5. Revisions and Errata

The materials appearing on Cerberus Testing’s Website may include technical, typographical, or photographic errors. Cerberus Testing will not promise that any of the materials in this Website are accurate, complete, or current. Cerberus Testing may change the materials contained on its Website at any time without notice. Cerberus Testing does not make any commitment to update the materials.

6. Links

Cerberus Testing has not reviewed all of the sites linked to its Website and is not responsible for the contents of any such linked site. The presence of any link does not imply endorsement by Cerberus Testing of the site. The use of any linked website is at the user’s own risk.

7. Site Terms of Use Modifications

Cerberus Testing may revise these Terms of Use for its Website at any time without prior notice. By using this Website, you are agreeing to be bound by the current version of these Terms and Conditions of Use.

8. Your Privacy

Please read our Privacy Policy.

9. Governing Law

Any claim related to Cerberus Testing's Website shall be governed by the laws of fr without regards to its conflict of law provisions.

Thank you for your interest in cerberus,

In order to proceed with your SaaS we need some in order to confirm your instances accesses.

Please provide accurate contacts to secure the process.

You can cancel any time the subscription, please read Terms of Use.