0

I currently want to return the rows for the Examples for Scenario Outlines and get the size of the rows, however I am unable to do this as when SpecRun reads the feature files, it automatically converts scenario outline examples into individual scenarios for a custom report we want to create which requires this information.

ScenarioContext.Current.ScenarioInfo does not give me this capability.

When faced with the same issue in JAVA, we implemented gherkin.formatter into a custom class and invoked it in the RunCukesTest class with plugins = {"my.package.customreport"}

However I'm not sure how the same can be done in .Net SpecRun after importing the gherkin.dll.

Could anybody please shed some light on this or give an alternate solution?

Thanks!

matt
  • 41
  • 3

1 Answers1

1

As you wrote: I need this to work for ALL steps and this also doesn't give me the number of examples and iteration number.

Scenario Outline: Scenario Outline example

Given I have RestAPI '<iterationNumber>'

When I read '<iterationNumber>' and '<api_key>' 

Then the '<iterationNumber>' and results table
| links list |
| aaa        |
| bbb        |

Examples:
| iterationNumber | api_key                      |
| 0               | @@app.config=api_key_full    |
| 1               | @@app.config=api_key_limited |

Debug this

    [Given(@"I have RestAPI '(.*)'")]
    public void GivenIHaveRestAPI(int iterationNumber)
    {
        Console.WriteLine(iterationNumber);
    }

    [When(@"I read '(.*)' and '(.*)'")]
    public void WhenIReadAnd(int iterationNumber, string p1)
    {

        Console.WriteLine(iterationNumber);
    }

    [Then(@"the '(.*)' and results table")]
    public void ThenTheAndResultsTable(int iterationNumber, Table table)
    {
        Console.WriteLine(iterationNumber);
    } 
Jan Regent
  • 21
  • 5
  • discussion continuous at https://groups.google.com/forum/#!topic/specflow/jNwhbXpnApo Many improvementss will be in Gherkin3 parser – Jan Regent Oct 05 '15 at 10:51