On Tue, May 15, 2012 at 2:35 PM, aslak hellesoy
<
aslak.h...@gmail.com> wrote:
> On Tue, May 15, 2012 at 11:24 AM, Oleg Sukhodolsky <
os9...@gmail.com> wrote:
>> Hi,
>>
>> I need to implement formatter which will report step's execution time.
>
> That already exists. --format usage
It looks like it doesn't work with examples :( For regular scenario
it reports time for every step,
but for scenario with example it just prints total time.
I've modified step definitions for
https://github.com/cucumber/cucumber/blob/master/examples/i18n/en/features/addition.feature
to sleep for some time (to make execution time visible). And also add
one regular scenario:
Scenario: Add two numbers (simple)
Given I have entered 20 into the calculator
And I have entered 30 into the calculator
When I press add
Then the result should be 50 on the screen
>cucumber --format usage addition.feature
----................
1.0005000 /I have entered (\d+) into the calculator/ #
step_definitons/calculator_steps.rb:14
1.0000000 Given I have entered 20 into the calculator # addition.feature:20
1.0010000 And I have entered 30 into the calculator # addition.feature:21
0.5010000 /I press (\w+)/ #
step_definitons/calculator_steps.rb:19
0.5010000 When I press add # addition.feature:22
0.3010000 /the result should be (.*) on the screen/ #
step_definitons/calculator_steps.rb:24
0.3010000 Then the result should be 50 on the screen # addition.feature:23
4 scenarios (4 passed)
16 steps (16 passed)
0m11.212s
as you can see total time is about 11 seconds, but statistic it
provided for 2.8seconds (one run of simple scenario)
Oleg.