Publish results simple and easy.
npm install cucumberjs-qase-reporter
The Cucumber JS reporter has the ability to auto-generate test cases and suites from your test data.
But if necessary, you can independently register the ID of already
existing test cases from TMS before the executing tests. You can decorate your scenarios with Qase TMS case IDs in format Q-<case id>
or Q123
, also q
can be in any case:
Feature: Cucumber documentation
As a user of cucumber.js
I want to have documentation on cucumber
So I can write better applications
@sections @Q-2
Scenario: Usage documentation
Given I am on the cucumber.js GitHub repository
When I go to the README file
Then I should see a "Cool" section
When I go to the README file
@ignore @q4
Scenario: Status badges 2
Given I am on the cucumber.js GitHub repository
When I go to the README file
Then I should see a "Build Status" badge
And I should see a "Dependencies" badge
To run tests and create a test run, execute the command (for example from folder examples):
cucumber-js -f cucumberjs-qase-reporter --format-options='{\"qaseConfig\": \"./.qaserc\"}' features -r examples/zombie/support -r examples/zombie/steps
or
npm test
A test run will be performed and available at:
https://app.qase.io/run/QASE_PROJECT_CODE
Qase reporter supports passing parameters using two ways:
using .qaserc
file and using ENV variables.
.qaserc
parameters:
enabled
- Enable reporterbasePath
- URL Qase.ioenvironmentId
- To execute with the sending of the envinroment informationapiToken
- Token for API access, you can find more information hereprojectCode
- Code of your project (can be extracted from main page of your project:https://app.qase.io/project/DEMOTR
-DEMOTR
is project code here)runId
- Pass Run IDrunName
- Set custom Run name, when new run is created. Supported parameters:%DATE%
runDescription
- Set custom Run description, when new run is createdlogging
- Enabled debug logging from reporter or notrootSuiteTitle
- A parent suite for your autocreated tests
Example configuration file:
{
"enabled": true,
"logging": true,
"apiToken": "api_key",
"projectCode": "project_code",
"runName": "CucumberJS run %DATE%",
"environmentId": 1,
"basePath": "https://api.qase.io/v1"
}
Supported ENV variables:
QASE_ENABLED
- Same asenabled
QASE_API_BASE_URL
- Same asbasePath
QASE_API_TOKEN
- Same asapiToken
QASE_PROJECT
- Same asprojectCode
QASE_RUN_ID
- Pass Run ID from ENV and override reporter optionsQASE_RUN_NAME
- Same asrunName
QASE_RUN_DESCRIPTION
- Same asrunDescription
QASE_ENVIRONMENT_ID
- Same asenvironmentId
QASE_LOGGING
- Same aslogging
QASE_ROOT_SUITE_TITLE
- Same asrootSuiteTitle
To run using ENV you have to execute:
cucumber-js -f cucumberjs-qase-reporter features
Due to different configurations of protractor and cucumber itself you should install a bit more libraries:
npm install cucumberjs-qase-reporter @cucumber/cucumber @cucumber/messages
After that you will be able to use reporter like this (protractor.conf.js
):
exports.config = {
...
cucumberOpts: {
require: [
'./tests/e2e/specs/*.js',
], // require step definition files before executing features
tags: [],
'dry-run': false,
compiler: [],
format: ["node_modules/cucumberjs-qase-reporter"],
},
...
}
Do not forget to add .qaserc file!
We maintain the reporter on LTS versions of Node. You can find the current versions by following the link