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

Projectname with Dot breaks CLI (especially e2e tests ) #6767

Closed
1 of 2 tasks
CanKattwinkel opened this issue Jun 22, 2017 · 2 comments · Fixed by #6802
Closed
1 of 2 tasks

Projectname with Dot breaks CLI (especially e2e tests ) #6767

CanKattwinkel opened this issue Jun 22, 2017 · 2 comments · Fixed by #6802
Labels
effort1: easy (hours) help wanted P5 The team acknowledges the request but does not plan to address it, it remains open for discussion severity2: inconvenient type: bug/fix

Comments

@CanKattwinkel
Copy link

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

  _                      _                 ____ _     ___
  / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
 / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
/ ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
              |___/
@angular/cli: 1.1.3
node: 7.7.3
os: linux x64
@angular/animations: 4.2.4
@angular/common: 4.2.4
@angular/compiler: 4.2.4
@angular/core: 4.2.4
@angular/forms: 4.2.4
@angular/http: 4.2.4
@angular/platform-browser: 4.2.4
@angular/platform-browser-dynamic: 4.2.4
@angular/router: 4.2.4
@angular/service-worker: 1.0.0-beta.16
@angular/cli: 1.1.3
@angular/compiler-cli: 4.2.4
@angular/language-service: 4.2.4

Repro steps.

ng new test.de
./node_modules/.bin/ngc 

The log given by the failure.

Error at /home/user/test.de/e2e/app.po.ts:3:18: '{' expected.
Error at /home/user/test.de/e2e/app.po.ts:3:19: Cannot find name 'DePage'.
Error at /home/user/test.de/e2e/app.po.ts:3:26: ';' expected.
Error at /home/user/test.de/e2e/app.po.ts:4:3: Cannot find name 'navigateTo'.
Error at /home/user/test.de/e2e/app.po.ts:4:16: ';' expected.
Error at /home/user/test.de/e2e/app.po.ts:8:3: Cannot find name 'getParagraphText'.
Error at /home/user/test.de/e2e/app.po.ts:8:3: Unreachable code detected.
Error at /home/user/test.de/e2e/app.po.ts:8:22: ';' expected.
Error at /home/user/test.de/e2e/app.e2e-spec.ts:1:14: ',' expected.
Error at /home/user/test.de/e2e/app.e2e-spec.ts:1:15: Module '"/home/user/test.de/e2e/app.po"' has no exported member 'DePage'.
Error at /home/user/test.de/e2e/app.e2e-spec.ts:4:13: Cannot find namespace 'Test'.
Error at /home/user/test.de/e2e/app.e2e-spec.ts:7:21: Property 'DePage' does not exist on type 'typeof Test'.

What happens.

If you enter a project name with a dot (e.g. "test.de") this will break code generation for e2e tests. Take a loot at the invalid class name Test.DePage in this file:

e2e/app.po.ts

import { browser, by, element } from 'protractor';

export class Test.DePage {
  navigateTo() {
    return browser.get('/');
  }

  getParagraphText() {
    return element(by.css('app-root h1')).getText();
  }
}

Either Angular CLI should throw an error for invalid project name or the e2e class name should be created differently.

@filipesilva filipesilva added help wanted effort1: easy (hours) severity2: inconvenient type: bug/fix P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Jun 26, 2017
@filipesilva
Copy link
Contributor

This is a bug with characters we allow as project names. We should fix the way those classnames are generated.

@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) help wanted P5 The team acknowledges the request but does not plan to address it, it remains open for discussion severity2: inconvenient type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants