Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@ssense/cucumber-testrail-sync
Advanced tools
This module has two main features:
It can synchronize test cases from TestRail to
.feature
files on your local filesystem.
It can automatically push test results to TestRail.
npm i @ssense/cucumber-testrail-sync
We propose the following collaborative workflow for BDD testing:
At the root of your project, create the .testrail-sync.js
file.
module.exports = {
testrail: {
host: '', // testrail host
user: '', // testrail username
password: '', // testrail password or api key
filters: {
plan_id: '', // testrail plan id
}
},
};
There are other possible options:
overwrite: {
local: 'ask',
remote: false,
}
stepDefinitionsTemplate: The template to use to generate blank step definition files (ie. stepDefinitionsTemplate: 'es5.js'
)
indent: The indentation to use when generating .feature
or .js
files (ie. indent: ' '
)
featuresDir: The directory where .feature
files should be created (ie. featuresDir: 'features'
)
stepDefinitionsDir: The directory where blank step definition files should be created (ie. stepDefinitionsDir: 'features/step_definitions'
)
directoryStructure: Used to match the TestRail sections tree with the local tests directory structure.
type: The variable name to used to create the folders. Can be either section:slug
or section:name
skipRootFolder: The number of root sections to skip.
Then you can run the ./node_modules/.bin/cucumber-testrail-sync
command to fetch the test cases from TestRail.
You will first need to create the .testrail-sync.js
config file, as described above, and set the pushResults option to true
.
Then, we have to setup the following things :
Right before running the tests, a Test Run has to be created in TestRail.
After each test case has been run, the result has to be pushed to TestRail (bound to the previously created Test Run).
In order to achieve this, you will need to register some Cucumber event handlers (features/support/hooks.js
) :
var testrailSync = require('@ssense/cucumber-testrail-sync');
module.exports = function () {
var testResultSync = new testrailSync.ResultSynchronizer(testrailSync.readConfig());
this.registerHandler('BeforeFeatures', function (features, callback) {
testResultSync.createNewTestRun(callback);
});
this.After(function (scenario, callback) {
testResultSync.pushResult(scenario, callback);
});
};
Or for TypeScript :
import * as testrailSync from '@ssense/cucumber-testrail-sync';
module.exports = function (): void {
const testResultSync = new testrailSync.ResultSynchronizer(testrailSync.readConfig());
this.registerHandler('BeforeFeatures', function (features, callback) {
testResultSync.createNewTestRun(callback);
});
this.After(function (scenario, callback) {
testResultSync.pushResult(scenario, callback);
});
};
When creating the blank step definitions files, avoid creating duplicate step definitions if they are implemented in other files
Add patterns/params detection when creating the step definitions files
FAQs
Synchronize test cases from TestRail & pushes Cucumber results
The npm package @ssense/cucumber-testrail-sync receives a total of 16 weekly downloads. As such, @ssense/cucumber-testrail-sync popularity was classified as not popular.
We found that @ssense/cucumber-testrail-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.