Search code examples
seleniumprotractorperformance-testing

Unable to figure out where the metrics are shown or stored after running sample protractor-perf conf.js


I am new to protractor-perf. I have installed it and tried to execute the following sample conf.js and example.js

conf.js :- https://github.com/axemclion/protractor-perf/blob/master/test/conf.js

example.js :- https://github.com/axemclion/protractor-perf/blob/master/test/example.spec.js

when I run protractor-perf conf.js. It runs fine and I get to see in command prompt that it passed. But how and where do I get to see the metrics ??


Solution

  • In order to see the metrics we need to run the following line of code which would log the metrics on console:

    if (perfRunner.isEnabled) {  
        expect(perfRunner.getStats('meanFrameTime')).toBeLessThan(60);
        perfRunner.getStats().then(console.log.bind(console)); // logs the Metrics
    }