Reputation: 18068
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
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