Follow the below steps.

Step #1 Software installations required

Step #2 Starting Jenkins

Step #3 Configuring software on Jenkins

Select "Manage Jenkins" and afterward, configure the system.

Jenkins

Jenkins

Step #4 Install Plugins required

  1. Go to Manage Jenkins -> Manage Plugins.
  2. Go to the Available tab.
  3. Search using a filter for Git Plugin, HTML Publisher Plugin.
  4. Check the box besides the plugins displayed after the search.
  5. Click on "Download now and install after restart" button.

    Jenkins

  6. Restart Jenkins.

Step #5 Creating new Job for running Serenity tests

  1. Click on "New Item" from the homepage.
  2. Enter the Job Name, and select Maven project.
  3. Click OK button.

    Jenkins
  4. Under the "Source Code Management" section, select Git and provide GIT URL. For instance -
    https://bitbucket.org/xxx/xxx.git

    Jenkins

  5. Click "Add" button and provide your username and password to access the Git Repository.

    Jenkins
  6. Under "Build" section, provide Root POM, Goals, and options.

    This is to specify which test to run.

    Ex - If HomeStoryTest has to be run, we should provide as below using –Dit.test switch.

    If all tests have to run, give as ‘clean verify’ (without any switch).

    Jenkins

  7. Under "Post-build Actions" section, select Publish HTML reportsfrom ‘Add post-build action’ dropdown.

    Jenkins
  8. Provide Index page path as below.

    Jenkins

  9. Click on "Apply and Save" button.

Step #6 Running a Test

From the Story page, click on "Build Now".

Jenkins

Step #7 View the Test Results

  1. We can view the console output while the test is running from the "Build Progress" section. Click on dropdown to go to the console output.

    Jenkins

    Jenkins


  2. Access HTML Reports from the "Job Dashboard" page.

    Jenkins

  3. Serenity Reports will be displayed as below.

    Jenkins