timschlechter / SpecResults.WebApp

Writes an interactive, responsive, client-side web application, in which users can browse and search features, scenarios and steps.
https://www.nuget.org/packages/SpecFlow.Reporting.WebApp/
MIT License
9 stars 6 forks source link

Scenarios generated from "Scenario Outlines" in dashboard link to same scenario details page #4

Open VictorPascualV opened 9 years ago

VictorPascualV commented 9 years ago

Scenarios that have been generated from Scenario Outlines tables link to the same scenario in the dashboard.

Each scenario row should link to each different scenario.

Think that the problem might be here:

// Decorate scenarios
_.forEach(feature.scenarios, function(scenario, index) {
scenario.id = generateId([feature.title, scenario.title]);
scenario.duration = getDuration(scenario);
scenario.featureId = feature.id;
scenario.type = "scenario";

scenario.id is generated from feature.title and scenario.title so we'll get duplicates for Scenarios generated from Scenario Outline where scenario titles are all the same. We might need to add some randomness to the id based of current date time for example.

This is the function that should probably need to be changed:

https://github.com/TimSchlechter/SpecResults.WebApp/blob/master/SpecResults.WebApp/src/model/Report.js#L106

timschlechter commented 9 years ago

Thanks for reporting this! I will try to look into this tonight.

VictorPascualV commented 9 years ago

Thanks Tim, looking forward to see that fixed as scenario outlines are a main feature of the whole cucumber approach.

VictorPascualV commented 9 years ago

Hi Tim,

Any progress on that? Please let me know if you need any help or you want me to do a pull request for that issue.

timschlechter commented 9 years ago

Sorry, I did not fixed this issue yet. We could fix this in the SpecResults.WebApp package, but I think it would be nicer to solve this within the SpecResults package. Scenario Outlines scenarios are all given the same title at the moment.

As far as I can see I can't get to the example paramater values while generating the report.

For now, the best thing I can think of is appending a string to the scenario title, something like (example n)

For example:

Scenario Outline: eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    |  12   |  5  |  7   |
    |  20   |  5  |  15  |

would lead to two scenarios in the report with the following titles:

Would that be a valid solution?

VictorPascualV commented 9 years ago

I get your point Tim. It's a pitty that SpecFlow hides the "TestContext" object from VisualStudio.UnitTestTools so we can not get the full name of the test that would include the parameters.

So I think for now the solution that you're proposing will be fine.

Thanks again,

VictorPascualV commented 9 years ago

Hi Tim, Is there any progress on that issue?