17

I am working on creating a Reports Dashboard for automated tests that run once in a day. I am using WebdriverIO and so far allure has been super helpful in building detailed reports.

I am using the allure command line command:

allure generate --clean ./allure-results  && allure open

to generate the reports, however I am not able to get my PREVIOUS results and my TRENDS tile is empty. History is also EMPTY

Is there any way I can store daily reports and filter by date and see them stacked against a particular day?

Saikat
  • 14,222
  • 20
  • 104
  • 125
Siddharth Sonone
  • 662
  • 2
  • 7
  • 13

4 Answers4

38

Process to make Trend and History work:

Before generating the report, copy the history folder from your previous allure-report folder inside your current allure-results folder.

Therefor your new allure-report will have a new history folder that you need to save for the next day, and so on and so forth.

Eskignax
  • 584
  • 3
  • 8
  • Thanks u,I came across this resolution on their gitter channel – Siddharth Sonone May 24 '18 at 04:41
  • 4
    What is the "`history`" folder? Do you mean the `allure-results` folder? Or is there some different folder that I'm not seeing? Does the `history` folder include everything? Do I even need to keep the `allure-results` folder? – Cameron Tacklind Feb 04 '20 at 22:52
  • 5
    @CameronTacklind : You need to generate a report the first time : `allure generate`. This will create a allure-report folder. Inside this allure-report folder you will find the history folder that you need to save for your next run. If you are using `allure serve` command you will not see the allure-report folder. – Eskignax Feb 12 '20 at 02:37
  • 1
    I'm very surprised that the `history` folder is not automatically saved. I haven't found any documentation that says this. Do you also need to keep the old `allure-results` folder contents? – Cameron Tacklind Feb 13 '20 at 23:29
  • 1
    Unfortunately this is true... This is the solution. Not the most beautiful one from allure's side but this is the most straightforward way to go right now – George Pligoropoulos Dec 30 '20 at 13:18
6

Documentation on this issue are somewhat confusing and naming of directories does not help novice allure user eighter. I'll try to dumb it down a little, so that i would understand it myself with only one pass of reading.

Preconditions

  • you must have run successfully allure:report, othervise you would not know that your trends are not working
  • you most likely allready know where directory allure-results is because you (or at least allure) needed that to generate report without trendlines

What to do:

  • locate folder named history from the place to where allure:report task generated html results -- in my case it is: target/site/allure-maven-plugin/history
  • copy that entire history directory into directory allure-results -- in my case that is: target/allure-results
  • now run maven target allure:report again, and your resulting page has TREND filled with few first results
  • every time after running your tests copy that history directory as described above and generate nice results after that, to have consistend TREND showing

What next:

  • for extra credit you may configure your allure:report task run to do copying automatically before generating new results site (in my case i used intellij idea to run maven task and there i can add some tasks to be executed before launch -- however automating that, is out of scope of getting trends working at all)
Lauri
  • 1,859
  • 2
  • 14
  • 17
  • I'm on the CLI, just using `allure generate target/surefire-reports`. This generates a report in a folder called `allure-report`. Where is my `allure-results` directory? – rjmunro Feb 08 '22 at 09:55
  • "allure-results" folder is generated when you run some tests and when you have allure set up for your project. This folder contains .json files from which latter content for "allure-report" folder can be generated. So most likely you still need to write and run some unit-tests with your allure enabled project, to get that folder. – Lauri Feb 09 '22 at 10:04
  • rjmunro, most likely there is folder called "allure-results" or it is sub-directory under "build" or "target" or some other more generated temporary folder. However, if your generated allure-report has no information about tests etc. then might be that you don't have any "allure-results" directory. – Lauri Feb 17 '22 at 07:49
3

You can integrate your build with Jenkins, where you can use Allure plugin to generate reports.

You have to install it from Manage plugin. Once installed you can configure it to run post build in your job configuration.

This will generate allure reports for each build you run and store it in build number folder. You'll also get the trend tile populating automatically.

For more information you can refer allure documentation here: Allure Jenkins configuration

Rohit Negi
  • 109
  • 2
  • 12
0

I created a basic script that whenever I generate the report with allure generate the history folder is copied to the allure-results folder. I created an sh with the following command:

cp -r allure-report/history/ allure-results

It worked fine over here.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31