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

Project generated with Angular CLI ng new command fails e2e test out of the box if you use the --prefix option (angular-cli: 1.0.0-beta.11-webpack.2) #2046

Closed
jrschmidt opened this issue Sep 10, 2016 · 5 comments
Labels
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@jrschmidt
Copy link

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Linux Ubuntu 16.04
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

$ ng --version
angular-cli: 1.0.0-beta.11-webpack.2
node: 6.5.0
os: linux x64

3 Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.

I generated a new project with angular-cli 1.0.0-beta.11-webpack.2 using the command

ng new pftest --prefix pft.

Then I successfully ran ng serve and ng test, but encountered a failure when I ran ng e2e.

4 The log given by the failure. Normally this include a stack trace and some
more information.

Results of command ng e2e:

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.

> [email protected] pree2e /home/john/projects/pftest
> webdriver-manager update

selenium standalone is up to date.
chromedriver is up to date.

> [email protected] e2e /home/john/projects/pftest
> protractor "config/protractor.conf.js"

[14:36:55] I/direct - Using ChromeDriver directly...
[14:36:55] I/launcher - Running 1 instances of WebDriver
Spec started

pftest App
✗ should display message saying app works
- Expected 'app works!' to equal 'pft works!'.

**************************************************
* Failures *
**************************************************

1) pftest App should display message saying app works
- Expected 'app works!' to equal 'pft works!'.

Executed 1 of 1 spec (1 FAILED) in 0.905 sec.
[14:36:56] I/launcher - 0 instance(s) of WebDriver still running
[14:36:56] I/launcher - chrome #01 failed 1 test(s)
[14:36:56] I/launcher - overall: 1 failed spec(s)
[14:36:56] E/launcher - Process exited with error code 1

npm ERR! Linux 4.6.0-040600-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "e2e" "--" "config/protractor.conf.js"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] e2e: protractor "config/protractor.conf.js"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] e2e script 'protractor "config/protractor.conf.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pftest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor "config/protractor.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pftest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pftest
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/john/projects/pftest/npm-debug.log

Some end-to-end tests failed, see above.

5 Mention any other details that might be useful.

From e2e/app.e2e-spec.ts:

it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('pft works!');
});

After encountering this error with a new project and the prefix 'fam', I reproduced it by starting a brand new project (named pftest) with the ng new command and the --prefix option, using the prefix pft.

@jrschmidt jrschmidt changed the title Project generated with Angular CLI ng new command fails out of the box if you use the --prefix option (angular-cli: 1.0.0-beta.11-webpack.2) Project generated with Angular CLI ng new command fails e2e test out of the box if you use the --prefix option (angular-cli: 1.0.0-beta.11-webpack.2) Sep 12, 2016
@filipesilva
Copy link
Contributor

Good catch, we'll get on it.

@filipesilva filipesilva added effort1: easy (hours) command: generate P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Sep 19, 2016
@Gelio
Copy link
Contributor

Gelio commented Sep 23, 2016

I managed to fix it by changing app to <%= prefix %> when generating the initial component. Also I changed its spec (app.component.spec.ts) so it would pass too.

I'm submitting a PR right now.

hansl pushed a commit that referenced this issue Sep 28, 2016
E2E test would fail when using a prefix to generate the app
@Gelio
Copy link
Contributor

Gelio commented Sep 28, 2016

Can be closed, since the fix has been merged.

@hansl hansl closed this as completed Sep 28, 2016
JJayet pushed a commit to JJayet/angular-cli that referenced this issue Oct 2, 2016
…ar#2367)

E2E test would fail when using a prefix to generate the app
deebloo pushed a commit to deebloo/angular-cli that referenced this issue Oct 3, 2016
…ar#2367)

E2E test would fail when using a prefix to generate the app
@NikitaCe
Copy link

NikitaCe commented Dec 30, 2016

Hello, i had the same issue...
I solved this issue running

su
Password: mypass
npm install -g angular-cli

Then i stayed in superuser and created the angular project

cd Desktop
ng new exampleApp

And it created the app.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants