Cucumber Not Showing Coloured Output in Windows

Cucumber not showing coloured output in windows

One of the dev's at my work figured it out.

You need to

  1. Download Ansicon from https://github.com/adoxa/ansicon/downloads and unzip it into a directory

    with no spaces
  2. Open a command prompt and cd to the folder where you unzipped it
  3. Now, cd into either x86 or x64 (depending on your machine’s processor) and install it globally on

    your machine (For example, D:\Cucumber\ansi160\x64)
  4. Type ansicon.exe –i OR ansicon -i and press Enter
  5. Any program that prints ANSI colors will now display properly on your machine.

How do I get coloured output back for Cucumber in ConEmu?

Old build was used. Update to latest alpha.

Remove warning about ansicon from rake cucumber

You can actually remove the warning itself. I do not like installing a bunch of garbage just for the sake of having a green word. So, to remove the warning:

1. Locate the Cucumber installation in gems directory (it's in the Ruby installation directory). For me it was: lib\ruby\gems\1.9.1\gems\cucumber-1.2.0

2. In the cucumber-1.2.0\lib\cucumber\formatter directory of the Cucumber installation find the file ansicolor.rb

3. Locate the line:

STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}

and add # in front of it to comment it out:

# STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}

The line number was 14 for my version of Cucumber.

4. Save the file and you're done

Calabash no colors in output

I have not tried this, but I found this blog post that writes about the same problem http://qastuffs.blogspot.dk/2011/02/how-to-install-ansicon-for-cucumber-to.html
So it could be worth a try.

Copied from the blog

Anyway, here are the steps on how to install ansicon.exe:

  1. Download and unzip the file from https://github.com/adoxa/ansicon/downloads
  2. open cmd and navigate to the unzipped folder
  3. Navigate to x64 (if you have a 64 bit machine) otherwise navigate to x86
  4. Type ansicon.exe -h and you will get the following: D:\Data\ansicon\x86>ansicon.exe -h ANSICON by Jason Hood . Version
    1.32 (22 December, 2010). Freeware. http://ansicon.adoxa.cjb.net/

Process ANSI escape sequences in Win32 console programs.

ansicon -i|I | -u|U ansicon [-m[]] [-p | -e|E string | -t|T [file(s)]
| program [args]]

-i install - add ANSICON to the AutoRun entry (implies
-p) -u uninstall - remove ANSICON from the AutoRun entry -I -U use local machine instead of current user -m use grey on black ("monochrome") or as default color -p

hook into the parent process -e echo string -E

echo string, don't append newline -t display files ("-"
for stdin), combined as a single stream -T display files,
name first, blank line before and after program run the
specified program nothing run a new command processor, or
display stdin if redirected

is one or two hexadecimal digits; please use "COLOR /?" for details.
5. Execute 'ansicon.exe -i' to install and add ansicon to your Windows
6. Run your cucumber 0.10.0 test and you should get the coloured output result on Windows



Related Topics



Leave a reply



Submit