Angular-cli: ng e2e no longer supports specifying a project name

Created on 13 Sep 2018  路  7Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

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

Versions

node -v
v10.9.0

npm -v
6.4.1

ng -v
Angular CLI: 6.2.1
Node: 10.9.0
OS: win32 x64
Angular: 6.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.8.1
@angular-devkit/build-angular      0.8.1
@angular-devkit/build-ng-packagr   0.8.1
@angular-devkit/build-optimizer    0.8.1
@angular-devkit/build-webpack      0.8.1
@angular-devkit/core               0.7.4
@angular-devkit/schematics         0.7.4
@angular/cli                       6.2.1
@angular/pwa                       0.7.4
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.2.1
@schematics/angular                0.7.4
@schematics/update                 0.8.1
ng-packagr                         4.1.1
rxjs                               6.2.2
typescript                         2.9.2
webpack                            4.18.0

Repro steps

  • Install angular-cli 6.2.1
  • Create an angular workspace with three projects:

    • project1

    • project2

    • project2-e2e - configured with a protractor.conf.js file to run tests against project2

  • Try to run ng e2e project2-e2e
  • The cli ignores the project name parameter, and tries to find an e2e architect node in angular.json, instead of running the actual project2-e2e configuration specified in angular.json
  • Re-order the projects in angular.json to:

    • project2

    • project1

    • project2-e2e

  • Re-run ng e2e project2-e2e

    • Because project2 is first in the list, it seems to run e2e tests for that project

  • Run ng e2e -h and notice that is no longer an accepted paramter, even thought the docs say that it is still valid.
$ ng e2e -h
usage: ng e2e [options]
options:
  --configuration (-c)
    Specify the configuration to use.
  --prod
    Flag to set configuration to 'production'.

Desired functionality


This seems to work fine in Angular 6.1.4:

  • Run ng e2e -h and notice that <project> is an accepted parameter:
$ ng e2e -h
usage: ng e2e <project> [options]
options:
  --configuration (-c)
    Specify the configuration to use.
  --prod
    Flag to set configuration to 'production'.

Mention any other details that might be useful

angulacli low regression bufix

Most helpful comment

6.1.5 works as well, the problem starts at 6.2.0

All 7 comments

The issue seems to be related to this file, but I am not 100% sure about that: https://github.com/angular/angular-cli/blob/6.2.x/packages/angular/cli/commands/e2e.json

I found the same issue. It should include

"project": {
      "type": "string",
      "description": "The name of the project to run e2e.",
      "$default": {
        "$source": "argv",
        "index": 0
      }
    },

@byliuyang is that something we can do on our end or is it something that needs to change in the cli? We are running into the same problem.

6.1.5 works as well, the problem starts at 6.2.0

@babeal It should ideally be changed in the CLI. I currently have a file that overrides e2e.json.

Fixed in master

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._

Was this page helpful?
0 / 5 - 0 ratings