allure-framework / allure-maven

Maven plugin generating Allure report from test results
Apache License 2.0
93 stars 54 forks source link

Report is not created when trying to work directly with json files #292

Open andyrozman opened 10 months ago

andyrozman commented 10 months ago

Describe the bug Report is not created when trying to work directly with json files. Problem is that I can't configure allure to work directly with surefire, which is why I tried to install allure-maven plugin, so that it would take existing cucumber (1.5) files and create report with it. It seems like plugin is expecting files to be at ceratin location, but they don't exist there. My files exist at this location ${project.basedir}/reports/json/json-output-folder

And this are the files there (changed names to protect project): ./report <- Cucumber report in HTML ./cucumber_report.5265.json ./cucumber_report.5272.json ./cucumber_report.5258.json ./cucumber_report.5252.json ./json-output-folder/yadayadayada_01.chrome.116.0.5845.180_1694801436260.json ./json-output-folder/yadayadayada_02.chrome.116.0.5845.180_1694801553800.json ./json-output-folder/yadayadayada_03.chrome.116.0.5845.180_1694802315238.json ./json-output-folder/yadayadayada_04.chrome.116.0.5845.180_1694801863740.json ./json-output-folder/yadayadayada_05.chrome.116.0.5845.180_1694802279725.json ./json-output-folder/yadayadayada_06.chrome.116.0.5845.180_1694801332643.json ./json-output-folder/yadayadayada_07.chrome.116.0.5845.180_1694801292752.json ./json-output-folder/yadayadayada_08.chrome.116.0.5845.180_1694801607516.json ./json-output-folder/yadayadayada_09.chrome.116.0.5845.180_1694801397236.json

To Reproduce Steps to reproduce the behavior:

  1. Add plugin in project: `

    io.qameta.allure
            <artifactId>allure-maven</artifactId>
            <version>2.8</version>
            <configuration>
                <sourceJsonReportDirectory>${project.basedir}/reports/json/json-output-folder</sourceJsonReportDirectory>
                <reportVersion>2.7.0</reportVersion>
                <allureDownloadUrl>https://github.com/allure-framework/allure2/releases/download/2.7.0/allure-2.7.0.zip</allureDownloadUrl>
            </configuration>
        </plugin>`
  2. Put report files into project.baseDir (so not in target/*)

  3. Run mvn allure:report

Expected behavior Report created in target/site/allure-maven-plugin

Actual behavior No report created [INFO] --- allure:2.8:report (default-cli) @ bt-e2etests-ui-tests --- [INFO] Allure installation directory /home/andy/Work/Source/BT/btcms-e2etests/ui-tests/bt-e2etests-ui-tests/.allure [INFO] Try to finding out allure 2.7.0 [INFO] Generate Allure report (report) with version 2.7.0 [INFO] Generate Allure report to /home/xyz/Source/zumzum-e2etests-ui-tests/target/site/allure-maven-plugin [ERROR] Directory /home/xyz/Source/zumzum-e2etests-ui-tests/target/allure-results not found. [WARNING] Allure report was skipped because there is no results directories found.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.