cucumber-json-2-pdf
v1.0.36
Published
Welcome to the `cucumber-json-2-pdf` project!
Readme
README
Welcome to the cucumber-json-2-pdf project!
Description
This project aims to generate PDF reports based on data analysis.
Installation
To install the necessary dependencies, run the following command:
npm install -g cucumber-json-2-pdfUsage
Convert Cucumber JSON to PDF
cucumber-json-2-pdf convert -j examples/cucumber-data.json -o output -p Android-Sanity -e DEovan -n Teste -m [email protected] -l images/logo.png -t "DET - Documento de Evidência de Testes"Convert JUnit XML to PDF
cucumber-json-2-pdf convert-junit -i examples/sample-junit.xml -o output -p Android-Sanity -e DEovan -n Teste -m [email protected] -l images/logo.png -t "DET - Documento de Evidência de Testes"Convert JUnit XML to PDF (API JSON modes)
Compact mode (default):
cucumber-json-2-pdf convert-junit -i examples/results-img.xml -o output -p API-Sanity -e DEovan --api-json-mode compactFull mode:
cucumber-json-2-pdf convert-junit -i examples/results-img.xml -o output -p API-Sanity -e DEovan --api-json-mode fullNo JSON evidence:
cucumber-json-2-pdf convert-junit -i examples/results-img.xml -o output -p API-Sanity -e DEovan --api-json-mode noneSingle merged PDF (summary + all evidences)
Generated by default. After every scenario PDF is written, a consolidated PDF is produced containing a summary page (general data, stat tiles, pass/fail donut, Quality Health and a scenario index) followed by every scenario PDF, in order:
cucumber-json-2-pdf convert-junit -i examples/junit-retry.xml -o output -p Android-Sanity -e DEovan -l images/logo.pngUse --no-merge to skip it and keep only the individual scenario PDFs:
cucumber-json-2-pdf convert-junit -i examples/junit-retry.xml -o output -p Android-Sanity -e DEovan --no-merge--merge-only produces just the consolidated file and removes the individual scenario PDFs:
cucumber-json-2-pdf convert -j examples/cucumber.json -o output -p Android-Sanity -e DEovan --merge-only --merged-name DET-Sanity.pdf --partner "Fornecedor Exemplo" --objective "Validar as operações do serviço." --observations "Falhas conhecidas em homologação."When --observations is omitted, the summary lists the failing scenarios automatically.
Commands
convert — Cucumber JSON
Usage: cucumber-json-2-pdf convert [options]
Options:
-j, --json <path> Path to the Cucumber JSON file (required)
-o, --output <dir> Output directory for the PDFs (required)
-p, --project <name> Project name (required)
-e, --execution <name> Execution responsible (required)
-n, --owner <name> Owner name
-m, --email <email> Owner email
-x, --debug Output extra debugging
-l, --logo <path> Path to the logo image
-t, --title <text> Title on header
--merge Generate the consolidated PDF with a summary page (default)
--no-merge Skip the consolidated PDF, keeping only the individual PDFs
--merge-only Generate only the merged PDF (removes the individual PDFs)
--merged-name <name> File name of the merged PDF
--objective <text> Test objective shown on the summary page
--observations <text> Observations shown on the summary page
--partner <name> Partner shown on the summary page
-h, --help Display help for commandconvert-junit — JUnit XML
Usage: cucumber-json-2-pdf convert-junit [options]
Options:
-i, --input <path> Path to the JUnit XML file (required)
-o, --output <dir> Output directory for the PDFs (required)
-p, --project <name> Project name (required)
-e, --execution <name> Execution responsible (required)
-n, --owner <name> Owner name
-m, --email <email> Owner email
-x, --debug Output extra debugging
-l, --logo <path> Path to the logo image
--api-json-mode <mode> JSON evidence mode for API reports: compact|full|none
-t, --title <text> Title on header
--merge Generate the consolidated PDF with a summary page (default)
--no-merge Skip the consolidated PDF, keeping only the individual PDFs
--merge-only Generate only the merged PDF (removes the individual PDFs)
--merged-name <name> File name of the merged PDF
--objective <text> Test objective shown on the summary page
--observations <text> Observations shown on the summary page
--partner <name> Partner shown on the summary page
-h, --help Display help for commandEnvironment variables
DET_API_JSON_MODE
Controls JSON evidence rendering for JUnit API reports. Values:
- compact (default)
- full
- none
Examples:
DET_API_JSON_MODE=full cucumber-json-2-pdf convert-junit -i examples/results-img.xml -o output -p API-Sanity -e DEovanDET_API_JSON_COMPACT_LIMIT
Controls the max JSON length used in compact mode.
- Default: 2000
- Must be a positive integer
Example:
DET_API_JSON_COMPACT_LIMIT=350 cucumber-json-2-pdf convert-junit -i examples/results-img.xml -o output -p API-Sanity -e DEovan --api-json-mode compactOutput
Each scenario generates a separate PDF file named:
DET-{ScenarioName}-{passed|failed}.pdfUnless --no-merge is passed, a consolidated PDF is also written:
DET-{ProjectName}-consolidado.pdfIts first page(s) hold the execution summary — general data, total/duration/passed/failed tiles, a pass-rate donut with PASS/FAIL/SKIP/ERROR legend, the Quality Health rating (>= 90% GREEN,
= 80% YELLOW, below that RED), observations and the scenario index — followed by every scenario PDF with continuous page numbering in the bottom-left corner.
License
This project is licensed under the ISC License
