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.