"AfterStep('@pause') do
print "Press Return to continue..."
STDIN.getc
end"
scenario_times = {}
Around()
do
|scenario, block|
start =
Time
.now
block.call
scenario_times[
"#{scenario.feature.file}::#{scenario.name}"
] =
Time
.now - start
end
at_exit
do
max_scenarios = scenario_times.size >
20
?
20
: scenario_times.size
puts
"------------- Top #{max_scenarios} slowest scenarios -------------"
sorted_times = scenario_times.sort { |a, b| b[
1
] <=> a[
1
] }
sorted_times[
0
..max_scenarios -
1
].
each
do
|key, value|
puts
"#{value.round(2)} #{key}"
end
end