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

ng e2e --grep issue #13020

Closed
DmitrijK opened this issue Nov 21, 2018 · 4 comments · Fixed by #16894
Closed

ng e2e --grep issue #13020

DmitrijK opened this issue Nov 21, 2018 · 4 comments · Fixed by #16894

Comments

@DmitrijK
Copy link

DmitrijK commented Nov 21, 2018

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [x] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Desired functionality

I would like to tag Protractor tests and run them using tags. Currently ng e2e is not supporting --grep option:
Unknown option: '--grep'

This feature would solve a problem of running tagged tests and with different tags.

@alan-agius4 alan-agius4 added feature Issue that requests a new feature area: devkit/build-angular labels Nov 21, 2018
@ngbot ngbot bot added this to the Backlog milestone Nov 21, 2018
@PoovinPR
Copy link

PoovinPR commented Jan 3, 2020

@DmitrijK @alan-agius4 Is there any workaround to run only tagged tests(Example: '@smoke' and '@regression') from a specific test suite? In case, if there is one please let me know.

@jdgarvey
Copy link
Contributor

jdgarvey commented Jan 8, 2020

I am also running up against this issue.
The issue appears to be that the Angular Protractor Builder does not support the grep argument (or invertGrep for that matter). See the schema.

@PoovinPR what we did to get around it is to use a base protractor.conf file, then create additional protractor.conf files that extend the base with the jasmineNodeOpts.grep property.

protractor.conf.js

...
exports.config = {
    // All the normal config here
}

protractor.<tagName>.conf.js

var globalConf = require('./protractor.conf.js').config;
globalConf.jasmineNodeOpts.grep = '<tagName>';
globalConf.jasmineNodeOpts.invertGrep = true; // exclude the above tag
exports.config = globalConf;

Then since --protractorConfig is a recognized argument for the Protractor Builder, you can run ng e2e <e2e-app> --protractorConfig protractor.<tagName>.conf.js.

@alan-agius4 alan-agius4 added the needs: discussion On the agenda for team meeting to determine next steps label Jan 8, 2020
@dgp1130
Copy link
Collaborator

dgp1130 commented Jan 9, 2020

This sounds like a reasonable idea. It's flexible and useful enough. This isn't a major priority right now, but we would welcome any PRs implementing this.

@dgp1130 dgp1130 added good first issue help wanted and removed needs: discussion On the agenda for team meeting to determine next steps labels Jan 9, 2020
jdgarvey added a commit to jdgarvey/angular-cli that referenced this issue Feb 9, 2020
Pass the "grep" and "invertGrep" flags through to the Angular Protractor
builder as "jasmineNodeOpts" so that individual specs within an E2E test
file can be targeted.

Fixes angular#13020
jdgarvey added a commit to jdgarvey/angular-cli that referenced this issue Feb 15, 2020
Pass the "grep" and "invertGrep" flags through to the Angular Protractor
builder as "jasmineNodeOpts" so that individual specs within an E2E test
file can be targeted.

Fixes angular#13020
kyliau pushed a commit that referenced this issue Feb 18, 2020
Pass the "grep" and "invertGrep" flags through to the Angular Protractor
builder as "jasmineNodeOpts" so that individual specs within an E2E test
file can be targeted.

Fixes #13020
@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 Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants