How to view a report

A test report generated by Allure is not one file, but rather a directory containing various files (HTML, JSON and other types), sometimes in a ZIP archive. If you got such a directory, there are two ways to view the report:

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.

Start a local web server

The most reliable method of opening a test report is to use the allure open command in a terminal.

  1. If you got the test report in a ZIP archive, unpack all its content into a directory on your device.

  2. Run the allure open command, providing it with the path to the directory. For example:

    allure 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.

  3. When you finish viewing the report, you may stop the server by pressing Ctrl+C in the terminal window.

Open local files in a web browser

Google Chrome

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.

  1. If you got the test report in a ZIP archive, unpack all its content into a directory on your device.

  2. 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.

  3. Open a terminal and run Google Chrome, specifying the --allow-file-access-from-files option and the path to your test report's index.html file. For example:

    %ProgramFiles%\Google\Chrome\Application\chrome.exe -allow-file-access-from-files /home/user/myproject/build/allure-report/index.html

    Note that the installation path for Google Chrome may be different on your computer.

    open -a "Google Chrome" --args --allow-file-access-from-files /Users/user/myproject/build/allure-report/index.html
    google-chrome --allow-file-access-from-files /home/user/myproject/build/allure-report/index.html
  4. 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

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.

  1. If you got the test report in a ZIP archive, unpack all its content into a directory on your device.

  2. In Mozilla Firefox, open a new tab and go to the address: about:config.

  3. If a Proceed with Caution warning shows up, click Accept the Risk and Continue.

  4. In the Search preference name box, enter: security.fileuri.strict_origin_policy.

    The preference with that name should appear on the page.

  5. 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.

  6. In a file explorer, navigate to your test report's directory and open its index.html file in Mozilla Firefox.

  7. 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.

Powered by
logo

Join our newsletter

Join our community

We aim to make Allure Report as reliable and user-friendly as possible, and together with the community, we're here to help when problems arise.

© 2024 Qameta Software Inc. All rights reserved.