What is allure-commandline?
The allure-commandline npm package is a command-line interface for Allure, a flexible, lightweight multi-language test report tool. It allows users to generate, serve, and open Allure reports from the command line.
What are allure-commandline's main functionalities?
Generate Allure Report
This feature allows you to generate an Allure report from the specified input directory and output it to the specified output directory.
const { exec } = require('child_process');
exec('allure generate <input-directory> -o <output-directory>', (err, stdout, stderr) => {
if (err) {
console.error(`Error: ${err.message}`);
return;
}
if (stderr) {
console.error(`Stderr: ${stderr}`);
return;
}
console.log(`Stdout: ${stdout}`);
});
Serve Allure Report
This feature allows you to serve an Allure report from the specified input directory, making it accessible via a local web server.
const { exec } = require('child_process');
exec('allure serve <input-directory>', (err, stdout, stderr) => {
if (err) {
console.error(`Error: ${err.message}`);
return;
}
if (stderr) {
console.error(`Stderr: ${stderr}`);
return;
}
console.log(`Stdout: ${stdout}`);
});
Open Allure Report
This feature allows you to open an existing Allure report from the specified output directory.
const { exec } = require('child_process');
exec('allure open <output-directory>', (err, stdout, stderr) => {
if (err) {
console.error(`Error: ${err.message}`);
return;
}
if (stderr) {
console.error(`Stderr: ${stderr}`);
return;
}
console.log(`Stdout: ${stdout}`);
});
Other packages similar to allure-commandline
mochawesome
Mochawesome is a custom reporter for the Mocha JavaScript test framework that generates a visually appealing HTML/CSS report. Unlike allure-commandline, which supports multiple testing frameworks, mochawesome is specifically designed for Mocha.
jest-html-reporter
jest-html-reporter is a Jest test results processor that generates a simple HTML report. It is similar to allure-commandline in that it provides a visual representation of test results, but it is specifically tailored for Jest.
cucumber-html-reporter
cucumber-html-reporter is a Cucumber.js HTML report generator. It is similar to allure-commandline in that it provides detailed test reports, but it is specifically designed for Cucumber.js.
Allure Commandline
NPM wrapper for Allure Commandline
Install
- Allure requires Java 8 or higher
npm install -g allure-commandline --save-dev
Usage
allure <command> [<args>]
Run allure help
for a list of supported commands.
Node.js API
You can also call Allure commands from your Node.js code:
var allure = require('allure-commandline');
var generation = allure(['generate', 'allure-results']);
generation.on('exit', function(exitCode) {
console.log('Generation is finished with code:', exitCode);
});
Development
Allure packages should be downloaded from external storage. Repository content doesn't have actual code.
- Update package version
$ npm version 2.13.0
- Download the Allure-commandline package:
./fetch-source
- Publish result to NPM:
npm publish