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

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

Tuesday, July 1, 2014

Heroku: Permission denied (publickey)

Error:
heroku git:clone -a myapp
Cloning from app 'myapp'...
Cloning into 'myapp'...
The authenticity of host 'heroku.com (50.19.85.154)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Solution:

terminal:~ heroku keys:add
Could not find an existing public key.
Would you like to generate one? [Yn] y
Generating new SSH public key.
Uploading SSH public key /Users/terminal/.ssh/id_rsa.pub... done

termina:~ heroku git:clone -a myapp

Cloning from app 'myapp'...
Cloning into 'myapp'...
Fetching repository, done.

remote: Counting objects: 2405, done.
remote: Compressing objects: 100% (1323/1323), done.
Receiving objects:  12% (305/2405), 3.27 MiB | 12.00 KiB/s   
.
.
.
.