
Now, running protractor configs by default only runs e2e tests. If the --benchmark flag is added, it runs only the perf tests, and always restarts the browser in between tests. If the --dryrun test is added, the perf tests are run only once. This should make it easier to run perf tests versus example e2e tests, and help stabilize the travis build because perf tests always run with a clean browser.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
var perfUtil = require('angular2/src/test_lib/perf_util');
|
|
|
|
describe('ng2 naive infinite scroll benchmark', function () {
|
|
|
|
var URL = 'benchmarks/src/naive_infinite_scroll/index.html';
|
|
|
|
afterEach(perfUtil.verifyNoBrowserErrors);
|
|
|
|
[1, 2, 4].forEach(function(appSize) {
|
|
// TODO: reenable these tests when the are passing. See issue #1137
|
|
xit('should run scroll benchmark and collect stats for appSize = ' +
|
|
appSize, function(done) {
|
|
perfUtil.runBenchmark({
|
|
url: URL,
|
|
id: 'ng2.naive_infinite_scroll',
|
|
work: function() {
|
|
$('#reset-btn').click();
|
|
$('#run-btn').click();
|
|
browser.wait(() => {
|
|
return $('#done').getText().then(
|
|
function() { return true; },
|
|
function() { return false; });
|
|
}, 10000);
|
|
},
|
|
params: [{
|
|
name: 'appSize', value: appSize
|
|
}, {
|
|
name: 'iterationCount', value: 20, scale: 'linear'
|
|
}, {
|
|
name: 'scrollIncrement', value: 40
|
|
}]
|
|
}).then(done, done.fail);
|
|
});
|
|
});
|
|
|
|
});
|