antonybudianto / angular-starter

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)
https://antonybudianto.github.io/angular-starter/
MIT License
521 stars 147 forks source link

Error when running e2e test #164

Closed rickkowal closed 8 years ago

rickkowal commented 8 years ago

Thanks for the awesome starter!
When I try to run the e2e tests, I get the following errors, any ideas?:

angular2-starter@1.0.0 e2e /PROJECT_PATH/angular2-starter-master gulp e2e

============ Angular 2 Starter ============ Current environment: development

[16:13:13] Using gulpfile ~/PROJECT_PATH/angular2-starter-master/gulpfile.js [16:13:13] Starting 'driver-update'... [16:13:13] I/update - chromedriver: file exists /PROJECT_PATH/angular2-starter-master/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22mac32.zip [16:13:13] I/update - chromedriver: unzipping chromedriver_2.22mac32.zip [16:13:14] I/update - chromedriver: setting permissions to 0755 for /PROJECT_PATH/angular2-starter-master/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22 [16:13:14] I/update - chromedriver: v2.22 up to date [16:13:14] I/update - selenium standalone: file exists /PROJECT_PATH/angular2-starter-master/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar [16:13:14] I/update - selenium standalone: v2.53.1 up to date [16:13:14] Finished 'driver-update' after 999 ms [16:13:14] Starting 'e2e-test'... [16:13:14] Finished 'e2e-test' after 11 ms [16:13:14] Starting 'e2e'... [16:13:14] Finished 'e2e' after 9.24 μs [16:13:14] I/local - Starting selenium standalone server... [16:13:14] I/launcher - Running 1 instances of WebDriver [16:13:14] E/launcher - Server terminated early with status 1 [16:13:14] E/launcher - Error: Server terminated early with status 1 at Error (native) at /PROJECT_PATH/angular2-starter-master/nodemodules/selenium-webdriver/remote/index.js:242:20 at ManagedPromise.invokeCallback (/PROJECT_PATH/angular2-starter-master/nodemodules/selenium-webdriver/lib/promise.js:1379:14) at TaskQueue.execute (/PROJECT_PATH/angular2-starter-master/nodemodules/selenium-webdriver/lib/promise.js:2913:14) at TaskQueue.executeNext (/PROJECT_PATH/angular2-starter-master/node_modules/selenium-webdriver/lib/promise.js:2896:21) at /PROJECT_PATH/angular2-starter-master/node_modules/selenium-webdriver/lib/promise.js:2775:27 at /PROJECT_PATH/angular2-starter-master/node_modules/selenium-webdriver/lib/promise.js:639:7 at process._tickCallback (node.js:366:9) [16:13:14] E/launcher - Process exited with error code 199 [16:13:14] Error running E2E testing

npm ERR! Darwin 15.6.0 npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "e2e" npm ERR! node v4.2.1 npm ERR! npm v3.6.0 npm ERR! code ELIFECYCLE npm ERR! angular2-starter@1.0.0 e2e: gulp e2e npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular2-starter@1.0.0 e2e script 'gulp e2e'. 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 angular2-starter package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! gulp e2e npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-starter npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-starter npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /PROJECT_PATH/angular2-starter-master/npm-debug.log

antonybudianto commented 8 years ago

@rickkowal can you try on latest starter snapshot?

rickkowal commented 8 years ago

Thanks for the reply. I'm still getting the same error after downloading the latest snapshot. Any suggestions?

rickkowal commented 8 years ago

I'm on Mac OS 10.11 and I updated my homebrew installation as well as Java, and was able to get the task running (it opened the browser), but then crashed with:

[10:15:21] I/local - Selenium standalone server started at http://192.168.8.100:53177/wd/hub [10:15:24] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript e2e/home/home.spec.ts (3,9): Cannot find name 'browser'. (2304) e2e/home/home.spec.ts (8,9): Cannot find name 'browser'. (2304) e2e/home/home.spec.ts (9,22): Cannot find name 'element'. (2304) e2e/home/home.spec.ts (9,30): Cannot find name 'by'. (2304)

antonybudianto7 commented 8 years ago

Sorry I cannot reproduce the issue even from fresh clone and install, can you try on node 5 or later?

antonybudianto commented 8 years ago

closing as no response, please try on latest snapshot

Koshmaar commented 7 years ago

I have a similar one with newest snapshot on:

Operating System Windows 7 x64
Node version 6.9.1
NPM Version 3.10.8
Environment Cygwin console

$ npm run e2e

angular2-starter@1.0.1 e2e E:\WWW\WebdevHomepage\admin gulp e2e

============ Angular 2 Starter ============ Current environment: development

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "E:\Tools\nodejs\node.exe" "E:\Tools\nodejs\node_modules\npm\bin\npm-cli.js" "run" "e2e" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! angular2-starter@1.0.1 e2e: gulp e2e npm ERR! Exit status 1

I didn't change anything in the source yet. Any suggestions what to try?

danyhoron commented 7 years ago

Add this line at the beginning of your e2e typescript tests:

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

That did it for me.

antonybudianto7 commented 7 years ago

@danyhoron can you open a PR for that? Thank you for the fix!