I’ve provided details on this set up, but here’s a visual walk through:

My Web Automation Jenkins looks like this the image below.  Each job listed (Announcements, Call Forwarding, etc.) is a specific feature file that Cucumber will run – so each entry runs a multitude of tests.  Each Test is sent to a Selenium Grid hub and is farmed to run on one of several VM’s.  This simultaneous testing brings down the overall end to end duration significantly (from 45min to 6min) :

When you mouse over a job that has run, it will offer the reports view in the menu, like so:

Clicking on the Cucumber Reports link will first present you with a summary of results:

If you click the test link in the Feature Statistics table, it will break down more details on what failed and passed:

 

#

2 Responses

  1. Hi I would like to email the cucumber reports shown above from jenkins to my email id,can you please help me with steps clearly as mentioned in the screen shots above.
    Any help regarding this will be highly appreciated.
    I have come across your post in stack overflow and felt you might help me.
    Thanks,
    Prasad

    • Hi Prasad, unfortunately I don’t think this will work in the way you may want. The report is HTML and XML with links to local files (as most web pages.) Sending it on it’s own will not render out the content well. If you wanted a report to send, you would want to make it a flat file (PDF) – I have not done that, so you may have to discover your own solution. A simple thing would be to send an email that would send the link of the test in the body of the email. You get the email, click the link and then click the Cucumber report on the page to see it. To do that, you can either use the Jenkins email plugin or write a email script in a language and run the script after the test is over. The former is the easiest way perhaps. Jenkins has an email plugin. I do not use it anymore, so I’m going off memory. You would have to configure a task after the test is over, to kick off the email task. It has its own markup language that you can use in the body of the email so it sends a link to the results page, to the users you define.
      Then it works like so:
      Jenkins runs the test
      Test finishes and it creates the report
      An email is sent to you with a link back to the Jenkins test, you click it and see the results.

      If you really need the results in an email, you would have to use a different solution. This might be doable by using just the regular path of running the cucumber test, and sending the console logs from jenkins to your email address using an email plugin. When Jenkins runs cucumber, it saves the entire output of all the tests (including the final results) to the console log. you would have to find a way of adding the console log to the email body. But it may not be that hard. the email plugins may have markup language to paste the console output into the body of the email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archives
Categories