Appearance
How to view a report
A test reports generated with Allure Reports are basically small HTML websites intended to be viewed in a web browser. This page describes how to open and view such a report once you have generated one or received one from your colleague.
TIP
When possible, it is recommended to configure a CI integration plugin in such a way that the test report would be available online without downloading.
Open a single HTML file
If you (or another person responsible for generating the test reports) use the single-file mode (the --single-file
option), then good news! Such a report is the easiest to view: just open the HTML file in your preferred web browser, and that's it.
Consider switching to the single-file mode if you haven't already, so that opening test reports will be that easy every time.
There could be, however, reasons not to do this — most notably, to avoid potential issues when browsing really huge projects (lots of test results, tons of attachments). In such a case, please keep reading below.
Start a local web server
By default, a test report is not one file, but rather a directory containing various files (HTML, JSON and other types), sometimes distributed as a ZIP archive. The most reliable method of opening such a report is to use the allure open
command in a terminal.
If you got the test report in a ZIP archive, unpack all its content into a directory on your device.
Run the
allure open
command, providing it with the path to the directory. For example:plainallure open /home/user/myproject/build/allure-report
The command starts a local web server configured to show the report directory's contents. The command then automatically opens the main page of the report in a web browser. By default, the web server works at a local IP address (such as 127.0.1.1) and a randomly generated port. You may override this behavior with the
--host
and--port
arguments.When you finish viewing the report, you may stop the server by pressing Ctrl+C in the terminal window.
Open local directory in a web browser
Google Chrome
WARNING
This method is not recommended, as it involves setting parameters that make Google Chrome vulnerable to a certain type of malicious scripts. If you choose to use this method, make sure to close any tabs with content that you do not trust completely and not open them again until you revert the setting.
To be able to correctly open test reports from local files in Google Chrome, you need to launch the browser with a certain command-line argument. This will affect all websites opened in Google Chrome until you restart it again without that command-line argument.
If you got the test report in a ZIP archive, unpack all its content into a directory on your device.
If Google Chrome is running, open the browser menu and select Exit to close all its windows.
This is necessary because otherwise the command-line option on the next step won't affect the browser.
Open a terminal and run Google Chrome, specifying the
--allow-file-access-from-files
option and the path to your test report'sindex.html
file. For example:
plain
%ProgramFiles%\Google\Chrome\Application\chrome.exe -allow-file-access-from-files /home/user/myproject/build/allure-report/index.html
plain
open -a "Google Chrome" --args --allow-file-access-from-files /Users/user/myproject/build/allure-report/index.html
plain
google-chrome --allow-file-access-from-files /home/user/myproject/build/allure-report/index.html
Once you are done with viewing the test report, open the browser menu and select Exit to close all its windows.
This is necessary to make the browser “forget” the temporary setting before the next launch.
Mozilla Firefox
WARNING
This method is not recommended, as it involves setting parameters that make Mozilla Firefox vulnerable to a certain type of malicious scripts. If you choose to use this method, make sure to close any tabs with content that you do not trust completely and not open them again until you revert the setting.
To be able to correctly open test reports from local files in Mozilla Firefox, you need to change a certain global preference. This will affect all websites opened in Mozilla Firefox until you change the preference back.
If you got the test report in a ZIP archive, unpack all its content into a directory on your device.
In Mozilla Firefox, open a new tab and go to the address:
about:config
.If a Proceed with Caution warning shows up, click Accept the Risk and Continue.
In the Search preference name box, enter:
security.fileuri.strict_origin_policy
.The preference with that name should appear on the page.
If the preference is set to
true
, double-click on the value to toggle it.Make sure that the preference is now set to
false
.In a file explorer, navigate to your test report's directory and open its
index.html
file in Mozilla Firefox.Once you are done with viewing the test report, switch back to the
about:config
tab and double-click on the value again.Make sure that the preference is now set to
true
.