Yoda
Yoda

Reputation: 18068

SpecFlow how to measure duration of each step?

I have long automated user cases, I want to find ways to simplify them and decrease time of their execution. I am using SpecFlow and write tests using Gherkin and C# (Selenium).

How can I get duration of each gherkin step?

Upvotes: 1

Views: 693

Answers (1)

Rami A.
Rami A.

Reputation: 10582

SpecFlow already outputs the duration of each step.

For example when I use the MsTest unit test provider, run the test inside Visual Studio 2015, click on the Output hyperlink in the Test Explorer window, I can see the following information in the Standard Output section:

Given this is a step -> done: MySteps.GivenThisIsAStep() (0.1s) When this is another step -> done: MySteps.WhenThisIsAnotherStep() (0.1s) Then this is the last step -> done: MySteps.ThenThisIsTheLastStep() (0.0s)

Notice that the number of seconds are in parenthesis.

Upvotes: 2

Related Questions