Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

LATTE JENKINS SETUP

Latte how-to Documentation


Contents

Introduction.............................................................................................................................................3
Jenkins installation..................................................................................................................................4
Jenkins Configuration..............................................................................................................................5
Jenkins master and slave.........................................................................................................................7
Setting up a Jenkins job for Latte..........................................................................................................11
Report analysis......................................................................................................................................15
Introduction of Jenkins Introduction

Jenkins is the tool used for continuous integration concept where we can build and test
software projects continuously and it monitors the executions of jobs. Jenkins keeps the
outputs and makes it easy for you to notice when something is wrong, which helps achieve
the continuous integration solution to provide executives, managers, developers and
architects a better sense of the development progress and code quality throughout the
project lifecycle.

What is the value addition by integrating the Jenkins with automation


harness?

 We can trigger the job remotely.


 Test can be initiated with code placed with various repository like
GitHub, Perforce, and SVN etc.
 We can configure our test to run with the required time intervals set.
 We can track the execution history by accessing the console for the
different build.
 Test results are automatically send the preconfigured mail list.
 TestNG reports can be tabulated, summarized, and displayed with
History information.
 History information.
 Recording log file functionality (log4j API).
Jenkins installation
There are two ways to install the Jenkins:-

1. Native package: Installs Jenkins as backend service which runs all the time in back
end.
a. Download executable file from https://jenkins-ci.org/ as per the OS.
b. Install Jenkins on the OS.
i. Windows :- http://mirrors.jenkins-ci.org/windows/latest
ii. Mac :- http://mirrors.jenkins-ci.org/osx/latest
iii. Linux(Ubuntu/Debian) :- http://pkg.jenkins-ci.org/debian/
c. Then in browser got to http://localhost:8080.
d. It will display the Jenkins web UI.

2. Java Web Archive (.war): Jenkins can be started manually by using the command
“java –jar Jenkins.war” in the command prompt or terminal (Linux).
a. Download the .war file from http://mirrors.jenkins-ci.org/war/latest/jenkins.war
b. In the command prompt or Terminal, change your current working directory
to the folder where Jenkins war file is downloaded.
c. Run the command “java –jar Jenkins.war” to start Jenkins and let it set
Jenkins home automatically.

Or if you want a specific Jenkins home then run this command


“Java -DJENKINS_HOME=c:/Jenkins -jar Jenkins.war” it will set
c:/jenkins as Jenkins home directory.

d. Now that Jenkins is up and running navigate to http://localhost:8080 in the


browser.
e. It will display Jenkins web UI.
Jenkins Configuration
To enter Jenkins configuration we need to click on “Manage Jenkins”

Once manage Jenkins clicked it will navigate to “Manage Jenkins” page which will have
many options to configure.
Basic configurations are:
1. Configure System: It is used to configure the system and tool configuration like Git,
java, Gradle…etc. Click on Global Tool Configuration and add jdk file path.

We provide the location of the tools installed in the system, So that Jenkins can
access to them when required.
2. Configure Global Security: it defines the security for accessing the Jenkins and user
Authorization.

3. Manage Plugins: Here we install plugins which are required for our project like
TestNG, Gradle, and Pipelines…etc. Add Publish HTML Reports and TestNG
plugins manually.

a. Updates: Plugins can be updated in this section if update is available.


b. Available: All the plugins will be displayed here, we can select and install
required plugin in this section.
c. Installed: It will show the plugins which are installed.
d. Advances: Here we can upload any plugin if it is not available in Jenkins
available section.

Jenkins master and slave


In any service or product based project, the application has to be deployed in different
machines with different environments. In such case we can configure multiple nodes as slave
machines in Jenkins and setup the QA infrastructure in slave machines without any human
intervention. Jenkins works on a 'master->many slaves' principle. The master node is
responsible for creating jobs and managing the slave nodes, where the jobs are actually
performed. The master node is essentially doing management work and farming out preset
jobs to the most appropriate site. Each slave then informs the master of the outcome and all
of the job results are collated on the master node for easy viewing.

Setup Guide for master and slave configuration:-


1. go to Manage Jenkins > Manage Nodes

2. Click on New Node.


3. Enter the node name and select as Dumb Slave and press OK.

4. Fill out the following:


I. Set a number of executors (one or more) as needed.
II. Enter Slave machine for IP (IP address) for (purpose of slave machine) in the
description field.
III. Set a Remote FS Root, a home directory for the master on the slave machine.
"C:\Jenkins\"
IV. Select the appropriate Usage setting:
a. For an additional worker: Utilize this slave as much as possible
b. For specialized jobs: Leave this machine for tied jobs only
V. Launch Method: Multiple options present. Select any one based on requirement
a. Launch slave agents on Unix machines via SSH Availability
b. Launch slave agents via Java Web Start
c. Launch slave via execution of command on the Master
d. Let Jenkins control this Windows slave as a Windows service
VI. Availability: Multiple options present. Select any one based on requirement
a. Keep this slave on-line as much as possible
b. Take this slave on-line according to a schedule
c. Take this slave on-line when in demand and off-line when idle
VII. Click Save.

5. Connect to Slave machine:-


a. Open a browser on the slave machine and go to the Jenkins master server url
(http://yourjenkinsmaster:8080).
b. Go to Manage Jenkins > Manage Nodes, Click on the newly created slave
machine. You will need to login as someone that has the "Connect" Slave
permission if you have configured global security.
c. Click on the Launch button to launch agent from browser on slave.

d. Run the program.


e. Now you should see the Slave machine connected under Nodes.

6. If you want the service to run on start-up of the slave machine do the following
(Windows only directions):-
a. In the Slave agent program running on your slave machine,
b. Click File --> Install as Windows Service.

Note: Note that this feature requires ".Net Framework 3.5"


c. Start, type Services and Select the Services program.
d. Find Jenkins Slave in the list, Double click to open.
e. Select Startup type --> Automatic.
f. Go to the Log on tab, change the Log on as to a user of your choice (Special
user account Jenkins recommended).
g. Make sure that auto login is set for the slave machine for the user account,
then the VM (or physical computer) should connect and be available when
needed.

7.
Setting up a Jenkins job for Latte
Pre-requisite: -
a. Place Selenium Grid related files under “C:\LATTE_GRID”

b. Start “server.bat” first and then “GRID_NODES.bat” to make Sure Selenium Grid is up
and Running.
c. Now Place\download “Smart Eye application” to any specific location which can be
accessible from Jenkins (best place is: “C:\Latte-executables”). And Latte application
dependent files will be stored\downloaded in Jenkins job workspace.

Latte Jenkins Job Configuration: -


1. The build/execution of a project is handled via jobs in Jenkins. Select New Item from
the menu to create new job for Latte Execution.

2. Afterwards enter a name for the job and select Freestyle Job. Press OK to create a new
Job in Jenkins. The next page allows you to configure your job. If we are using GitHub,
then enter the URL to the Git repository. And we can do other job related setting Like
Gradle, TestNG…etc.
3. Specify where to run the job, Ex: Jenkins master or other Jenkins nodes.

4. Next, Select Jenkins Batch or PowerShell Plugin in BUILD stage to give Latte
commands for execution. And enter the command:-
a. CMD: "c:\SmartEye.exe" -host localhost -port 8885 -ConfigFile configJSON.json -ProjectLocation
"Demo-Scripts.lat" -execute
b. PowerShell: & 'C:\Latte-executables\LATTE CLI 6.0.3.exe ' -host localhost -port 8885 -
ConfigFile configJSON.json -ProjectLocation "Demo-Scripts.lat" -execute
5. Once execution setup is done, we can configure how our Report should be published.
This can be setup in “Post Build Actions”. We can use two ways to publish them: -
NOTE- Make sure you have installed below two plugins manually. s
a. HTML Publish: This plugin will Process the HTML report file generated by
Latte after execution. Last Html Report Location can be set in the Latte CLI
Json file and that location can be used below.

b. TestNG: This will Process TestNG Reports and Make the Job Pass, Unstable
and Fail based on the execution reports.

6. Now click on “Save button to save the job”. Once saved job will be displayed in Jenkins
job section.
7. When we click on the job name, it will take us to job page. On the job page click on
“Build now” to start the execution.

8. Once job execution started we can see build number under build history.

On clicking on the build number. It will take us to the build details page where we
can see build related details.

If we wish to see the Console of the Execution, we can click on “Console Output”.
9. To stop the job execution we can click the (x) button on the job progress.

10. To delete the job we have to click the ‘delete project’ and then select yes.

Report analysis
1. HTML Report: To View the HTML Report of Latte we can click on “HTML
Report” under the Job.

This will take us to the HTML Report Page. Where we can see the Latest HTML
Report. On clicking “Back to jobname”, will take us back to job page.
2. TestNG Report: TestNG Reports are used for Marking Build as Pass, Unstable or Fail
based on the Results. Graph of the TestNG will be displayed under Job page.

On the Job build page, clicking on “ ” will take us to detailed TestNG


report.

You might also like