lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 137 forks source link

e2e testing fails with an error #205

Closed ryaa closed 7 years ago

ryaa commented 7 years ago

I followed the instructions form http://lathonez.github.io/2016/ionic-2-e2e-testing/ and when i execute npm run e2e on the last step I got the below error:

Alexs-MacBook-Pro:boss811.mobile alexryltsov$ npm run e2e

> boss811.mobile@ e2e /Users/alexryltsov/Git/boss811.mobile
> protractor

[13:59:43] I/direct - Using ChromeDriver directly...
[13:59:43] I/launcher - Running 1 instances of WebDriver
[13:59:44] E/launcher - Error: TypeError: SpecReporter is not a constructor
    at onPrepare (/Users/alexryltsov/Git/boss811.mobile/protractor.conf.js:30:34)
    at /Users/alexryltsov/Git/boss811.mobile/node_modules/protractor/built/util.js:45:49
    at Function.promise (/Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:682:9)
    at Object.runFilenameOrFn_ (/Users/alexryltsov/Git/boss811.mobile/node_modules/protractor/built/util.js:37:16)
    at /Users/alexryltsov/Git/boss811.mobile/node_modules/protractor/built/runner.js:93:27
    at _fulfilled (/Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:796:13)
    at /Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:556:49
    at runSingle (/Users/alexryltsov/Git/boss811.mobile/node_modules/q/q.js:137:13)
[13:59:44] E/launcher - Process exited with error code 100

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

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alexryltsov/Git/boss811.mobile/npm-debug.log
Alexs-MacBook-Pro:boss811.mobile alexryltsov$

The sources can be found at https://ryaa@bitbucket.org/bossgit/boss811.mobile.git in master branch

ryaa commented 7 years ago

Changing the below line in protractor.conf.js fixed the problem

var SpecReporter = require('jasmine-spec-reporter'); to be let SpecReporter = require('jasmine-spec-reporter').SpecReporter;

lathonez commented 7 years ago

Any idea why you'd be getting this problem as opposed to anyone else (including both CI build tools)?

Any differences in package versions?

ryaa commented 7 years ago

Looks like they have a breaking change in the recent release 3.0.0 - see https://github.com/bcaudan/jasmine-spec-reporter/releases

I have "jasmine-spec-reporter": "^3.0.0", while your package.json has 2.7.0

Since I followed your blog instructions it installed the latest version for me

lathonez commented 7 years ago

Thanks very much, noted for when we upgrade.