Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protractor with benchpress runner gives TypeError: capsObject.forEach is not a function #25139

Closed
Autushka opened this issue Jul 25, 2018 · 6 comments
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

Comments

@Autushka
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

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


Angular version: "@angular/core": "^6.0.3"


Browser:
- [x] Chrome (desktop) version 67
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 9.8.0
- Platform:  Windows

Others:

@vicb vicb added the area: testing Issues related to Angular testing features, such as TestBed label Jul 25, 2018
@ngbot ngbot bot added this to the needsTriage milestone Jul 25, 2018
@mboughaba
Copy link

mboughaba commented Oct 14, 2018

I am getting the same error. @Autushka did you manage to solve it?

@benlesh
Copy link
Contributor

benlesh commented Nov 8, 2018

I'm also hitting this trying to test RxJS 7 with benchpress.

@warpech
Copy link

warpech commented Mar 25, 2019

I can see that this was fixed in #21399 and #21477 but a new version of Benchpress was not released since.

I guess #19442 should be followed about the next release.

@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
@BioPhoton
Copy link
Contributor

Any updates here?

@JoostK
Copy link
Member

JoostK commented May 26, 2022

Closing as this appears to have been resolved in benchpress 0.2.0 (with 0.3.0 being latest at the moment)

@JoostK JoostK closed this as completed May 26, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

9 participants