follow me icons

Thursday, November 26, 2015

How to Output cucumber results in STDOUT or console and as a html report


If you need to output the cucumber result both as a html report and to STDOUT you can use the -f rerun --out rerun.txt. This will be useful if you run the cucumber in jenkins where you want to see the html report as well as to follow the progress of your test.

bundle exec cucumber -f pretty -f html --out report.html -f rerun --out rerun.txt features\regression\ --tag @test

Saturday, November 21, 2015

How to Install Gem Debugger in Ruby

To install debugger -> try using 'gem install debugger2' instead of debugger. 

Before:
Installing debugger-ruby_core_source 1.3.8
/Users/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr/local in PATH, mode 040777

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/.rbenv/versions/2.1.2/bin/ruby extconf.rb 
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/.rbenv/versions/2.1.2/bin/ruby
/Users/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `stat': No such file or directory @ rb_file_s_stat - ./212/ruby_debug.h (Errno::ENOENT)
from /Users/osx/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
from /Users/osx/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1587:in `fu_each_src_dest0'
from /Users/mac/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
from /Users/mac/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:399:in `cp'
from extconf.rb:83:in `block in <main>'
from extconf.rb:82:in `each'
from extconf.rb:82:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/work/cucumber-obat24/vendor/ruby/2.1.0/gems/debugger-1.6.8 for inspection.
Results logged to /Users/work/cucumber-obat24/vendor/ruby/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/debugger-1.6.8/gem_make.out
An error occurred while installing debugger (1.6.8), and Bundler cannot continue.

Make sure that `gem install debugger -v '1.6.8'` succeeds before bundling.

After:

Using debugger-linecache 1.2.0
/Users/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Installing debugger2 1.0.0.beta2
Using rubyzip 1.1.0
Using ruby-ole 1.2.11.7
Using spreadsheet 0.9.6
Using roo 1.13.0
Using rspec-core 2.14.7
Using rspec-expectations 2.14.4
Using rspec-mocks 2.14.4
Using rspec 2.14.1
Using websocket 1.0.7
Using selenium-webdriver 2.38.0
Using tins 0.13.1
Using term-ansicolor 1.2.2
Using bundler 1.6.3
Your bundle is complete!
It was installed into ./vendor