Allure report: nothing shown in Chrome
Asked Answered
T

6

18

I'm trying to use Allure-framework to generate a report for my Selenium WebDriver tests. I use JUnit framework and allure-maven-plugin with version 1.3.9 of Allure. I run tests with mvn test then generate the report using mvn site. I see generated report in target/site/allure-maven-plugin/ directory. When I open index.html page with Firefox it works normally. However when doing the same thing in Chrome or Safari I see nothing.

What's wrong? Am I missing something? My pom.xml file is located here.

Tempt answered 2/6, 2014 at 14:53 Comment(0)
B
27

This problem is related to default Webkit security settings which forbid doing Ajax requests on the local filesystem. You have at least two possible solutions:

  1. Serve index.html with some web-server like Nginx or Apache. This will emulate remote website and thus trick your browser. With Allure CLI 2.0+ this can be done using the following command:

$ allure report open

  1. Use --allow-file-access-from-files Chrome flag. See details in this question.
Bandoleer answered 2/6, 2014 at 19:50 Comment(3)
If you're using Java and Maven you can also use Jetty and respective plugin for Maven.Bandoleer
Btw, if you're not 100% Chrome fan you can simply use Firefox which doesn't have this issue.Bandoleer
slight change in the command as of Sep 2019. allure open <Allure-Reports-Directory> command: allure open Allure-ReportsKinfolk
A
8

To use allure report in chrome, you have two options:

  • Use mvn allure:serve target. It will generate the report and open a tab in Chrome (if default browser)
  • Generate the report using mvn allure:report target and serve the site your self, using any http server. if you have node you can use http-server for example npm install http-server -g and then http-server target/site/allure-maven-plugin)

DO NOT use --allow-file-access-from-files flag, is it DANDEGEROUS

Angelenaangeleno answered 25/2, 2019 at 12:16 Comment(1)
mvn io.qameta.allure:allure-maven:serve worked for mePfosi
S
3

To open your report in Chrome browser use the below command in cmd prompt

allure open path_to_allure_report_folder

or use the below command if above command does not work

allure serve path_to_allure_report_folder

This will open your report.

Sculpturesque answered 7/3, 2021 at 17:32 Comment(0)
M
0

I resolved this problem by following below steps .

1 Close all instances of chrome. 2 Enable local file access by executing below command.

C:\Users\vikas.piprade>"C:\Program Files\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files

[3] Relaunch terminal and view allure reports by "allure generate" followed by "allure open" commands.

Before :: allure report has no data and showing loading... - enter image description here

After :: allure report started showing data - enter image description here

Murage answered 18/3 at 13:36 Comment(0)
B
0

Since version 2.24, Allure has introduced a single HTML file report generation mode.

To enable it, you need to specify --single-file option for generate command:

$ allure generate --single-file path/to/allure-results

The allure-report/index.html file will be generated, which can be opened directly in the browser without starting a web service.

Details: https://github.com/allure-framework/allure2/pull/2072

Bladdernut answered 22/3 at 10:17 Comment(0)
C
-3

In Addition to the above answer using "--ignore-certifcate-errors" with chromeOptions might be helpfull.

DesiredCapabilities capabilities;
capabilities = DesiredCapabilities.chrome();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--ignore-certifcate-errors");
chromeOptions.addArguments("test-type");
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
WebDriver driver = new ChromeDriver(capabilities);
Clearheaded answered 16/9, 2014 at 9:34 Comment(1)
it's not relevant to the questionHumane

© 2022 - 2024 — McMap. All rights reserved.