Jenkins IntegrationExecuting Scripts Using Jenkins Pipeline Workflow

Executing Scripts Using Jenkins Pipeline Workflow

A pipeline workflow is an automated sequence of steps managed by Jenkins, where scripts generated by algoQA are executed automatically as part of this workflow. This article provides the required details.

Prerequisites

Configure Jenkins

For the detailed steps on Post-Installation Setup Wizard and configuring Java and Maven, see How to Set Up Wizard after Installing Jenkins and Configure Java and Maven in Jenkins articles.

Create a New Item and perform a pipeline run

Perform the following:

In the Jenkins Dashboard, click New Item.

Jenkins Dashboard welcome screen with New Item button highlighted and Create a job option

In the New Item screen, enter the project name, select Pipeline, and click OK to go to the Configuration page.

By default, the General page is displayed.

Jenkins New Item page with empty name validation error and Freestyle project, Pipeline options
Jenkins New Item screen with Pipeline job type option highlighted and OK button

In the General page while configuring, navigate to the Pipeline section and update the code in the Pipeline description along with the updated path.

This is applicable only to Java Selenium scripts generated using algoQA on the Windows operating system.

Jenkins pipeline script defining Run Maven Tests stage and post build success and failure echo steps
Jenkins Pipeline script editor showing post block code with Save button highlighted

Update the path (the path is the location where the algoQA script is downloaded to the local folder):

Jenkins pipeline script editor with dir path line highlighted and Use Groovy Sandbox checked

Click Save to open the pipeline project.

In the Project page, click Build Now in the left pane.

Jenkins Test Project status page with Build Now option highlighted and build permalinks list

After the build is triggered, progress is shown in the Build History.

Hover over the build number to view the down arrow. Select the down arrow to view the dropdown menu. In this menu, select Console Output to view the details for this particular pipeline run.

Build History list with dropdown menu and Console Output option highlighted

The details of the selected pipeline run can be accessed.

Jenkins Console Output page showing Run Maven Tests pipeline stage output