Repository navigation
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
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Linux Ubuntu 16.04 - Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand 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.
> pftest@0.0.0 pree2e /home/john/projects/pftest
> webdriver-manager update
selenium standalone is up to date.
chromedriver is up to date.
> pftest@0.0.0 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! pftest@0.0.0 e2e: protractor "config/protractor.conf.js"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pftest@0.0.0 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.
Activity
[-]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)[/+]filipesilva commentedon Sep 19, 2016
Good catch, we'll get on it.
Gelio commentedon Sep 23, 2016
I managed to fix it by changing
appto<%= 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.
fix(generate): use prefix when initializing app (#2046) (#2367)
Gelio commentedon Sep 28, 2016
Can be closed, since the fix has been merged.
fix(generate): use prefix when initializing app (angular#2046) (angul…
fix(generate): use prefix when initializing app (angular#2046) (angul…
NikitaCe commentedon Dec 30, 2016
Hello, i had the same issue...
I solved this issue running
Then i stayed in superuser and created the angular project
And it created the app.
angular-automatic-lock-bot commentedon Sep 6, 2019
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.