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

No color console output when protrator jasmine-spec-reporter is run with Grunt task #36

Closed
Mletter1 opened this issue May 18, 2015 · 11 comments

Comments

@Mletter1
Copy link

https://stackoverflow.com/questions/29320180/protractor-with-mocha-chai-dont-display-errors-since-1-8-0-migration?newreg=65f63d9e0e184da28a652989872c7d89

Summery of issue described in this stackoverflow thread. I've encountered the same issue running protractor tests through a grunt task where colors will not show up in the output. Running of test with protractor alone has no issues and the colors will display fine.

@bcaudan
Copy link
Owner

bcaudan commented May 18, 2015

All right, so if I understand well, you are trying to run protractor with grunt-protractor-runner task. You have configured jasmine-spec-reporter in your protractor conf. When you run protractor alone, colors are displayed but not when you run it with the grunt task.
So, IMHO it does not seem related to jasmine-spec-reporter and I close this issue accordingly.

I use the grunt-protractor-runner task my self and I have no problems with it. Have you correctly set the noColor option?

@bcaudan bcaudan closed this as completed May 18, 2015
@Mletter1
Copy link
Author

So, I've currently been trying to track down why its not displaying the colors. The noColor option has been set to false. I can only replicate the color display issue when running protractor with grunt. Currently these are all the version of dependencies I am running. I haven't had time to try older version of jasmine, protractor, ect... At this point I'm now leaning towards there being an issue with grunt or test runner not jasmine-spec-runner. I'll let you know if I find the issue

"angular-jsdoc": "^0.3.2",
"archiver": "^0.12.0",
"generator-env-config": "0.0.2",
"grunt": "^0.x",
"grunt-autoprefixer": "^2.2.0",
"grunt-concurrent": "^0.5.0",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-connect": "^0.7.1",
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-htmlmin": "^0.3.0",
"grunt-contrib-imagemin": "^0.9.3",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-uglify": "^0.4.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6",
"grunt-filerev": "^0.2.1",
"grunt-google-cdn": "^0.4.0",
"grunt-istanbul": "^0.5.0",
"grunt-karma": "^0.10.1",
"grunt-newer": "^0.7.0",
"grunt-ng-annotate": "^0.4.0",
"grunt-protractor-coverage": "^0.2.13",
"grunt-protractor-runner": "^2.x",
"grunt-protractor-webdriver": "^0.2.0",
"grunt-replace": "^0.8.0",
"grunt-svgmin": "^2.0.0",
"grunt-usemin": "^2.6.2",
"grunt-war": "^0.4.4",
"grunt-wiredep": "^2.0.0",
"install": "^0.1.8",
"jasmine-core": "^2.2.0",
"jasmine-reporters": "^2.0.4",
"jsdoc": "^3.3.0-beta1",
"jshint-stylish": "^0.2.0",
"karma": "^0.12.31",
"karma-coverage": "^0.2.7",
"karma-jasmine": "^0.3.5",
"karma-junit-reporter": "^0.2.2",
"karma-mocha": "~0.1.3",
"karma-ng-html2js-preprocessor": "^0.1.2",
"karma-phantomjs-launcher": "^0.1.4",
"load-grunt-tasks": "^3.0.0",
"npm": "^2.7.3",
"protractor": "^2.x",
"time-grunt": "^0.3.2",
"webdriver-manager": "^2.0.0",
"yo": "^1.3.3",
"jasmine-spec-reporter": "^2.x"

@deonclem
Copy link

I'm running into the same issue, no color output with :
"grunt-protractor-runner": "^2.0.0",
"jasmine-core": "^2.3.4",
"jasmine-spec-reporter": "^2.2.2",
"protractor": "^2.1.0"
Did you manage to find a workaround @Mletter1 ?

@Mletter1
Copy link
Author

Still haven't found a fix. I've tried older versions of grunt protractor runner and protractor with no luck.

@pmowrer
Copy link

pmowrer commented May 26, 2015

I'm having the same problem after upgrading from protractor/jasmine/jasmine-spec-reporter 2.0/2.1.1/2.1.0 -> 2.1/2.3.1/2.2.2, except I'm not running protractor through grunt-protractor-runner.

@bcaudan
Copy link
Owner

bcaudan commented May 26, 2015

Can you reproduce it by clonining this repository and launching the protractor example?

@pmowrer
Copy link

pmowrer commented May 26, 2015

@bcaudan I can't -- the example works! I also tried updating it to skip starting the selenium server and use directConnect: true, which is how my environment is set up. Will do some more digging when I get time.

@pmowrer
Copy link

pmowrer commented May 26, 2015

@bcaudan Just a hunch, but it might be due to a difference in how Protractor is launched. I launch it as a node child process and I would imagine that the grunt task does something similar.

@bcaudan
Copy link
Owner

bcaudan commented May 29, 2015

This issue is due to the plugin used to color the jasmine-spec-reporter output, if you run jasmine test into a child process with output piped, then colors are not displayed.

So you can have this issue if you use grunt-protractor-runner >= 1.2.0 (see options.output)

It is related to Marak/colors.js#127.

@bcaudan bcaudan reopened this May 29, 2015
@Mletter1
Copy link
Author

Nice that did it! After adding colors.enabled to jasmine-spec-reporter.js all the colors are now displaying with grunt.

var colors = require('colors');
colors.enabled = true;
var SpecMetrics = require('./spec-metrics');
var SpecDisplay = require('./spec-display');
...
...
...

@bcaudan
Copy link
Owner

bcaudan commented May 30, 2015

I have added it in v2.2.3.

@bcaudan bcaudan closed this as completed May 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants