Generate single HTML file from allure report.
Project description
Allure single html file builder
Tool to build allure generated folder into a single html file
What it's doing?
After run by console command, or by call from python code, it:
- Reads contents of allure-generated folder
- Creates server.js file, which has all the data files inside and code to start fake XHR server
- Patches index.html file, so it's using server.js and sinon-9.2.4.js (Taken from here), and could be run in any browser without --allow-file-access-from-files parameter of chrome browser
- Creates file complete.html with all files built-in in a single file
Requirements
- Python 3.5+
- You need to have your allure report folder generated (
allure generate './some/path/to/allure/generated/folder'
)
Installation
Install with pip
pip install allure-combine
or:
Install manually
- Clone repo
git clone git@github.com:MihanEntalpo/allure-single-html-file.git
cd allure-single-html-file
- Install requirements (actually there are only BeautifulSoup)
pip install -r ./requirements.txt
python setup.py install
Run as console script
If you have cloned repo, not installed module via pip, replace allure-combine
with python ./allure_combine/combine.py
in following commands:
- Create complete.html file inside the allure folder itself
allure-combine ./some/path/to/allure/generated/folder
- Create complete.html file inside specified folder:
allure-combine ./some/path/to/allure/generated/folder --dest /tmp
- Ensure that specified dest folder exists (create if not)
allure-combine ./some/path/to/allure/generated/folder --dest /tmp/allure-2022-05-05_12-20-01/result --auto-create-folders
- Remove sinon.js and server.js from allure folder after complete.html is generated:
allure-combine ./some/path/to/allure/generated/folder --remove-temp-files
Import and use in python code
pip install allure-combine
from allure_combine import combine_allure
# 1) Create complete.html in allure-generated folder
combine_allure("./some/path/to/allure/generated/folder")
# 2) Create complete.html in specified folder
combine_allure("./some/path/to/allure/generated/folder", dest_folder="/tmp")
# 3) Make sure that dest folder exists, create if not
combine_allure(
"./some/path/to/allure/generated/folder",
dest_folder="/tmp/allure-2022-05-05_12-20-01/result",
auto_create_folders=True
)
# 4) Remove sinon.js and server.js from allure folder after complete.html is generated:
combine_allure(
"./some/path/to/allure/generated/folder",
remove_temp_files=True
)
Run with command
- Install with pip
pip install allure-combine
- Create complete.html file inside the allure folder itself
allure-combine ./some/path/to/allure/generated/folder
ac ./some/path/to/allure/generated/folder
- Create complete.html file inside specified folder:
allure-combine ./some/path/to/allure/generated/folder --dest /tmp
ac ./some/path/to/allure/generated/folder --dest /tmp
- Ensure that specified dest folder exists (create if not)
allure-combine ./some/path/to/allure/generated/folder --dest /tmp/allure-2022-05-05_12-20-01/result --auto-create-folders
ac ./some/path/to/allure/generated/folder --dest /tmp/allure-2022-05-05_12-20-01/result --auto-create-folders
- Remove sinon.js and server.js from allure folder after complete.html is generated:
allure-combine ./some/path/to/allure/generated/folder --remove-temp-files
ac ./some/path/to/allure/generated/folder --remove-temp-files
TODO
- Functionality to open image or video in new browser tab doesn't work yet.
- Need functionality to return combined file as a string, not saving it to a file directly
- Functionality to not change source files at all, work in a read-only filesystem
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
allure_combine-1.0.5.tar.gz
(6.4 kB
view hashes)
Built Distributions
allure_combine-1.0.5-py3.6.egg
(11.1 kB
view hashes)
Close
Hashes for allure_combine-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d84255f1981d4b5f76ed24afb539ffc8d8979a5687292f049762d4a3a5c565 |
|
MD5 | f84a6240c46198238cd473a6ff80feb1 |
|
BLAKE2b-256 | 2caeb1e3109950886790e5e4f03b8ddfc7b63bb5109793208bddfc5beb85cd46 |