onehungrymind / angular-testing-quickstart

Testing Examples in Angular
20 stars 11 forks source link

Protractor Testing Fails Immediately with Error: `Error: TypeError: SpecReporter is not a constructor` #1

Open leifwells opened 7 years ago

leifwells commented 7 years ago

Following the instructions in the Readme, I created, installed and ran the project. Then I ran ng serve and ng e2e in separate terminal windows. The ng e2e command failed with the following error:

Leifs-MacBook-Pro:angular-testing-examples leifwells$ ng e2e

> ng2-simple-app@0.0.1 pree2e /Users/leifwells/Code/angular2/angular-testing-examples
> webdriver-manager update

[16:40:05] I/file_manager - creating folder /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium
[16:40:05] I/downloader - curl -o /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip https://chromedriver.storage.googleapis.com/2.26/chromedriver_mac64.zip
[16:40:05] I/downloader - curl -o /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
[16:40:06] I/downloader - curl -o /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.12.0-macos.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.12.0/geckodriver-v0.12.0-macos.tar.gz
[16:40:07] I/update - geckodriver: unzipping geckodriver-v0.12.0-macos.tar.gz
[16:40:07] I/update - geckodriver: setting permissions to 0755 for /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.12.0
[16:40:07] I/update - chromedriver: unzipping chromedriver_2.26mac64.zip
[16:40:07] I/update - chromedriver: setting permissions to 0755 for /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26

> ng2-simple-app@0.0.1 e2e /Users/leifwells/Code/angular2/angular-testing-examples
> protractor "./protractor.conf.js"

[16:40:12] I/direct - Using ChromeDriver directly...
[16:40:12] I/launcher - Running 1 instances of WebDriver
[16:40:12] E/launcher - Error: TypeError: SpecReporter is not a constructor
    at onPrepare (/Users/leifwells/Code/angular2/angular-testing-examples/protractor.conf.js:30:34)
    at q_1.Promise (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/lib/util.ts:47:39)
    at Function.promise (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:682:9)
    at Object.runFilenameOrFn_ (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/lib/util.ts:38:10)
    at plugins_.onPrepare.then (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/lib/runner.ts:85:21)
    at _fulfilled (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:796:13)
    at /Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:556:49
    at runSingle (/Users/leifwells/Code/angular2/angular-testing-examples/node_modules/protractor/node_modules/q/q.js:137:13)
[16:40:12] E/launcher - Process exited with error code 100

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/leifwells/.nvm/versions/node/v6.9.1/bin/node" "/Users/leifwells/.nvm/versions/node/v6.9.1/bin/npm" "run" "e2e" "--" "./protractor.conf.js"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! ng2-simple-app@0.0.1 e2e: `protractor "./protractor.conf.js"`
npm ERR! Exit status 100
npm ERR! 
npm ERR! Failed at the ng2-simple-app@0.0.1 e2e script 'protractor "./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 ng2-simple-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor "./protractor.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ng2-simple-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ng2-simple-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/leifwells/Code/angular2/angular-testing-examples/npm-debug.log

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

This error is obviously pointing to line 30 of protractor.conf.js.

I am placing this issue here as I am going to investigate further.

UPDATE: Oh. Wait. These tests are default tests.

leifwells commented 7 years ago

RE: The above error: https://github.com/lathonez/clicker/issues/205

I'm going to create a branch, create a fix and make a pull request.