Protractor with benchpress runner gives TypeError: capsObject.forEach is not a function #25139
Labels
area: testing
Issues related to Angular testing features, such as TestBed
freq1: low
hotlist: google
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
type: bug/fix
Milestone
I'm submitting a...
Current behavior
When try to run protractor e2e tests with benchpress runner
getting an error:
TypeError: capsObject.forEach is not a function
Expected behavior
Minimal reproduction of the problem with instructions
e2e spec sample:
import {browser} from 'protractor';
import {RegressionSlopeValidator} from "@angular/benchpress";
var benchpress = require('@angular/benchpress');
var runner = new benchpress.Runner([
//use protractor as Webdriver client
benchpress.SeleniumWebDriverAdapter.PROTRACTOR_PROVIDERS,
//use RegressionSlopeValidator to validate samples
{provide: benchpress.Validator, useExisting: benchpress.RegressionSlopeValidator},
//use 10 samples to calculate slope regression
{provide: benchpress.RegressionSlopeValidator.SAMPLE_SIZE, useValue: 1},
//use the script metric to calculate slope regression
{provide: benchpress.RegressionSlopeValidator.METRIC, useValue: 'scriptTime'},
{provide: benchpress.Options.FORCE_GC, useValue: true}
]);
describe('initial load performance', () => {
it('initial load performance', (done) => {
runner.sample({
execute: () => {
browser.get(
/
);},
userMetrics: {
timeToBootstrap: 'The time in milliseconds to bootstrap'
},
providers: [
{provide: RegressionSlopeValidator.METRIC, useValue: 'timeToBootstrap'}
]
}).then(done, done.fail);
});
});
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: