Calabash Report using DayAndTime Format

41 views
Skip to first unread message

Mattivity Room

unread,
Sep 2, 2016, 10:29:37 PM9/2/16
to calabash-android
Hello guys, i wanna ask about getting report in calabash but using DateAndTime Format in froont of name of report.
I found script like this
<%
date = Time.now.strftime('%m_%d-%H:%M:%S')
default_report = "./reports/output_#{date}.html"
default_rerun = "./rerun.txt"
%>

common: NO_STOP='1'
rerun_out: -f rerun -o <%= default_rerun %>
html_report:  -f html -o <%= default_report %>

run:  -p common -p rerun_out -p html_report





I try to running that but i get error 
Invalid argument @ rb_sysopen - ./reports/output_09_03-09:27:25.html
Error creating formatter: html (Errno::EINVAL)
C
:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `initialize'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `
open'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `ensure_io'

C
:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/html.rb:23:in `initialize'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:202:in `
new'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:202:in `create_formatter'

C
:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:191:in `block in formatters'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:180:in `
block in formatter_factorie
'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:175:in `map'

C
:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:175:in `formatter_factories'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:190:in `
formatters'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:172:in `report'

C
:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:64:in `run!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `
execute!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>'

C
:/Ruby23-x64/bin/cucumber:23:in `load'
C:/Ruby23-x64/bin/cucumber:23:in `<main>'
Error creating formatter: html (Errno::EINVAL)
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `initialize'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `open'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/io.rb:9:in `ensure_io'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/formatter/html.rb:23:in `initialize'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:202:in `new'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:202:in `create_formatter'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:191:in `block in formatters'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:180:in `block in formatter_factorie
'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:175:in `map'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/configuration.rb:175:in `formatter_factories'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:190:in `formatters'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:172:in `report'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:64:in `run!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `execute!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>'
C:/Ruby23-x64/bin/cucumber:23:in `load'

Kristina Stemikovskaya

unread,
Sep 30, 2016, 6:53:53 AM9/30/16
to calabash-android
Hi, check if you have created a reports folder in the directory from where you are launching your command. Or add FileUtils.mkdir("./reports") unless File.exists?("./reports"): 

<%

date = Time.now.strftime('%Y-%m-%d-%H%M-%S')

FileUtils.mkdir("./reports") unless File.exists?("./reports")

default_report = "/reports/calabash-#{date}.html"
%>

html_report:  -f 'Calabash::Formatters::Html' -o results/<%= default_report %>  
Reply all
Reply to author
Forward
0 new messages