Hey all, I've found that it'd be nice to target a particular test suite with angular-cli.
Something like ng e2e auth instead of editing the angular-cli.json:
"e2e": {
"protractor": {
"config": "--suite auth config/protractor.conf.js"
}
}
Looks like it'd be pretty easy to pass the proper arguments to the e2e task
Hi,
Any ideas when this will be implemented?
I have multiple scenarios that should run different suites and this fits the bill perfectly!
👍
I don't have an update on when this will be available, but if someone is interested in doing a PR I'll review it.
As a workaround, right now you should be able to do npm run e2e -- --suite auth as well.
I'd really like to knock out this easy little feature (or any angular-cli development), but I'm having trouble with the typings in the angular-cli project.
My recent fork appears to be missing something because I get a lot of errors like:
@hboylan where do you get those errors? If it's in your editor, it might mean that it doesn't support Typescript 2.0. You should be able to ignore them though, it won't affect much.
@filipesilva the -- workaround to pass extra parameters to protractor doesn't seem to work anymore, I guess because we switched from using the package.json scripts to using directly protractor as a library…
Any idea for another workaround or maybe introduce another way to pass extra parameters to protractors?
@victornoel there isn't a way to pass arbitrary parameters but as far as this issue is concerned now there is a way to pass suites:
ng e2e --specs ./e2e/app.e2e-spec.ts --specs ./e2e/another.e2e-spec.ts
@filipesilva actually specs are not suites :) they are different concepts in protractor!
A suite is a set of specs configured in the protractor configuration.
So technically, this issue is not solved.
Unfortunately for me, my need was to pass an exclude option to protractor, which isn't solved via specs nor suites (I should create another issue for this).
You're absolutely right, and I was confusing the two.
Can you tell me more about your usecase? Is it that you need to exclude specs/suites sometimes only?
@filipesilva here it is:
I see two ways of solving this need:
Ok I understand better. Have you considered adding a different protractor config for now?
ng e2e --config mock.protractor.conf.js
ng e2e --config real.protractor.conf.js
I agree that it's not a replacement for a suite flag, but we haven't gotten around to extend the protractor flags further.
I did not think of that, I will see if I can do something with that for now :) Thanks!
Do you want me to open an issue for the exclude flag @filipesilva?
Yes please!
Ditto! I want this!
This would be great - I may be misreading, but it looks like there was already an update for this, marked as superseded though, but I don't think it actually was.
Any update on this? Using the protractor --suite flag would be helpful in our development
Another workaround:
add to package.json :
"scripts": {
.....
"ptor": "protractor"
}
define your suites in protractor.conf.js:
suites: {
registration: './e2e/app.registration.e2e-spec.ts',
posting:'./e2e/app.new-post.e2e-spec.ts', './e2e/app.update-post.e2e-spec.ts' ....
....
},
run the desired suite with the double npm option:
npm run ptor -- --suite=posting
npm run e2e -- --suite auth --> this is not working for me. I am using angular cli 1.4.9 and have the below protractor config
exports.config = {
suites: {
smoke: [
'./e2e/**/smoke/**/*.e2e-spec.ts'
],
regression: [
'./e2e/**/*.e2e-spec.ts'
]
},
...
}
@aniruddhadas9 you cannot use it with e2e. Add an extra protractor script command to package.json
"scripts": {
"ptor": "protractor"
}
and run it with npm run ptor -- --suite=smoke
I wanted to run it using angular cli command like ng e2e --suite=smoke. But cli does not pass that flag to protractor. I have also created a pull request in cli to pass the parameter to the protractor pull request
Which version of the cli is this feature (https://github.com/angular/angular-cli/pull/8354) going to be available in ?
Its already available in 1.7.0-beta release you can try 1.7.0-beta.3
Closing as this will be available in 1.7.0.
@filipesilva if I use ng e2e -- --suite auth how do I pass the parameter auth to protractor.conf.js
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._
Most helpful comment
Its already available in
1.7.0-betarelease you can try1.7.0-beta.3