Installation
To integrate Qase Reporter in your WebdriverIO setup, follow these steps:
Activate the WebdriverIO App
To activate the app, go to the Apps section in your workspace, and click on ‘Activate’
Switch to the ‘Access tokens’ tab, and create a new API token from here. Save the API token as we’ll need it for the next steps.
Install wdio
Run npm init wdio@latest .
to create a project in the current directory, and we’ll choose the following configuration for the purpose of this guide.
Configuration
Add wdio-qase-reporter
to your project
To install and add the reporter as a development dependency, run the following in node project:
npm install -D wdio-qase-reporter@beta
Add the reporter to your configuration file
wdio.conf.ts
:
import WDIOQaseReporter from 'wdio-qase-reporter';
import type { Options } from '@wdio/types';
import { afterRunHook, beforeRunHook } from 'wdio-qase-reporter';
export const config: Options.Testrunner = {
reporters: [
[
WDIOQaseReporter,
{
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: true,
useCucumber: false,
}
]
],
...
=====
Hooks
=====
onPrepare: async function() {
await beforeRunHook();
},
onComplete: async function() {
await afterRunHook();
},
... other options
};
Additional options to configure in the wdio.conf.ts
file:
disableWebdriverStepsReporting
- Default:
false
- to not log custom steps to the reporter.
- Default:
disableWebdriverScreenshotsReporting
- Default:
false
- do not attach screenshots to the reporter.
- Default:
useCucumber
- Default:
false
- if you use Cucumber, enable this option.
- Default:
At the very least, the reporter will need two variables defined - your WebdriverIO App’s Token, and the Qase Project code you want to publish your results to.
We will create a new file qase.config.json
at the root of your project to add these values.
qase.config.json
:
{
"debug": false,
"testops": {
"api": {
"token": "<app-token>"
},
"project": "<project-code>",
"run": {
"complete": true
}
}
}
Please refer to this article for guidance on how to find your Project code in Qase.
Verify the integration
We’ll use the autogenerated login tests to check if the results are being published to your Qase project.
Let’s run the test, by executing the following command:
QASE_MODE=testops npx wdio run ./wdio.conf.ts
In the above command, we’re setting the reporter’s mode to ‘testops’ using the Environment variable QASE_MODE
.
Click on the link printed at the end of the run to go to the test run in Qase.