ruby - Count of number of test scenarios in my acceptance test suite -


i have added env.rb calculates value after each scenario completion.

say

i = 0 (after scenario 1) = 0.330 (after scenario 2) = 0.330 + 0.3456 = 0.6756 (so on, till end of whole test)  

now want take average of value number of test scenarios in acceptance suite. make long story short, there method dynamically return number of test case scenarios in whole test suite?

there may be, think there's easier way.

instead of summing, why not append array? give both values , length, can calculate sum , mean (or other average!).

to modify example:

times = [] # (after scenario 1) times << 0.330 # (after scenario 2) times << 0.3456 # (so on, till end of whole test)   total_time = times.inject(&:+) num_scenarios = times.length mean_time = total_time / num_scenarios 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -