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

Friday, January 30, 2015

Gem::InstallError: i18n requires Ruby version >= 1.9.3 Heroku

While doing a gem push heroku, I encountered the following error:

Installing dependencies using 1.7.12
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching gem metadata from https://rubygems.org/...........
       Gem::InstallError: i18n requires Ruby version >= 1.9.3.
       Installing multi_json 1.10.1
       Installing rake 10.4.2
       An error occurred while installing i18n (0.7.0), and Bundler cannot continue.
       Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.
       Bundler Output: Fetching gem metadata from https://rubygems.org/...........
       
       Gem::InstallError: i18n requires Ruby version >= 1.9.3.
       Installing multi_json 1.10.1
       Installing rake 10.4.2
       An error occurred while installing i18n (0.7.0), and Bundler cannot continue.

       Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.


My Ruby version in Heroku is still using Ruby 1.9.2, so to solve this I simply add the following line in my gemfile

source 'https://rubygems.org'ruby '2.0.0'

Thursday, July 10, 2014

(unknown) block sequence entries are not allowed in this context at line 5 column 14 (Psych::Syntax Error)

This error come up when I run my cucumber test file.

Solution: the problem is because in my config.yml file I have an entry with "-".

So in my config.yml I have the following:

test_server:
 member_no: -
 member_name: -
 year: 2014

To fix the issue, just remove the "-" from config.yml so that ruby can parse the yml file

test_server:
 member_no: 00000010
 member_name: cucumber
 year: 2014