Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe incorrect statistics on the report chart #85

Open
yunwu-cn opened this issue Dec 8, 2021 · 9 comments
Open

Maybe incorrect statistics on the report chart #85

yunwu-cn opened this issue Dec 8, 2021 · 9 comments

Comments

@yunwu-cn
Copy link

yunwu-cn commented Dec 8, 2021

Hi I was using cucumber-serenity for some tests, it runs great with awesome report view.
However, when I select some tags, the stats seem incorrect on the overview piechart.

Here's the screenshot of my report, when I select tag: Dev.
There should be only 2 tests. But the Test Outcomes showed 4, and the Overview piechart center has 200%, which will confuse people.
image

Here's how the feature file looks like:

Feature: some feature name

  Scenario Outline: Positive Test 
    Given ***
    When ***
    Then ***

    @dev
    Examples:
     | username  | password  |
     | user1     | password1 |

    @qa
    Examples:
     | username  | password  |
     | user2     | password2 |

  Scenario Outline: Negative Test 
    Given ***
    When ***
    Then ***

    @dev
    Examples:
     | username  | password  |
     | user3     | password3 |

    @qa
    Examples:
     | username  | password  |
     | user4     | password4 |

When run the test, I do mvn verify -Dcucumber.filter.tags="@dev or @qa"

@wakaleo
Copy link
Member

wakaleo commented Dec 8, 2021

Yeah, the percentage looks wrong. The number of test outcomes will include rows of test data, which may be why the test outcomes is reporting 4. Can you provide a sample project to reproduce the issue?

@yunwu-cn
Copy link
Author

yunwu-cn commented Dec 8, 2021

Thank you for such a quick reply. I will provide a sample project tomorrow here.

Yeah, the percentage looks wrong. The number of test outcomes will include rows of test data, which may be why the test outcomes is reporting 4. Can you provide a sample project to reproduce the issue?

@wakaleo
Copy link
Member

wakaleo commented Dec 8, 2021

If you want to take a look at the code yourself, the graph uses jscharts and is in the result-chart.ftl file - it could be a simple fix.

@yunwu-cn
Copy link
Author

yunwu-cn commented Dec 8, 2021

Will take a look tomorrow if I get time. Thank you.

If you want to take a look at the code yourself, the graph uses jscharts and is in the result-chart.ftl file - it could be a simple fix.

@yunwu-cn
Copy link
Author

yunwu-cn commented Dec 9, 2021

@wakaleo I haven't got time to dive too deep. But it looks like the ResultCounts that passed into the page, the counts are only filtered by Result, not tag.
Here's my sample project that can be used to reproduce the issue:
https://github.com/yunwu-cn/sample-serenity-report-issue

Just run mvn verify to generate the HTML report. And go to the bottom of the report, click one of the tags, you will see the incorrect stats near the top of the page.

@wakaleo
Copy link
Member

wakaleo commented Feb 17, 2022

Could you try with 3.2.0?

@yunwu-cn
Copy link
Author

tried with 3.2.0, still see the same issue. ps, above sample project is updated to use 3.2.0.

@wakaleo
Copy link
Member

wakaleo commented Feb 17, 2022

The reports with 3.2.0 seem to be as expected - what are you expecting to be displayed?
image

image

image

@yunwu-cn
Copy link
Author

The "All Tests" summary is correct, when a specific tag is selected, the stats are incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants