2

I am using protractor for my AngularJS E2E testing. I use the DOS command line with a white background and black test.

I have the following set up:

  jasmineNodeOpts: {
      isVerbose: true,
    showColors: true,
    defaultTimeoutInterval: 30000,
      stackTrace: false
  }

What happens is that I see the first few lines in black on white:

C:\Test\NodejsConsoleApp1\NodejsConsoleApp1>node_modules\.bin\protractor conf.js
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Homepage1
    Open a page with an id of ng-app

Then the text background changes to black and I see black, red and green on a dark background.

Is there a way I can change this?

2 Answers2

2

You can use jasmine-spec-reporter to display your results, there is an option to disable colors.

Bastien Caudan
  • 4,482
  • 1
  • 17
  • 29
0

not sure if there is a better/cleaner way (maybe a config file, i don't know...)

i got interested and searched 'color' in node_modules/protractor and found this in node_modules/protractor/lib/cli.js starting at line 47

    ANSIColors: {
       pass:    function() { return '\033[32m'; }, // Green
       fail:    function() { return '\033[31m'; }, // Red
       neutral: function() { return '\033[0m';  }  // Normal
    }

color code cheat sheet

anyway, strange behavior of your console to change its background color. windows console has an option to set its appearance and save it (by its console name..? i am on linux now, cant check). not sure if this helps preventing the console from changing its color by it self.

nilsK
  • 4,323
  • 2
  • 26
  • 40
  • Thanks for your suggestion. I did go in and make some changes. Console still changing colors if I go for non-default font size. Seems ood but at least things are better than before. –  May 23 '14 at 12:31