Skip to content
docx report generation based on allure-generated json files
Python Batchfile
Branch: master
Clone or download
Sup3rGeo Merge pull request #20 from altendky/19-altendky-no_git_in_install_re…
…quires

Remove git+https://... from install_requires
Latest commit 9c05bce Mar 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create issue_template.md Jul 8, 2018
libs Working 32-bit executable version. Oct 31, 2018
src/allure_docx Working 32-bit executable version. Oct 31, 2018
tests Added support for LibreOfficeToPDF. May 20, 2018
CHANGELOG.md Bumped version. Oct 31, 2018
LICENSE
MANIFEST.in Executable using pygal instead of matplotlb. May 18, 2018
README.md Update README.md Dec 5, 2018
build_exe.cmd Working 32-bit executable version. Oct 31, 2018
hook-cairosvg.py Working 32-bit executable version. Oct 31, 2018
hook-pygal.py Fully working version with pygal. May 19, 2018
requirements.txt Remove git+https://... from install_requires Feb 26, 2019
setup.py Remove git+https://... from install_requires Feb 26, 2019

README.md

allure-docx

DOCX and PDF report generation based on allure-generated result files.

Limitations

  • This was only tested so far using results from allure-pytest. Therefore it expects a folder with .json files generated by the allure plugins.

Check the issues on the repository to see other current limitations.

Questions

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.

Installation

Windows

We publish windows standalone executable files. With them you can use it without having to install anything else other than the cairo dlls, 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).

Linux

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.

Usage

Check usage by running allure-docx --help

You can generate the docx file by running allure-docx ALLUREDIR filename.docx

Use the --detail-level option to control level of detail in the docx report (e.g. print all steps or not). Check the help for available levels.

The generated docx contain a Table of Contents that needs to be manually updated after generation. Generating PDFs (see below) will automatically update the TOC though.

PDF

The --pdf option will search for either OfficeToPDF or LibreOfficeToPDF application in the PATH to generate the PDF.

On Windows, PDFs can be generated from generated docx files using OfficeToPDF application. MS Word needs to be installed.

https://github.com/cognidox/OfficeToPDF/releases

On Windows and Linux, PDFs can be generated using LibreOfficeToPDF application. LibreOffice should be installed.

https://github.com/typhoon-hil/LibreOfficeToPDF/releases

If both OfficeToPDF and LibreOfficeToPDF are present, OfficeToPDF will be used.

Custom Title and Logo

You can use the --title option to customize the docx report title.

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-height option to adjust the height size of the logo image (in centimeters).

Example invocation:

allure-docx --pdf --title="My Company" --logo=C:\mycompanylogo.png --logo-height=2 allure allure.docx

Building the standalone executable

We use PyInstaller to create standalone executables. If you want to build an executable yourself, follow these steps:

  • Create a new virtual environment with the proper python version (tested using python 3, 32 or 64 bit so far)
  • Install using pip pyinstaller and ONLY needed packages defined in setup.py. This prevents your executable to become too large with unnecessary dependencies
  • Delete any previous dist folder from a previous PyInstaller run
  • Run the build_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)

You can’t perform that action at this time.