
committed by
Victor Berchet

parent
61002733bc
commit
c377e80670
@ -13,15 +13,14 @@ describe('ng2 naive infinite scroll benchmark', function() {
|
||||
url: URL,
|
||||
id: 'ng2.naive_infinite_scroll',
|
||||
work: function() {
|
||||
browser.wait(protractor.until.elementLocated(protractor.By.css('body /deep/ #scrollDiv')),
|
||||
5000);
|
||||
browser.wait(
|
||||
protractor.until.elementLocated(protractor.By.css('body /deep/ #scrollDiv')), 5000);
|
||||
$('#reset-btn').click();
|
||||
$('#run-btn').click();
|
||||
browser.wait(protractor.until.elementLocated(protractor.By.css('#done')), 10000);
|
||||
},
|
||||
params: [
|
||||
{name: 'appSize', value: appSize},
|
||||
{name: 'iterationCount', value: 20, scale: 'linear'},
|
||||
{name: 'appSize', value: appSize}, {name: 'iterationCount', value: 20, scale: 'linear'},
|
||||
{name: 'scrollIncrement', value: 40}
|
||||
]
|
||||
}).then(done, done.fail);
|
||||
|
@ -16,8 +16,9 @@ describe('ng2 naive infinite scroll benchmark', function() {
|
||||
var stageButtons = `${ allScrollItems } .row stage-buttons button`;
|
||||
|
||||
var count = function(selector) {
|
||||
return browser.executeScript(`return ` +
|
||||
`document.querySelectorAll("${ selector }").length;`);
|
||||
return browser.executeScript(
|
||||
`return ` +
|
||||
`document.querySelectorAll("${ selector }").length;`);
|
||||
};
|
||||
|
||||
var clickFirstOf = function(selector) {
|
||||
@ -25,8 +26,9 @@ describe('ng2 naive infinite scroll benchmark', function() {
|
||||
};
|
||||
|
||||
var firstTextOf = function(selector) {
|
||||
return browser.executeScript(`return ` +
|
||||
`document.querySelector("${ selector }").innerText;`);
|
||||
return browser.executeScript(
|
||||
`return ` +
|
||||
`document.querySelector("${ selector }").innerText;`);
|
||||
};
|
||||
|
||||
// Make sure rows are rendered
|
||||
@ -36,18 +38,17 @@ describe('ng2 naive infinite scroll benchmark', function() {
|
||||
count(cells).then(function(c) { expect(c).toEqual(expectedRowCount * expectedCellsPerRow); });
|
||||
|
||||
// Click on first enabled button and verify stage changes
|
||||
firstTextOf(`${ stageButtons }:enabled`)
|
||||
.then(function(text) {
|
||||
expect(text).toEqual('Pitched');
|
||||
clickFirstOf(`${ stageButtons }:enabled`)
|
||||
.then(function() {
|
||||
firstTextOf(`${ stageButtons }:enabled`)
|
||||
.then(function(text) { expect(text).toEqual('Won'); })
|
||||
});
|
||||
});
|
||||
firstTextOf(`${ stageButtons }:enabled`).then(function(text) {
|
||||
expect(text).toEqual('Pitched');
|
||||
clickFirstOf(`${ stageButtons }:enabled`).then(function() {
|
||||
firstTextOf(`${ stageButtons }:enabled`).then(function(text) {
|
||||
expect(text).toEqual('Won');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
$("#reset-btn").click();
|
||||
$("#run-btn").click();
|
||||
$('#reset-btn').click();
|
||||
$('#run-btn').click();
|
||||
browser.wait(() => {
|
||||
return $('#done').getText().then(function() { return true; }, function() { return false; });
|
||||
}, 10000);
|
||||
|
@ -9,20 +9,20 @@ describe('ng2 largetable benchmark', function() {
|
||||
|
||||
|
||||
it('should log the load time', function(done) {
|
||||
runner.sample({
|
||||
id: 'loadTime',
|
||||
prepare: null,
|
||||
microMetrics: null,
|
||||
userMetrics:
|
||||
{loadTime: 'The time in milliseconds to bootstrap', someConstant: 'Some constant'},
|
||||
bindings: [
|
||||
benchpress.bind(benchpress.SizeValidator.SAMPLE_SIZE)
|
||||
.toValue(2),
|
||||
benchpress.bind(benchpress.RegressionSlopeValidator.SAMPLE_SIZE).toValue(2),
|
||||
benchpress.bind(benchpress.RegressionSlopeValidator.METRIC).toValue('someConstant')
|
||||
],
|
||||
execute: () => { browser.get(URL); }
|
||||
})
|
||||
runner
|
||||
.sample({
|
||||
id: 'loadTime',
|
||||
prepare: null,
|
||||
microMetrics: null,
|
||||
userMetrics:
|
||||
{loadTime: 'The time in milliseconds to bootstrap', someConstant: 'Some constant'},
|
||||
bindings: [
|
||||
benchpress.bind(benchpress.SizeValidator.SAMPLE_SIZE).toValue(2),
|
||||
benchpress.bind(benchpress.RegressionSlopeValidator.SAMPLE_SIZE).toValue(2),
|
||||
benchpress.bind(benchpress.RegressionSlopeValidator.METRIC).toValue('someConstant')
|
||||
],
|
||||
execute: () => { browser.get(URL); }
|
||||
})
|
||||
.then(report => {
|
||||
expect(report.completeSample.map(val => val.values.someConstant)
|
||||
.every(v => v === 1234567890))
|
||||
|
Reference in New Issue
Block a user