Jenkins Configuration
Once you have installed Jenkins, you can proceed for Jenkins configurations.
- Open URL: http://localhost:8080.
- Enter the Administrator password.
Take the Administrator password from the initialAdminPassword file located in the .jenkins\secrets folder. - Click Continue.
- Jenkins asks to install plugins. Skip to install plugins for now clicking the X icon from the top right corner of the window and click Start using Jenkins button.
- Go to Jenkins > Manage Jenkins > Manage Plugins.
- Access the Available tab.
A list of available plugins is displayed to select and install. - Select HTML Publisher Plugin, Email Extension Plugin, Environment File Plugin, and Environment Injector Plugin.
- Click Install without Restart.
Post successful installation; go to the Jenkins' dashboard. - Click New Item.
- Enter the item name, select Freestyle project, and then click OK.
You are navigated to new job configuration page. - In the Build section, click Add build step and then select Execute windows batch command.
- In the Command text box, enter the command to execute qualitia-offline.xxxx.jar.
For example: <drive name where offline package is saved>:\cd<location where offline package is saved>\Offline package qualitia-offline.xxxx.jard:
cd D:\Qualitia\offline package
qualitia-offline.xxxx.jar - Click Add Build Step and select Inject environment variables.
Note: This step has to be followed by step 12; otherwise Qualitia Reports will not be visible through Jenkins. - Update Properties File Path for the file qer.properties along with the file name.
This file is located in the Offline Package. For example: <Offline Package location>\qer.properties - In the Post-build Actions section, click the Add Post build action button and select Publish HTML reports.
- In the Publish HTML reports section, enter the values as mentioned below:
- HTML directory to archive: $qualitiareportpath
- Index page[s]: $reportfilename
- Report title: Qualitia Report
- Select the Keep past HTML reports check box.
- Click Save.
- On the top left corner of the screen, click Jenkins > Manage Jenkins > Configure System.
- In the E-mail Notification section, click the Advanced button and fill up the information that includes;
- SMTP server,
- Default user e-mail suffix,
- Select the Use SMTP Authentication check box,
- Enter User Name,
- Enter password,
- Select the Use SSL check box,
- SMTP port,
- Reply-To Address, and
- Charset
Below is an example for reference.
21. Select the Test configuration by sending test e-mail check box, update the e-mail address and click Test Configuration.
System notifies in case of any errors. Recheck the settings in case of any errors. Refer to the screenshot below for correct values of Extended E-mail Notification section.
Note: Multiple email addresses can be added by separating them using ','. Subject and content of the email can be changed as per your company requirements.
22. Click Save.
23. To enable this email notification for any project, from Jenkins' dashboard, click the project name and click Configure in the left pane.
24. In the Post Build Actions section, click Add post-build action and select Editable Email Notification.
25. Click Advanced Settings button.
26. Click the Add Trigger button and select the status from the list for which you wish to get notifications.
27. Select the status for which you wish to receive the email notifications.
28. Click Save.
Execute and View Report
Once all the settings are configured successfully, you can proceed to execute the test cases and view reports respectively.
- Access Jenkins' dashboard.
- Click the down arrow near project name and then click Build Now.
You can view the complete build history in the left pane under Build History.
- User will also see execution of the Test Cases involved in the Offline Package.
- Once the build is successfully generated, click > Qualitia Report.
- Qualitia Offline Package execution report is displayed in the browser.
- User can view earlier reports by selecting the respective Build and going to Qualitia Report of that build.
- User can click on the zip link to download the zip of the Qualitia Report folder/files.
Parallel Execution with Jenkins
The Parallel Execution approach works on Linux. You need to install plugins mentioned below that help in executing test cases.
- xvfb plugin for Jenkins (https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin)
- Build Flow Plugin for Jenkins (https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin)
Once both the plugins are installed,
- Create a job with a suitable name. For example: Smoke_Suite.
- Select "Build Flow" from the options and click Ok. It takes you to the Configure section of the Build Flow plugin.
- Go to Build Triggers and add your script as mentioned below;
parallel(
{build("Smoke_Firefox")},
{build("Smoke_chrome")}
)
In the example above,
"Smoke_Firefox" and "Smoke_chrome" are qualitia offline jobs that are configured to execute on Firefox and Chrome respectively. You can build multiple complex flows using this plugin. Please go through the Build Flow plugin URL to explore further.
Configuring Qualitia Offline Job
In order to run parallel executions, you need to configure Qualitia offline jobs accordingly. Once jobs are configured,
- Open the project configuration and select the Start Xvfb before the build, and shut it down after check box.
- In the Execute Shell text box under the Build section, run the qualitia.offline.jar. Refer to the command mentioned below.
cd /home/qualitia/QualitiaOffline
java -jar qualitia-offline-x.x.x.jar smoke.propertiessbrowsertype=googlechrome ScreenCaptureMode=BROWSER
It is recommended to keep the ScreenCaptureMode as BROWSER when running parallel executions.
Execute Tests in Parallel
Once offline jobs and respective settings are configured successfully, you can execute tests in parallel executing the Build Flow accordingly. As per the example mentioned above, this executes both "Smoke_Firefox" and "Smoke_Chrome" concurrently.
Once execution is completed, you can go to reports on the build flow job and check the results.