Closed Sjust closed 11 years ago
Hi
The plugin works by taking looking for a json file in a directory that is supplied by using the advanced settings in the job configuration. If no directory is supplied it tries to find a json file in the workspace somewhere. It then copies that json file into the cucumber-html-reports directory in the build directory for that job.
so the first things to check are:
In the next release I will try to put more diagnostic information in the console output.
let me know if that helps
--K
On 8 Mar 2013, at 11:05, Sjust notifications@github.com wrote:
Hi,
I've read some issues about 404 error, maybe the solution of my problem is there but I'm not capable to find it.
My trouble is the next:
The plugin works fine during the execution:
[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on the master [CucumberReportPublisher] copying json to reports directory: /var/lib/jenkins/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_11-29-37/cucumber-html-reports [CucumberReportPublisher] Generating HTML reports Finished: SUCCESS
I create the cucumber.json using this line in my execution:
bundle exec cucumber -p jenkins features/web/ --format json -o cucumber.json
This is the resultant json:
[{"uri":"features/web/check_home.feature","name":"Check the home page","description":"In order to be sure the home page is shown\nAs a Spitni visitor\nI want to see the home page properly","id":"check-the-home-page","line":1,"keyword":"Feature","elements":[{"steps":[{"name":"i am on the HomePage site","result":{"status":"passed"},"match":{"arguments":[{"offset":12,"val":"HomePage"}],"location":"features/step_definitions/web_shared_steps.rb:33"},"line":9,"keyword":"Given "},{"name":"I should see the products content block","result":{"status":"passed"},"match":{"arguments":[{"offset":17,"val":"products content"}],"location":"features/step_definitions/web_shared_steps.rb:6"},"line":10,"keyword":"Then "}],"name":"Open the home page","description":"As a unregistered user, when going to the home page\ni should be able to see the home page properly.","id":"check-the-home-page;open-the-home-page","line":6,"keyword":"Scenario","type":"scenario"}]},{"uri":"features/web/contact_reque st.feature","name":"Click on the contact link","description":"In order to look for the submitMessage button","id":"click-on-the-contact-link","line":1,"keyword":"Feature","elements":[{"steps":[{"name":"I am on the HomePage site","result":{"status":"passed"},"match":{"arguments":[{"offset":12,"val":"HomePage"}],"location":"features/step_definitions/web_shared_steps.rb:33"},"line":5,"keyword":"Given "},{"name":"I click on link Contact","result":{"status":"passed"},"match":{"arguments":[{"offset":16,"val":"Contact"}],"location":"features/step_definitions/web_shared_steps.rb:233"},"line":6,"keyword":"When "},{"name":"I should see the Contact page","result":{"status":"passed"},"match":{"arguments":[{"offset":17,"val":"Contact"}],"location":"features/step_definitions/web_shared_steps.rb:109"},"line":7,"keyword":"Then "}],"name":"Go to the homepage and click on the contact link and look for the submitMessage button","description":"","id":"click-on-the-contact-link;go-to-the-homepag e-and-click-on-the-contact-link-and-look-for-the-submitmessage-button","line":4,"keyword":"Scenario","type":"scenario"}]}]
Do you see something wrong?
Thanks in advance, Sergi Just Casas
— Reply to this email directly or view it on GitHub.
I can see the cucumber.json in the workspace, but i don't know if it is properly formatted.
And the plugin copy the cucumber.json in the cucumber-html-reports directory in the build directory, but this directory only cointains this:
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_11-29-37/cucumber-html-reports$ ls -la total 20 drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 11:30 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 .. -rw-r--r-- 1 jenkins nogroup 2098 Mar 8 11:30 cucumber.json drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 features drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 vendor
This is the RUBY version, in the JAVA version the plugin runs ok, and the folder has different archives.
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_JAVA/builds/2013-03-06_12-04-08/cucumber-html-reports$ ls -la total 88 drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 6 12:04 .. drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 blue drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 charts -rw-r--r-- 1 jenkins nogroup 3632 Mar 6 12:04 cucumber-json-report.json -rw-r--r-- 1 jenkins nogroup 12235 Mar 6 12:04 feature-overview.html -rw-r--r-- 1 jenkins nogroup 7178 Mar 6 12:04 login1.html -rw-r--r-- 1 jenkins nogroup 5928 Mar 6 12:04 login2.html -rw-r--r-- 1 jenkins nogroup 5960 Mar 6 12:04 redsauce-webdriver-spitni-login1.feature.html -rw-r--r-- 1 jenkins nogroup 5960 Mar 6 12:04 redsauce-webdriver-spitni-login2.feature.html -rw-r--r-- 1 jenkins nogroup 13179 Mar 6 12:04 tag-overview.html -rw-r--r-- 1 jenkins nogroup 7166 Mar 6 12:04 web.html
Any idea?
Thanks in advance, Sergi Just Casas
Hi
Your json looks fine - I just ran it through my installation and it produced a report ok. I'm not sure why a features or vendor directory has appeared un the cucumber-html-reports directory. Could it be that the plugin is picking up other json files by mistake - can you try outputting your json report to a directory that has no other json files in it - and set the advanced settings path to point directly to the json report directory relative to the workspace
Let me know how that goes
On 8 Mar 2013, at 11:58, Sjust notifications@github.com wrote:
I can see the cucumber.json in the workspace, but i don't know if it is properly formatted.
And the plugin copy the cucumber.json in the cucumber-html-reports directory in the build directory, but this directory only cointains this:
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_11-29-37/cucumber-html-reports$ ls -la total 20 drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 11:30 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 .. -rw-r--r-- 1 jenkins nogroup 2098 Mar 8 11:30 cucumber.json drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 features drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 11:30 vendor
This is the RUBY version, in the JAVA version the plugin runs ok, and the folder has different archives.
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_JAVA/builds/2013-03-06_12-04-08/cucumber-html-reports$ ls -la total 88 drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 6 12:04 .. drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 blue drwxr-xr-x 4 jenkins nogroup 4096 Mar 6 12:04 charts -rw-r--r-- 1 jenkins nogroup 3632 Mar 6 12:04 cucumber-json-report.json -rw-r--r-- 1 jenkins nogroup 12235 Mar 6 12:04 feature-overview.html -rw-r--r-- 1 jenkins nogroup 7178 Mar 6 12:04 login1.html -rw-r--r-- 1 jenkins nogroup 5928 Mar 6 12:04 login2.html -rw-r--r-- 1 jenkins nogroup 5960 Mar 6 12:04 redsauce-webdriver-spitni-login1.feature.html -rw-r--r-- 1 jenkins nogroup 5960 Mar 6 12:04 redsauce-webdriver-spitni-login2.feature.html -rw-r--r-- 1 jenkins nogroup 13179 Mar 6 12:04 tag-overview.html -rw-r--r-- 1 jenkins nogroup 7166 Mar 6 12:04 web.html
Any idea?
Thanks in advance, Sergi Just Casas
— Reply to this email directly or view it on GitHub.
Yes, I've created a directory into the workspace and looks like the plugin pick the right json and generate different things in cucumber-html-report folder.
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_13-22-16/cucumber-html-reports$ ls -la total 20 drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 13:22 .. drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 blue -rw-r--r-- 1 jenkins nogroup 2098 Mar 8 13:22 cucumber.json -rw-r--r-- 1 jenkins nogroup 0 Mar 8 13:22 feature-overview.html drwxr-xr-x 2 jenkins nogroup 4096 Mar 8 13:22 js
But if I try to click the "Cucumber reports" link i get a black page without code.
Any idea? :)
have you ticked the option to turn off flash charts? There is a bug currently which means javascript charts don't work - so you will have to use flash charts for now. It looks like the json is being picked up correctly this time at least as it has generated the feature-overview.html - but it should also have generated a file for each of your features - those files are missing so the plugin must have died after it created the feature-overview.html. I guess feature-overview.html is empty?
--K
On 8 Mar 2013, at 12:30, Sjust notifications@github.com wrote:
Yes, I've created a directory into the workspace and looks like the plugin pick the right json and generate different things in cucumber-html-report folder.
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_13-22-16/cucumber-html-reports$ ls -la total 20 drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 13:22 .. drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 blue -rw-r--r-- 1 jenkins nogroup 2098 Mar 8 13:22 cucumber.json -rw-r--r-- 1 jenkins nogroup 0 Mar 8 13:22 feature-overview.html drwxr-xr-x 2 jenkins nogroup 4096 Mar 8 13:22 js
But if I try to click the "Cucumber reports" link i get a black page without code.
Any idea? :)
— Reply to this email directly or view it on GitHub.
ah you - know - I can see that you are using javascript charts - because there is a js directory there - if you use the flash charts instead im sure it will work
--K
On 8 Mar 2013, at 12:30, Sjust notifications@github.com wrote:
Yes, I've created a directory into the workspace and looks like the plugin pick the right json and generate different things in cucumber-html-report folder.
jenkins@manager:~/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_13-22-16/cucumber-html-reports$ ls -la total 20 drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 . drwxr-xr-x 3 jenkins nogroup 4096 Mar 8 13:22 .. drwxr-xr-x 4 jenkins nogroup 4096 Mar 8 13:22 blue -rw-r--r-- 1 jenkins nogroup 2098 Mar 8 13:22 cucumber.json -rw-r--r-- 1 jenkins nogroup 0 Mar 8 13:22 feature-overview.html drwxr-xr-x 2 jenkins nogroup 4096 Mar 8 13:22 js
But if I try to click the "Cucumber reports" link i get a black page without code.
Any idea? :)
— Reply to this email directly or view it on GitHub.
Yes!
Thank you for your help :)
I dont know how to reopen this issue on github but I still have this problem. In the jenkins job console I get:
[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on the master [CucumberReportPublisher] copying json to reports directory: /var/lib/jenkins/jobs/tim_ci/builds/2013-03-11_14-11-07/cucumber-html-reports [CucumberReportPublisher] Generating HTML reports
This is the directory contents:
developer@vm-jenkins:/var/lib/jenkins/jobs/tim_ci/builds/2013-03-11_14-11-07/cucumber-html-reports$ ll total 24 drwxr-xr-x 2 jenkins nogroup 4096 2013-03-11 14:28 ./ drwxr-xr-x 4 jenkins nogroup 4096 2013-03-11 14:32 ../ -rw-r--r-- 1 jenkins nogroup 14073 2013-03-11 14:28 cucumber.json
Seems like the HTML reports are not generated. There is no error in the console. Configured this with and without flash charts ending up with the same result.
Hi
Send me your cucumber.json and I will check
Sent from my iPhone
On 11 Mar 2013, at 14:01, JeroenVisser notifications@github.com wrote:
I dont know how to reopen this issue on github but I still have this problem. In the jenkins job console I get:
[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on the master [CucumberReportPublisher] copying json to reports directory: /var/lib/jenkins/jobs/tim_ci/builds/2013-03-11_14-11-07/cucumber-html-reports [CucumberReportPublisher] Generating HTML reports
This is the directory contents:
developer@vm-jenkins:/var/lib/jenkins/jobs/tim_ci/builds/2013-03-11_14-11-07/cucumber-html-reports$ ll total 24 drwxr-xr-x 2 jenkins nogroup 4096 2013-03-11 14:28 ./ drwxr-xr-x 4 jenkins nogroup 4096 2013-03-11 14:32 ../ -rw-r--r-- 1 jenkins nogroup 14073 2013-03-11 14:28 cucumber.json
Seems like the HTML reports are not generated. There is no error in the console. Configured this with and without flash charts ending up with the same result.
— Reply to this email directly or view it on GitHub.
Sorry for the late reply (Assumed I was a watcher of this issue after commenting on it). Here is the contents for cucumber.json:
[{"id":"basic-arithmic","description":" Add support for basic arithmetics:\n* Addition\n* Substraction\n* Multiplication\n* Division","name":"Basic Arithmic","keyword":"Feature","line":1,"elements":[{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;addition;;2","tags":[{"name":"@OPEN","line":12},{"name":"@DEMO-2","line":12}],"description":"","name":"Addition","keyword":"Scenario Outline","line":20,"steps":[{"name":"0 and 1","keyword":"Given ","line":14,"matchedColumns":[0,1]},{"name":"added","keyword":"When ","line":15},{"result":{"duration":2687829,"status":"passed"},"name":"the result should be 1","keyword":"Then ","line":16,"match":{"arguments":[{"val":"1","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;addition;;3","tags":[{"name":"@OPEN","line":12},{"name":"@DEMO-2","line":12}],"description":"","name":"Addition","keyword":"Scenario Outline","line":21,"steps":[{"name":"1 and 1","keyword":"Given ","line":14,"matchedColumns":[0,1]},{"name":"added","keyword":"When ","line":15},{"result":{"duration":50126,"status":"passed"},"name":"the result should be 2","keyword":"Then ","line":16,"match":{"arguments":[{"val":"2","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;addition;;4","tags":[{"name":"@OPEN","line":12},{"name":"@DEMO-2","line":12}],"description":"","name":"Addition","keyword":"Scenario Outline","line":22,"steps":[{"name":"1 and 2","keyword":"Given ","line":14,"matchedColumns":[0,1]},{"name":"added","keyword":"When ","line":15},{"result":{"duration":69796,"status":"passed"},"name":"the result should be 3","keyword":"Then ","line":16,"match":{"arguments":[{"val":"3","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;addition;;5","tags":[{"name":"@OPEN","line":12},{"name":"@DEMO-2","line":12}],"description":"","name":"Addition","keyword":"Scenario Outline","line":23,"steps":[{"name":"2 and 3","keyword":"Given ","line":14,"matchedColumns":[0,1]},{"name":"added","keyword":"When ","line":15},{"result":{"duration":129711,"status":"passed"},"name":"the result should be 5","keyword":"Then ","line":16,"match":{"arguments":[{"val":"5","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;addition;;6","tags":[{"name":"@OPEN","line":12},{"name":"@DEMO-2","line":12}],"description":"","name":"Addition","keyword":"Scenario Outline","line":24,"steps":[{"name":"3 and 5","keyword":"Given ","line":14,"matchedColumns":[0,1]},{"name":"added","keyword":"When ","line":15},{"result":{"duration":59458,"status":"passed"},"name":"the result should be 8","keyword":"Then ","line":16,"match":{"arguments":[{"val":"8","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;substraction;;2","tags":[{"name":"@OPEN","line":27},{"name":"@DEMO-2","line":27}],"description":"","name":"Substraction","keyword":"Scenario Outline","line":35,"steps":[{"name":"1 and 1","keyword":"Given ","line":29,"matchedColumns":[0,1]},{"name":"substracted","keyword":"When ","line":30},{"result":{"duration":50791,"status":"passed"},"name":"the result should be 0","keyword":"Then ","line":31,"match":{"arguments":[{"val":"0","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;substraction;;3","tags":[{"name":"@OPEN","line":27},{"name":"@DEMO-2","line":27}],"description":"","name":"Substraction","keyword":"Scenario Outline","line":36,"steps":[{"name":"8 and 5","keyword":"Given ","line":29,"matchedColumns":[0,1]},{"name":"substracted","keyword":"When ","line":30},{"result":{"duration":51271,"status":"passed"},"name":"the result should be 3","keyword":"Then ","line":31,"match":{"arguments":[{"val":"3","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;multiplication;;2","tags":[{"name":"@OPEN","line":39},{"name":"@DEMO-2","line":39}],"description":"","name":"Multiplication","keyword":"Scenario Outline","line":47,"steps":[{"name":"1 and 1","keyword":"Given ","line":41,"matchedColumns":[0,1]},{"name":"multiplied","keyword":"When ","line":42},{"result":{"duration":55092,"status":"passed"},"name":"the result should be 1","keyword":"Then ","line":43,"match":{"arguments":[{"val":"1","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;multiplication;;3","tags":[{"name":"@OPEN","line":39},{"name":"@DEMO-2","line":39}],"description":"","name":"Multiplication","keyword":"Scenario Outline","line":48,"steps":[{"name":"2 and 2","keyword":"Given ","line":41,"matchedColumns":[0,1]},{"name":"multiplied","keyword":"When ","line":42},{"result":{"duration":56841,"status":"passed"},"name":"the result should be 4","keyword":"Then ","line":43,"match":{"arguments":[{"val":"4","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;multiplication;;4","tags":[{"name":"@OPEN","line":39},{"name":"@DEMO-2","line":39}],"description":"","name":"Multiplication","keyword":"Scenario Outline","line":49,"steps":[{"name":"3 and 3","keyword":"Given ","line":41,"matchedColumns":[0,1]},{"name":"multiplied","keyword":"When ","line":42},{"result":{"duration":59611,"status":"passed"},"name":"the result should be 9","keyword":"Then ","line":43,"match":{"arguments":[{"val":"9","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;division;;2","tags":[{"name":"@OPEN","line":53},{"name":"@DEMO-2","line":53}],"description":"","name":"Division","keyword":"Scenario Outline","line":61,"steps":[{"name":"2 and 1","keyword":"Given ","line":55,"matchedColumns":[0,1]},{"name":"divided","keyword":"When ","line":56},{"result":{"duration":73733,"status":"passed"},"name":"the result should be 2","keyword":"Then ","line":57,"match":{"arguments":[{"val":"2","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;division;;3","tags":[{"name":"@OPEN","line":53},{"name":"@DEMO-2","line":53}],"description":"","name":"Division","keyword":"Scenario Outline","line":62,"steps":[{"name":"9 and 3","keyword":"Given ","line":55,"matchedColumns":[0,1]},{"name":"divided","keyword":"When ","line":56},{"result":{"duration":54845,"status":"passed"},"name":"the result should be 3","keyword":"Then ","line":57,"match":{"arguments":[{"val":"3","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":8,"type":"background"},{"id":"basic-arithmic;division;;4","tags":[{"name":"@OPEN","line":53},{"name":"@DEMO-2","line":53}],"description":"","name":"Division","keyword":"Scenario Outline","line":63,"steps":[{"name":"2 and 2","keyword":"Given ","line":55,"matchedColumns":[0,1]},{"name":"divided","keyword":"When ","line":56},{"result":{"duration":51578,"status":"passed"},"name":"the result should be 1","keyword":"Then ","line":57,"match":{"arguments":[{"val":"1","offset":21}],"location":"BasicArithmic.the_result_should_be(int)"},"matchedColumns":[2]}],"type":"scenario"}],"uri":"target/generated-test-sources/cucumber/4.feature"},{"id":"lawnmower","description":"","name":"Lawnmower","keyword":"Feature","line":1,"elements":[{"description":"","name":"","keyword":"Background","line":4,"type":"background"},{"id":"lawnmower;move","tags":[{"name":"@OPEN","line":8},{"name":"@DEMO-3","line":8}],"description":"","name":"Move","keyword":"Scenario","line":9,"steps":[{"name":"a mower at 10, 10 facing north","keyword":"Given ","line":10},{"name":"I move the mower","keyword":"When ","line":11},{"result":{"duration":2070248,"status":"passed"},"name":"the mower should be at 10, 9 facing north","keyword":"Then ","line":12,"match":{"arguments":[{"val":"10","offset":23},{"val":"9","offset":27},{"val":"north","offset":36}],"location":"Lawnmower.the_mower_should_be_at_facing(int,int,String)"}}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":4,"type":"background"},{"id":"lawnmower;change-direction","tags":[{"name":"@OPEN","line":15},{"name":"@DEMO-3","line":15}],"description":"","name":"Change direction","keyword":"Scenario","line":16,"steps":[{"name":"a mower at 10, 10 facing north","keyword":"Given ","line":17},{"name":"I pivot the mower to the left","keyword":"When ","line":18},{"result":{"duration":125309,"status":"passed"},"name":"the mower should be at 10, 10 facing west","keyword":"Then ","line":19,"match":{"arguments":[{"val":"10","offset":23},{"val":"10","offset":27},{"val":"west","offset":37}],"location":"Lawnmower.the_mower_should_be_at_facing(int,int,String)"}}],"type":"scenario"},{"description":"","name":"","keyword":"Background","line":4,"type":"background"},{"id":"lawnmower;follow-path","tags":[{"name":"@OPEN","line":22},{"name":"@DEMO-3","line":22}],"description":"","name":"Follow path","keyword":"Scenario","line":23,"steps":[{"name":"a mower at 10, 10 facing east","keyword":"Given ","line":24},{"name":"I pivot the mower to the right","keyword":"When ","line":25},{"name":"I move the mower","keyword":"And ","line":26},{"name":"I pivot the mower to the right","keyword":"And ","line":27},{"result":{"duration":94361,"status":"passed"},"name":"the mower should be at 10, 11 facing west","keyword":"Then ","line":28,"match":{"arguments":[{"val":"10","offset":23},{"val":"11","offset":27},{"val":"west","offset":37}],"location":"Lawnmower.the_mower_should_be_at_facing(int,int,String)"}}],"type":"scenario"}],"uri":"target/generated-test-sources/cucumber/5.feature"},{"id":"contract-hours-per-week,-variable-work-pattern","description":" Uitgangspunt: De medewerker heeft een contract voor 28 uur per week en werkt een onregelmatig patroon (woensdag maar een halve dag en donderdag helemaal niet).","name":"Contract hours per week, variable work pattern","keyword":"Feature","line":1,"elements":[{"description":"See: http://confluence/display/PM/Use-cases+contractberekening#Use-casescontractberekening-Case2:Contractinurenperweek,wisselendwerkpatroon","name":"","keyword":"Background","line":4,"type":"background"},{"id":"contract-hours-per-week,-variable-work-pattern;2b-compensate-holidays;;2","tags":[{"name":"@OPEN","line":8},{"name":"@DEMO-4","line":8}],"description":"","name":"2b Compensate holidays","keyword":"Scenario Outline","line":20,"steps":[{"name":"a contract for 28 hours","keyword":"Given ","line":10,"matchedColumns":[0]},{"name":"the following workday distribution 2, 1, 2, 0, 2, 0, 0","keyword":"And ","line":11,"matchedColumns":[1,2,3,4,5,6,7]},{"name":"holiday on the first wednesday","keyword":"And ","line":12},{"name":"holidays compensated","keyword":"And ","line":13},{"name":"the workday distribution should be 5","keyword":"Then ","line":14,"matchedColumns":[8]},{"name":"the theoretical schedule duration should be 16.8","keyword":"And ","line":15,"matchedColumns":[9]},{"result":{"duration":49571,"status":"passed"},"name":"generated schedule duration should be 20","keyword":"And ","line":16,"match":{"arguments":[{"val":"20","offset":38}],"location":"SchedulerContractHoursPerWeek.generated_schedule_duration_should_be(int)"},"matchedColumns":[10]}],"type":"scenario"},{"description":"See: http://confluence/display/PM/Use-cases+contractberekening#Use-casescontractberekening-Case2:Contractinurenperweek,wisselendwerkpatroon","name":"","keyword":"Background","line":4,"type":"background"},{"id":"contract-hours-per-week,-variable-work-pattern;2c-multiweek-scheduling;;2","tags":[{"name":"@OPEN","line":23},{"name":"@DEMO-4","line":23}],"description":"","name":"2c Multiweek scheduling","keyword":"Scenario Outline","line":36,"steps":[{"name":"a contract for 28 hours","keyword":"Given ","line":25,"matchedColumns":[0]},{"name":"the following workday distribution 2, 0, 2, 0, 2, 0, 0","keyword":"And ","line":26,"matchedColumns":[1,2,3,4,5,6,7]},{"name":"the following workday distribution 2, 2, 2, 0, 2, 0, 0","keyword":"And ","line":27,"matchedColumns":[8,9,10,11,12,13,14]},{"name":"holiday on the first wednesday","keyword":"And ","line":28},{"name":"holidays compensated","keyword":"And ","line":29},{"name":"the workday distribution should be 12","keyword":"Then ","line":30,"matchedColumns":[15]},{"name":"the theoretical schedule duration should be 16.8","keyword":"And ","line":31,"matchedColumns":[16]},{"result":{"duration":49971,"status":"passed"},"name":"generated schedule duration should be 20","keyword":"And ","line":32,"match":{"arguments":[{"val":"20","offset":38}],"location":"SchedulerContractHoursPerWeek.generated_schedule_duration_should_be(int)"},"matchedColumns":[17]}],"type":"scenario"}],"uri":"target/generated-test-sources/cucumber/6.feature"}]
Hi I am getting this error in the url of cucumber reports
Cucumber
Back To Jenkins Oops Something went wrong with TestCucumber build: 15
The error message (if any) is below:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 380 path $[0].elements[0].before[0].match.location at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:861) at com.google.gson.Gson.fromJson(Gson.java:799) at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:35) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:48) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:133) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 380 path $[0].elements[0].before[0].match.location at com.google.gson.stream.JsonReader.nextString(JsonReader.java:838) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) ... 26 more
Trying to generate report from following files. Make sure they are valid cucumber report files: /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_516_12_4.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_516_16_11.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_516_8_39.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_517_0_54.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_517_44_45.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_517_59_41.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_518_59_25.json /root/.jenkins/jobs/TestCucumber/builds/15/cucumber-html-reports/Sauce_Android_android_device_519_2_47.json
Jenkins Plugin | Cucumber reports build: 28-01-2016 19:04:37
It says that json file is not valid:
BEGIN_OBJECT at line 1 column 380 path $[0].elements[0].before[0].match.location
Attach JSON so I can check what's going on
My json file is :
[{"uri":"features/LoginOnBoarding.feature","id":"login-to-free-charge-app","keyword":"Feature","name":"Login to Free charge app","description":" As I user I want to validate that the app behaves\n as expected","line":2,"tags":[{"name":"@e2e","line":1}],"elements":[{"keyword":"Background","name":"","description":"","line":6,"type":"background","before":[{"match":{"location":{"filepath":{"filename":"features/support/hooks.rb"},"lines":{"data":[8]}}},"result":{"status":"passed","duration":13012}}],"steps":[{"keyword":"Given ","name":"I Start the Freecharge app","line":7,"output":["Starting freecharge app"],"match":{"location":{"filepath":{"filename":"features/step_definitions/Step_Login.rb"},"lines":{"data":[2]}}},"result":{"status":"passed","duration":10000200570}}]},{"id":"login-to-free-charge-app;login-to-app","keyword":"Scenario","name":"Login to app","description":"","line":11,"type":"scenario","tags":[{"name":"@e2e","line":1},{"name":"@login","line":10}],"steps":[{"keyword":"When ","name":"I select get started","line":12,"match":{"location":{"filepath":{"filename":"features/step_definitions/Step_Login.rb"},"lines":{"data":[8]}}},"result":{"status":"passed","duration":11671528229}},{"keyword":"When ","name":"I enter Username in email id field","line":13,"match":{"location":{"filepath":{"filename":"features/step_definitions/Step_Login.rb"},"lines":{"data":[13]}}},"result":{"status":"passed","duration":16405364864}},{"keyword":"And ","name":"password in Password field","line":14,"match":{"location":{"filepath":{"filename":"features/step_definitions/Step_Login.rb"},"lines":{"data":[18]}}},"result":{"status":"passed","duration":6857388992}}],"after":[{"match":{"location":{"filepath":{"filename":"features/support/hooks.rb"},"lines":{"data":[12]}}},"result":{"status":"passed","duration":17944}}]}]}]
I am using ruby cucumber framework to do my automation and I get my reports in json format for cucumber plugin .. How can I refine this to get it working ?
I use this function :
def json_report_flag(name) path = path_to_results_folder date_dir = date_folder uniq_postfix = unique_postfix create_directory(path, date_dir) report_name = "#{name}__#{uniq_postfix}.json" "-f json --out #{path}/#{date_dir}/#{report_name}" end
and use it like this to generate reports
task :android_avd, [:tag, :avd] do |t, args| Cucumber::Rake::Task.new :cucumber_android_avd do |t| ENV['DEVICE'] = args[:avd].to_s.gsub('avd:', '').strip
emulator = ENV['DEVICE']
tag = args[:tag]
t.profile = 'android_avd'
if tag.nil?
t.cucumber_opts = json_report_flag("Android_#{emulator}")
else
t.cucumber_opts = "--tags @#{tag.gsub('@', '')} #{json_report_flag("Android_#{emulator}")}"
end
end
This plugin does not officially support ruby
Hi,
I've read some issues about 404 error, maybe the solution of my problem is there but I'm not capable to find it.
My trouble is the next:
The plugin works fine during the execution:
[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on the master [CucumberReportPublisher] copying json to reports directory: /var/lib/jenkins/jobs/Spitni-UI_Testing_in_PreProd_RUBY/builds/2013-03-08_11-29-37/cucumber-html-reports [CucumberReportPublisher] Generating HTML reports Finished: SUCCESS
I create the cucumber.json using this line in my execution:
bundle exec cucumber -p jenkins features/web/ --format json -o cucumber.json
This is the resultant json:
[{"uri":"features/web/check_home.feature","name":"Check the home page","description":"In order to be sure the home page is shown\nAs a Spitni visitor\nI want to see the home page properly","id":"check-the-home-page","line":1,"keyword":"Feature","elements":[{"steps":[{"name":"i am on the HomePage site","result":{"status":"passed"},"match":{"arguments":[{"offset":12,"val":"HomePage"}],"location":"features/step_definitions/web_shared_steps.rb:33"},"line":9,"keyword":"Given "},{"name":"I should see the products content block","result":{"status":"passed"},"match":{"arguments":[{"offset":17,"val":"products content"}],"location":"features/step_definitions/web_shared_steps.rb:6"},"line":10,"keyword":"Then "}],"name":"Open the home page","description":"As a unregistered user, when going to the home page\ni should be able to see the home page properly.","id":"check-the-home-page;open-the-home-page","line":6,"keyword":"Scenario","type":"scenario"}]},{"uri":"features/web/contact_request.feature","name":"Click on the contact link","description":"In order to look for the submitMessage button","id":"click-on-the-contact-link","line":1,"keyword":"Feature","elements":[{"steps":[{"name":"I am on the HomePage site","result":{"status":"passed"},"match":{"arguments":[{"offset":12,"val":"HomePage"}],"location":"features/step_definitions/web_shared_steps.rb:33"},"line":5,"keyword":"Given "},{"name":"I click on link Contact","result":{"status":"passed"},"match":{"arguments":[{"offset":16,"val":"Contact"}],"location":"features/step_definitions/web_shared_steps.rb:233"},"line":6,"keyword":"When "},{"name":"I should see the Contact page","result":{"status":"passed"},"match":{"arguments":[{"offset":17,"val":"Contact"}],"location":"features/step_definitions/web_shared_steps.rb:109"},"line":7,"keyword":"Then "}],"name":"Go to the homepage and click on the contact link and look for the submitMessage button","description":"","id":"click-on-the-contact-link;go-to-the-homepage-and-click-on-the-contact-link-and-look-for-the-submitmessage-button","line":4,"keyword":"Scenario","type":"scenario"}]}]
Do you see something wrong?
Thanks in advance, Sergi Just Casas