2016-10-23 16:37:15 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util';
|
|
|
|
import {runBenchmark} from '@angular/testing/src/perf_util';
|
2015-05-30 00:40:15 -04:00
|
|
|
|
|
|
|
describe('ng2 naive infinite scroll benchmark', function() {
|
|
|
|
|
2016-11-12 08:08:58 -05:00
|
|
|
const URL = 'benchmarks/src/naive_infinite_scroll/index.html';
|
2015-05-30 00:40:15 -04:00
|
|
|
|
2015-05-30 11:17:27 -04:00
|
|
|
afterEach(verifyNoBrowserErrors);
|
2015-05-30 00:40:15 -04:00
|
|
|
|
|
|
|
[1, 2, 4].forEach(function(appSize) {
|
|
|
|
it('should run scroll benchmark and collect stats for appSize = ' + appSize, function(done) {
|
2015-05-30 11:17:27 -04:00
|
|
|
runBenchmark({
|
|
|
|
url: URL,
|
|
|
|
id: 'ng2.naive_infinite_scroll',
|
|
|
|
work: function() {
|
2016-08-26 18:44:05 -04:00
|
|
|
browser.wait(
|
|
|
|
protractor.until.elementLocated(protractor.By.css('body /deep/ #scrollDiv')), 5000);
|
2015-05-30 11:17:27 -04:00
|
|
|
$('#reset-btn').click();
|
|
|
|
$('#run-btn').click();
|
2015-06-22 12:24:09 -04:00
|
|
|
browser.wait(protractor.until.elementLocated(protractor.By.css('#done')), 10000);
|
2015-05-30 11:17:27 -04:00
|
|
|
},
|
|
|
|
params: [
|
2016-08-26 18:44:05 -04:00
|
|
|
{name: 'appSize', value: appSize}, {name: 'iterationCount', value: 20, scale: 'linear'},
|
2015-05-30 11:17:27 -04:00
|
|
|
{name: 'scrollIncrement', value: 40}
|
|
|
|
]
|
|
|
|
}).then(done, done.fail);
|
2015-05-30 00:40:15 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|