Slack is a team communication tool that provides real-time messaging. You can integrate ReadyAPI with Slack to share your test results with your team in a Slack channel or in direct messages.
Test results include a short summary of a test run and an archived report.
Note: | To receive only a test run summary without a report, disable reporting on the Reporting tab of the Launch TestRunner dialog, or do not set the corresponding arguments if you launch the runner using the command line. You can send a test run summary only to one Slack channel or user. |
Important Notes
-
Currently, Slack integration is supported only for functional tests that are run via Functional TestRunner.
-
To integrate ReadyAPI with Slack, you need a ReadyAPI Test Pro license. If do not have it, you can either request it on our web site or start a trial.
-
To integrate ReadyAPI with Slack, you need to create a Slack application in your workspace. If you leave your workspace, your application will be uninstalled.
1. Create a Slack App
To integrate ReadyAPI with Slack, you need to create and set up a Slack application that uses workspace tokens. To do this:
-
In your browser, navigate to https://api.slack.com/apps?new_app_token=1.
-
In the Create a Slack App dialog, enter an application name, select your workspace, and click Create App.
-
Switch to the OAuth & Permissions tab, select the following permission scopes from the Scopes > Select Permission Scopes dropdown, and click Save Changes:
-
chat:write:bot
-
chat:write:user
-
files:write:user
-
bot
-
-
Switch to the Bot Users tab and click Add a Bot User.
-
Specify a Display name and Default username of the bot and click Add Bot User > Save Changes.
-
Switch to the Install App tab, click Request Approval > Submit Request, and then click Install App to Workspace.
2. Configure ReadyAPI
Now, you need to set up ReadyAPI to post test results via Slack. To do this, you need to provide the following:
-
The authentication token of the bot user of your Slack application.
How to get the token
-
Slack channels or the IDs of the users to send test results to. You can specify both channels and user IDs.
To specify a channel, use the
#channel-name
format.To send test results to a user in a private message, specify the ID of the user.
How to learn the user ID
-
In Slack, search for a user in your workspace and open their profile.
-
Click > Copy member ID.
-
You can integrate ReadyAPI with Slack by using the ReadyAPI user interface or command-line arguments.
In ReadyAPI UI
-
In ReadyAPI, select Project > Launch TestRunner from the main menu.
-- or --
In ReadyAPI Navigator, right-click the needed test case and select Launch TestRunner.
-
In the Launch TestRunner dialog, set up integration with Slack in either way:
-
Switch to the Reports tab and specify the following options:
-
Root Folder – (Optional) The directory that will store the test reports ReadyAPI will export. If the directory is not set, the test runner will post a test run summary without a report to Slack.
-
Slack Access Token – Your bot user authentication token.
-
Slack Channel(s) – A comma-separated list of Slack channels in the
#channel-name
format, or the IDs of the users the test results will be sent to.
-
-
Switch to the Custom Args tab and enter the
-W<access token>/<channel(s)>
command-line argument, where <access token> is your bot user authentication token, and <channel(s)> is a comma-separated list of Slack channels or user IDs.
-
-
Configure the other options as needed.
-
Click Launch.
With the Command Line
-
Launch TestRunner with the following command-line argument:
<ReadyAPI>/bin>testrunner.bat -W<access token>/<channel(s)> -
Specify other arguments as required.