diff --git a/modules/benchmarks/test/perf/change_detection_perf.js b/modules/benchmarks/test/perf/change_detection_perf.js index 9dfd487a70..256453460e 100644 --- a/modules/benchmarks/test/perf/change_detection_perf.js +++ b/modules/benchmarks/test/perf/change_detection_perf.js @@ -8,16 +8,16 @@ describe('ng2 change detection benchmark', function () { afterEach(util.verifyNoErrors); it('should log ng stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#ng2DetectChanges'], name: browser.params.lang+'.ng2.changeDetection' }); }); it('should log baseline stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#baselineDetectChanges'], name: browser.params.lang+'.baseline.changeDetection' }); diff --git a/modules/benchmarks/test/perf/compiler_perf.js b/modules/benchmarks/test/perf/compiler_perf.js index f525b0e815..7aab743ca1 100644 --- a/modules/benchmarks/test/perf/compiler_perf.js +++ b/modules/benchmarks/test/perf/compiler_perf.js @@ -8,16 +8,16 @@ describe('ng2 compiler benchmark', function () { afterEach(util.verifyNoErrors); it('should log withBindings stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#compileWithBindings'], name: browser.params.lang+'.ng2.compile.withBindings' }); }); it('should log noBindings stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#compileNoBindings'], name: browser.params.lang+'.ng2.compile.noBindings' }); diff --git a/modules/benchmarks/test/perf/di_perf.js b/modules/benchmarks/test/perf/di_perf.js index 9d84f44304..a25ada02d4 100644 --- a/modules/benchmarks/test/perf/di_perf.js +++ b/modules/benchmarks/test/perf/di_perf.js @@ -8,32 +8,32 @@ describe('ng2 di benchmark', function () { afterEach(util.verifyNoErrors); it('should log the stats for getByToken', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#getByToken'], name: browser.params.lang+'.ng2.di.getByToken' }); }); it('should log the stats for getByKey', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#getByKey'], name: browser.params.lang+'.ng2.di.getByKey' }); }); it('should log the stats for getChild', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#getChild'], name: browser.params.lang+'.ng2.di.getChild' }); }); it('should log the stats for instantiate', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#instantiate'], name: browser.params.lang+'.ng2.di.instantiate' }); diff --git a/modules/benchmarks/test/perf/element_injector_perf.js b/modules/benchmarks/test/perf/element_injector_perf.js index 1702196ae8..bdf5ba262d 100644 --- a/modules/benchmarks/test/perf/element_injector_perf.js +++ b/modules/benchmarks/test/perf/element_injector_perf.js @@ -8,16 +8,16 @@ describe('ng2 element injector benchmark', function () { afterEach(util.verifyNoErrors); it('should log the stats for instantiate', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#instantiate'], name: browser.params.lang+'.ng2.elementInjector.instantiate' }); }); it('should log the stats for instantiateDirectives', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#instantiateDirectives'], name: browser.params.lang+'.ng2.elementInjector.instantiateDirectives' }); diff --git a/modules/benchmarks/test/perf/tree_perf.js b/modules/benchmarks/test/perf/tree_perf.js index 41be46c751..7dc57e8c9a 100644 --- a/modules/benchmarks/test/perf/tree_perf.js +++ b/modules/benchmarks/test/perf/tree_perf.js @@ -8,16 +8,16 @@ describe('ng2 tree benchmark', function () { afterEach(util.verifyNoErrors); it('should log the ng stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#ng2DestroyDom', '#ng2CreateDom'], name: browser.params.lang+'.ng2.tree' }); }); it('should log the baseline stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#baselineDestroyDom', '#baselineCreateDom'], name: browser.params.lang+'.baseline.tree' }); diff --git a/modules/benchmarks_external/test/perf/compiler_perf.js b/modules/benchmarks_external/test/perf/compiler_perf.js index f2be62cca0..a76e328f81 100644 --- a/modules/benchmarks_external/test/perf/compiler_perf.js +++ b/modules/benchmarks_external/test/perf/compiler_perf.js @@ -8,16 +8,15 @@ describe('ng1.x compiler benchmark', function () { afterEach(util.verifyNoErrors); it('should log withBinding stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#compileWithBindings'], name: browser.params.lang+'.ng1.compile.withBindings' }); }); it('should log noBindings stats', function() { - util.runSimpleBenchmark({ - url: URL, + util.runClickBenchmark({ buttons: ['#compileNoBindings'], name: browser.params.lang+'.ng1.compile.noBindings' }); diff --git a/modules/benchmarks_external/test/perf/tree_perf.js b/modules/benchmarks_external/test/perf/tree_perf.js index 915cf53cfe..bafef29a62 100644 --- a/modules/benchmarks_external/test/perf/tree_perf.js +++ b/modules/benchmarks_external/test/perf/tree_perf.js @@ -8,8 +8,8 @@ describe('ng1.x tree benchmark', function () { afterEach(util.verifyNoErrors); it('should log the stats', function() { - util.runSimpleBenchmark({ - url: URL, + browser.get(URL); + util.runClickBenchmark({ buttons: ['#destroyDom', '#createDom'], name: browser.params.lang+'.ng1.tree' }); diff --git a/tools/perf/util.js b/tools/perf/util.js index d485b0ae85..cbfa3136eb 100644 --- a/tools/perf/util.js +++ b/tools/perf/util.js @@ -3,16 +3,12 @@ var webdriver = require('protractor/node_modules/selenium-webdriver'); module.exports = { perfLogs: perfLogs, sumTimelineRecords: sumTimelineRecords, - runSimpleBenchmark: runSimpleBenchmark, + runClickBenchmark: runClickBenchmark, verifyNoErrors: verifyNoErrors, printObjectAsMarkdown: printObjectAsMarkdown }; -// TODO: rename into runSimpleBenchmark -function runSimpleBenchmark(config) { - // TODO: move this into the tests! - browser.get(config.url); - +function runClickBenchmark(config) { var buttons = config.buttons.map(function(selector) { return $(selector); });