DOCX and PDF report generation based on allure-generated result files.
This package is developed in collaboration by Typhoon Hil and the Fraunhofer Institute for Solar Energy Systems ISE. Users are welcome to test and report problems and suggestions by creating an issue. Note that the package is not officially supported by Typhoon HIL and is still on the alpha phase.
The generator was only tested so far using allure results from python with allure-pytest
and java with allure-junit5
. Therefore it expects a folder with .json
files generated by the allure plugins.
Check the issues on the repository to see other current limitations.
Feel free to open an issue ticket with any problems or questions. Please if possible provide your test result files so we can debug it more efficiently.
The library uses matplotlib which depends on Visual C++ Redistributables. If not already installed, you can get them here: https://www.microsoft.com/en-in/download/details.aspx?id=48145 .
We publish windows standalone executable files. With them you can use it without having to install anything else, meaning no installing python, etc.
You can download them at: https://github.com/typhoon-hil/allure-docx/releases
Then you can use the executable directly (possibly adding it a folder added to PATH).
You can install from source using:
pip install git+https://github.com/typhoon-hil/allure-docx.git
Then you should be able to use allure-docx
executable like you use pip
.
Check usage by running allure-docx --help
You can generate the docx file by running allure-docx ALLUREDIR filename.docx
Use the --config_tag
/ --config_file
option to control which information should be added. Use the preset names or give a path to your custom .ini file.
When using a custom configuration the standard configuration is used as base and is overwritten for each attribute inside the custom file.
The standard file looks like this:
[info]
description = fbpsu
details = fbpsu
trace = fbpsu
parameters = fbpsu
links = fbpsu
setup = fbpsu
body = fbpsu
teardown = fbpsu
duration = fbpsu
attachments = fbpsu
[labels]
severity = fbpsu
[cover]
title = Allure
[details]
The report will display tests with the specified field (info and labels section) if the corresponding character is included. For mapping see following table:
failed | broken | passed | skipped | unknown |
---|---|---|---|---|
f | b | p | s | u |
There are some additional information you can add to your report. This includes following:
You can use the --title
option to customize the docx report title (or specify inside custom configuration file, as described above).
If you want to remove the title altogether (e.g. your logo already has the company title), you can set --title=""
.
You can also use the --logo
option with a path to a custom image to add the test title and the --logo-width
option to adjust the width size of the logo image (in centimeters).
Example invocation:
allure-docx --pdf --config_file=C:\myconfig.ini --logo=C:\mycompanylogo.png --logo-width=2 allure allure.docx
The --pdf
option will search for either Word (Windows only) or soffice
(LibreOffice) to generate the PDF.
If both Word and soffice
are present, Word will be used.
The previous version of the package can be found in the releases page of the plugin here.
We use PyInstaller to create standalone executables. If you want to build an executable yourself, follow these steps:
pyinstaller
and ONLY needed packages defined in setup.py
. This prevents your executable to become too large with unnecessary dependenciesdist
folder from a previous PyInstaller runbuild_exe.cmd
command to run PyInstaller and create a single file executable.If having the following error:
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Run pip install --force-reinstall -U future
(https://github.com/nipy/nipype/issues/2646)