How to install the Jenkins cucumber plugin

1. Click the Manage Jenkins link on the left-hand navigation:

manage Jenkins

2. Click Manage Plugins

manage plugins

3. Click Advanced Tab on the Manage Plugins Page

advanced

4. Click Choose File and locate the Jenkins-cucumber.hpi file you downloaded earlier

  • Click Upload to upload the hpi file to the Jenkins server

upload

5. Click the Available Tab and scroll down to the bottom of the page

  • Click the install without restart button

install

6. Check the Restart Jenkins when installation is complete and no jobs are running box

restart

7. After Jenkins restarts go back to the Manage Plugins page and click the Installed Tab

  • Check cucumber-reports is installed and is ticked and the version is correct

installed

Configure the Plugin Once Installed

1. Ruby Cucumber – Open the configuration page for your job

  • If you are using ruby cucumber add a build shell step with cucumber --format json -o cucumber.json
  • Check the box: Publish cucumber results as a report
  • Enter the path relative to the job workspace where your cucumner.json file that you specified in the build step above is generated

Configuration

2. Cucumber JVM – Open the configuration page for your job

  • If you are using maven and cucumber-jvm add a build shell step with maven clean install
  • Check the box: Publish cucumber results as a report
  • Enter the path relative to the job workspace where your cucumber.json file that you specified in the build step above is generated

Configuration

3. Link to the report

  • Once the report is generated you can open it via link displayed on project details panel or on the job panel

Link to the report

Notes on Configuration

  • The Json Reports Path field in the config should point to the directory where your cucumber.json file is generated. So the easiest way to check is to view the job workspace (click on the workspace link from the job page) and click down the directory structure until you find where your cucumber.json file lives. (assuming you have run the build at least once) then enter the path in the config field: e.g. target if your workspace contains the directory target at the top level and you use maven. If your target directory is further down in your file structure – put the path to it e.g. dir1/dir2/target
  • The field already supplies the path to the workspace with a trailing slash (/) so you just need to supply the bit afterward e.g. [/path/to/the/workspace/] target <– you supply this bit (target)
  • The second config field is for when you have Jenkins installed somewhere other than the default hostname:8080 – if you have it at http://hostname:8080/jenkins then the assets and stylesheets won’t be found and you have to supply the path to it which in this case would be: /jenkins/
  • The assets are retrieved from the path http://hostname:8080/name_of_plugin/plugin_files_are_here – so in the case above http://hostname:8080/jenkins would be http://hostname:8080/jenkins/name_of_plugin/various_assets – you would have to supply the path to the name_of_plugin with both the leading and trailing slash (/) e.g. /jenkins/

HOW TO SET JAVA_HOME ON MAC

Trying to run a Java application on your Mac and need to set your JAVA_HOME?  Follow the instructions below to quickly and easily do it:

  • Open Terminal
  • Confirm you have JDK by typing “which java”. It should show something like /usr/bin/java.
  • Check you have the needed version of Java, by typing “java -version”.
    • JAVA_HOME is essentially the full path of the directory that contains a sub-directory named bin which in turn contains the java.
    • For Mac OSX – it is /Library/Java/Home
  • Set JAVA_HOME using this command in Terminal: export JAVA_HOME=/Library/Java/Home
  • echo $JAVA_HOME on Terminal to confirm the path
  • You should now be able to run your application

Note that this sets JAVA_HOME only for this session. If you want it to persist, you will have to add the command to your ~/.profile file.  Below are instructions on how to accomplish this instead:

  • Open up Terminal.app (Applications >> Utilities >> Terminal)
  • Type: emacs .profile
  • add this to the end of the .profile file:

JAVA_HOME=/Library/Java/Home
export JAVA_HOME;

  • Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
  • Open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version

If you see something like:
java version “1.8.0_…″

Then you’ve successfully set your JAVA_HOME environment variable to the binary stored in /Library/Java/Home/bin/java