WebdriverIO ​
WebdriverIO is an open-source framework for running end-to-end tests in modern web applications. It supports all modern rendering engines including Chromium, WebKit, and Firefox.
This guide explains how to integrate WebdriverIO with TestBeats for centralized and AI-powered reporting.
Prerequisites ​
TestBeats API Key (optional) - Sign in for free with your Work Email at testbeats portal to have a centralized and AI powered reporting. Once you're signed in, create a new organization and generate an API Key.
In-coming Webhook URL - Create an incoming webhook url for your Slack or Microsoft Teams or Google Chat.
Integration ​
TestBeats can consume the following reports for publishing test results from WebdriverIO:
JUnit Reports ​
1. Configure WebdriverIO to generate JUnit reports ​
Update your wdio.conf.js
file to include the junit
reporter:
reporters: [
'dot',
[ 'json', {
outputDir: './results'
}
]
],
2. Configure TestBeats to consume JUnit reports ​
Test results can be either published using the command line mode or the configuration mode.
2.1 Command Line Mode ​
First, specify the target name using the appropriate target flag. For example, use the
--slack
flag to specify the incoming webhook URL.Next, specify the path to the result files using the appropriate results format flag. For example, use the
--junit
flag for junit results.
npx testbeats@latest publish --api-key '<api-key>' --slack '<slack-incoming-webhook-url>' --junit '<path-to-junit-report>'
# Download the executable via `curl`.
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
# After download completes, run the executable based on you operating system.
./testbeats-linux publish --api-key '<api-key>' --slack '<slack-incoming-webhook-url>' --junit '<path-to-junit-report>'
TIP
- TestBeats API Key is optional.
- Environment variable
TEST_BEATS_API_KEY
can also be used to specify the API key.
2.2 Configuration Mode ​
Update your testbeats.config.json
file to include the junit
result file:
{
"api_key": "<api-key>",
"targets": [
{
"name": "slack",
"inputs": {
"url": "<incoming-webhook-url>"
}
}
],
"results": [
{
"type": "junit",
"files": ["<path-to-junit-report>"]
}
]
}
npx testbeats@latest publish -c path/to/testbeats.config.json
# Download the executable via `curl`.
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
# After download completes, run the executable based on you operating system.
./testbeats-linux publish -c path/to/testbeats.config.json
CucumberJS JSON Reports ​
CucumberJS JSON reports are generated by the CucumberJS JSON Reporter.
1. Configure WebdriverIO to generate CucumberJS JSON reports ​
Update your wdio.conf.js
file to include the cucumberjs-json
reporter:
reporters: [
'dot',
[ 'cucumberjs-json', {
outputDir: './results'
}
]
],
2. Configure TestBeats to consume CucumberJS JSON reports ​
Test results can be either published using the command line mode or the configuration mode.
2.1 Command Line Mode ​
First, specify the target name using the appropriate target flag. For example, use the
--slack
flag to specify the incoming webhook URL.Next, specify the path to the result files using the appropriate results format flag. For example, use the
--cucumber
flag for CucumberJS JSON results.
npx testbeats@latest publish --api-key '<api-key>' --slack '<slack-incoming-webhook-url>' --cucumber '<path-to-cucumber-report>'
# Download the executable via `curl`.
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
# After download completes, run the executable based on you operating system.
./testbeats-linux publish --api-key '<api-key>' --slack '<slack-incoming-webhook-url>' --cucumber '<path-to-cucumber-report>'
TIP
- TestBeats API Key is optional.
- Environment variable
TEST_BEATS_API_KEY
can also be used to specify the API key.
Configuration Mode ​
Sample testbeats.config.json
file
{
"api_key": "<api-key>",
"targets": [
{
"name": "slack",
"inputs": {
"url": "<incoming-webhook-url>"
}
}
],
"results": [
{
"type": "cucumber",
"files": ["path/to/result.json"]
}
]
}
npx testbeats@latest publish -c path/to/testbeats.config.json
# Download the executable via `curl`.
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
# After download completes, run the executable based on you operating system.
./testbeats-linux publish -c path/to/testbeats.config.json
Example Integration ​
For a complete example of integrating Webdriver.io with TestBeats, refer to the GitHub repository example.